Estimate Cost to Handle 500 Million Monthly API Invocations?

I want to create a Node.js API to retrieve feature flags data periodically (every 30 minutes). There is no database involved; the API returns hardcoded data. For 99% of the time, the same data is returned to all users. The monthly invocation of this API is around 500 million.

Before I invest time implementing this, could someone please share the estimated monthly cost?

I’m assuming that you’re talking about the API in Node.js getting 500 million hits per month.

Do you need authentication logic in the mix? If not you could probably do it with Tigris custom domains and upload the relevant data as JSON objects to a bucket. In their pricing model they set GET requests at $0.0005/1000 requests. This means that a million requests are $0.50, so in total it should be like $250? That seems kinda high though, so I’ll go another route too.

I don’t know what the efficiency of node.js is like for these kind of things, but 500 million requests per month is about 190 requests per second (according to my very bad use of wolfram alpha). This means you have about a 2 millisecond budget per CPU core at the very worst case. Let’s assume that you can handle this with 25 machines that have 512 MB of ram each and 2 shared cores. Each of those machines is about $3.19 per month for a total cost of about $80. But this is when bandwidth becomes a concern.

I don’t know how big the responses are, but assuming the entire HTTP response is 4 kilobytes your bandwidth costs for about 2 TB will be anywhere from about $41 (US/EU traffic) to about $250 (India and Africa traffic). My math here does not include free allowances of 160 GB, which could save you anywhere from $3 to $20 in the worst case. This would get you a total cost of anywhere from $120 to $330, depending on where your clients are.

Maybe Tigris would be the best option here, but only if your traffic is mostly to Africa or India.

I’d need to know more to do better pricing math.

1 Like

That’s a very detailed response you gave, thank you for that.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.