Nice article! I've been doing a bunch of caching work recently and one thing to keep in mind is distributed locking. Helps avoid unnecessary pressure on the systems that are filling the cache.
In Cache Tower, I use the presence of a key already being set to see whether I should call the factory method or not:
Once the new value is cached, I use the pub/sub feature of Redis to inform the instances of the application that the cache is refreshed. This then allows those waiting requests to just ask Redis for the new value rather than process it themselves.
As an aside, noticed you're from Adelaide too - Hi! 👋
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice article! I've been doing a bunch of caching work recently and one thing to keep in mind is distributed locking. Helps avoid unnecessary pressure on the systems that are filling the cache.
In Cache Tower, I use the presence of a key already being set to see whether I should call the factory method or not:
Once the new value is cached, I use the pub/sub feature of Redis to inform the instances of the application that the cache is refreshed. This then allows those waiting requests to just ask Redis for the new value rather than process it themselves.
As an aside, noticed you're from Adelaide too - Hi! 👋