| Hi HNers, Built a service in the form of an app during the course of the pandemic for people to watch videos and receive news. However since the pandemic, I had a huge surge of people signing up and straining my backend, leaving me frantically trying to keep the servers up and respond to customers at the same time. It must have been hard 10 or 20 years ago to scale your backend/service to reach as many people as possible worldwide than it is today, but I still struggled with this. I'm curious how would one do this when faced with a TON of customers as I had to face. If you're curious of my stack: it's all on Heroku, Redis, Node & 2 Postgres servers. Would also like to know what you would have done better as well. |
If you are not familiar with CDNs yet, learn how works the Cache-Control HTTP header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...) so you can send a different header for API responses than for static assets responses. Then learn how to purge the CDN after each release.
I would recommend to start with Cloudflare as it's cheaper, and easier to use.
A CDN with correct Cache-Control headers and Heroku Autoscaling should bring you very far in term of traffic you can handle.