Estimate Your Backend Costs
When you’re starting a startup, it’s good to estimate what your backend costs will be.
Take Telegram as an example. It has 36 million daily active users. Assume each user makes 100 HTTP requests a day. Let’s calculate how much it would cost if we use the costliest abstraction, which is FaaS. We’ll use Google Cloud Functions for this example, but you can do this exercise with any backend framework. GCF offers different instance types with different amounts of CPU and memory. Let’s assume that we’ve optimised our code to use the cheapest. Then, GCF bills based on the time of execution, rounded up to 100ms. So let’s assume we’ve optimised all our functions to complete in 100ms. Assume also that each invocation returns 1KB. Incoming bandwidth is free, so we don’t need to consider it in this calculation. Taking all the above into account, GCF costs $84,000:
This is a trivial amount to pay for a startup with hundreds of millions of users!
You should do a similar analysis for your startup to estimate costs. It will be inaccurate, but an order of magnitude estimation — is it $800/month? $8000? $80,000? $800,000? — is valuable for planning.
You should know what your costs are, and will be in the future, but don’t be cost-driven. Your job as a startup is to demonstrate business value, and you should use whatever technology helps you reach that goal the fastest. If you are miserly, others will move faster, and beat you. It would be like participating in a car race but driving slowly to conserve fuel, which is a guaranteed way to lose.