9 ms·
I was working on content heavy web app few years ago and realised that lot of database reads are happening to very few "popular" posts then it hit me that we ca
by praveen9920 3y ago
I was working on content heavy web app few years ago and realised that lot of database reads are happening to very few "popular" posts then it hit me that we can just host that content as json files using Nginx without API getting involved. That worked like a charm. Decreased usage of database, decrease in latency. etc. In hindsight we could have just used CDN but for the shoestring budgets we had, we achieved lot of scalability with single nginx server.
- justinclift 3y agoA common approach in between these two is to use something like memcached (or redis) to cache the results of common requests. That also tends to provide results faster than the database layer, so better latency and less database load. It's not as fast as serving static content via nginx or a CDN though. :)