Interview: Why Is Cache Faster Than a Database?
Why Cache Is Faster Than a Database!
A cache keeps a ready-made answer so your app doesn't have to work it out again. Picture a homepage that shows the 10 most liked photos from the last 24 hours. Every time someone visits, PostgreSQL has to read the SQL query, plan how to run it, search the data, count the likes and sort the results.
With thousands of visitors a second, the database repeats that same heavy work over and over for the same answer. Store the top 10 list in a cache like Redis once, and every visitor after that gets it instantly with no query at all.
Follow for more DevOps and cloud concepts explained simply.
#caching #redis #database #postgresql #systemdesign #backend #softwareengineering #devops #programming #webdevelopment #sql #kodekloud
KodeKloud
...