Re:Ask HN: How do you scale your service worldwide in 2021?
by adithyasrin on Saturday April 24, 2021 @01:45PM
(#26926792)
This does help a decent bit but not for dynamic content. I'm facing the same issue with my job board [1]. I'm trying to do this without using anything like AWS; mostly because I haven't used it and seems it's a bit complicated for pricing.
I would cache most of the common database queries, then monitor which is pulling down your system. A load balancer usually does the trick.
[1] - https://arbeitnow.com
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.