![]() Who would do that? There could be several real life scenarios when one might be forced to avoid having to use messaging queues for various reasons like - to save costs, avoid adding a new component in infra to avoid security audits, certifications, etc, lack of skills to use or manage, cumbersome approval process. If there are too many write operations for the same key, then there might be some design issues because at the very least it will have to deal with the concurrency related problems. That is why the important distinction was 'for a given key'. Now there are certain cache architectures like write-back cache which do help in batching the write operations. If done correctly, for a given key, most traffic to a cache should be read operations and towards database be write operations. Since caching architectures are not really the topic of discussion here, let's leave it for self discovery and learning. One of the balanced approach is to have a two-level cache - a local cache backed by another shared/distributed cache. If (vertically) scaling up was the solution then the database itself could have been scaled, why even put a caching server. Now one can scale the caching server up but thats not really a lasting solution and only delays the pain. Abuse it enough and the caching server starts running out of CPU and/or memory, etc. Developers often assume a cache is less costly call but they often tend to overlook the fact that it's less costly compared to a database call. And it works too - until the caching server is the one that starts getting drowned under the load. Idea being, a cache will shield the database from frequent repetitive calls. One of the first reaction to an overloaded database problem in a distributed system is to introduce a cache. Let's go beyond the caching architectures and layouts and explore few scenarios when things may not work as expected. The cache should really be a hidden place - not only hidden from the user's perspective but also from the program logic. ![]() ![]() It is curious to see the dictionary meaning of the word Caching being defined as 'to store things in a secret place'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |