Using Redis for caching the API data
Redis is an in-memory database that can store key/value pairs. It best suits the caching use cases where we need to store information temporarily but for huge traffic. For example, sites such as BBC and The Guardian show the latest articles on the dashboard. Their traffic is so high, if documents (articles) are fetched from the database, they need to maintain a huge cluster of databases all the time. Since the given set of articles does not change (at least for hours), the BBC can maintain a cache which saves the articles. When the first customer visits the page, a copy is pulled from the DB, sent to the browser, and placed in the Redis cache. The next time a customer appears, the BBC application server reads content from Redis instead of going to the DB. Since Redis runs in primary memory, latency is reduced. The customer sees his page loaded in a flash. The benchmarks on the web can tell more about how efficiently a site can optimize its contents.
What...