
Caching is awesome but it doesnβt come without a cost, just like many things in life.
One of the issues is ππππ‘π ππ’π¬π¬ ππππππ€. Please correct me if this is not the right term. It refers to the scenario where data to fetch doesn't exist in the database and the data isnβt cached either. So every request hits the database eventually, defeating the purpose of using a cache. If a malicious user initiates lots of queries with such keys, the database can easily be overloaded.
The diagram above illustrates the process.
Two approaches are commonly used to solve this problem:
Caching is awesome but it doesnβt come without a cost, just like many things in life.
One of the issues is ππππ‘π ππ’π¬π¬ ππππππ€. Please correct me if this is not the right term. It refers to the scenario where data to fetch doesn't exist in the database and the data isnβt cached either. So every request hits the database eventually, defeating the purpose of using a cache. If a malicious user initiates lots of queries with such keys, the database can easily be overloaded.
The diagram above illustrates the process.
Two approaches are commonly used to solve this problem: