Modern database provide caching support. Most of the ORM frameworks cache retrieved data too. Why this duplication is necessary?
The cache actually stores the data already loaded from the database, so that the traffic between our application and the database will be reduced when the application want to access that data again. The access time and traffic will be reduced between the application and the database.
In-memory data caching can be one of the most effective strategies to improve your overall application performance and to reduce your database costs. Caching can be applied to any type of database including relational databases such as Amazon RDS or NoSQL databases such as Amazon DynamoDB, MongoDB and Apache Cassandra.
Databases are generally regarded as persistent, consistent and queryable data stores. Caches behave like databases, except they shed many features to improve performance like it favors fast access over durability & consistency.
It consists of the insertion of caching logic into the application base code to temporarily store processed content in memory, and then decrease the response time of web requests by reusing this content.
Because to get the data from the database's cache, you still have to:
By caching at the application level, you don't have to do any of that. Typically, it's a simple lookup of an in-memory hashtable. Sometimes (if caching with memcache) there's still a network round-trip, but all of the other stuff no longer happens.
Here are a couple of reasons why you may want this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With