Bhupesh-V / tutorialdb

A search 🔎 engine for programming/dev tutorials,
MIT License
121 stars 60 forks source link

Caching the database queries #37

Open vikneswaran20 opened 4 years ago

vikneswaran20 commented 4 years ago

Caching the DB queries will vastly improve the performance of this kind of projects This is a read-heavy web application where the read is pretty more when comparted to write. As data becomes huge the query performance will be very slow. So introducing the caching will be good to scale up this application.

Bhupesh-V commented 4 years ago

Yes you are right @vikneswaran20 , I actually removed cached query from the latest release due to some problems feel free to contribute and do let me know the approach :+1:

vikneswaran20 commented 4 years ago

I have added the caching for the Tags page initially since the page is pretty static unless a new tag gets introduced. So I will be checking if there is a key in the cache for all the tags during tags page load if it doesn't I will query the DB and update the cache. Once the new tag has been added to the DB I will remove the cache. So during the next visit to tags page cache get automatically updated.