4 ms·
> I optimized it in a way I’ll only pay hosting fees when the site is having a lot of traffic. Like 1M+ visits per month. I wonder what optimizations were done
by victor106 6y ago
> I optimized it in a way I’ll only pay hosting fees when the site is having a lot of traffic. Like 1M+ visits per month.
I wonder what optimizations were done so you can only pay for 1M+ hits?
- JshWright 6y ago1 million hits in a month is only one request every couple seconds. It doesn't take much to host that.
- nightcracker 6y ago> 1 million hits in a month is only one request every couple seconds. That's a really naive view of how hits are distributed over time.
- majewsky 6y agoEven if rush hour has 10 times more traffic than off hours, that's still only 4 requests per second. Any unoptimized Postgres on a 2/2 node should be able to handle these loads just fine.
- marcosdumay 6y agoThat's the average. Of course, hits are not homogeneously distributed. But an average of less than one hit a second leaves more than enough leeway for any reasonable clustering you may come with. Any small computer can handle thousands of times more than that. There is some questions about bandwidth costs, that can vary wildly.
- elazzabi_ 6y agoHey, author of the post here. The whole app lives in Firebase. Once a user hits a profile page, a cloud function runs, get the data from the DB, constructs the page, and caches it at the CDN for 24h. If a user add/delete something on their profile, the cache is removed. Otherwise, the content is served from cache only with no need for a lot of computation. With this, you can still get your way through Firebase's generous free tier https://firebase.google.com/pricing https://firebase.google.com/pricing
- JustWright 6y agoFirebase free tier is only 125k invocation per month. How are covering +1M invocations per month on free tier?
- rnotaro 6y agoCaches hit on the CDN are not trigerring an invocation. So it's not covering 1M+ invocations per month on the free tier.