Delegation is wonderful. You can focus on business needs and quickly start generating profit and satisfying your clients' needs, which is the main reason for creating a startup. In the initial stages, when you are just starting to get your first visitors, everything is fine. You achieve significant savings on DevOps engineers' salaries, who create and maintain your infrastructure and code deployment, DBA specialists who deploy and maintain your databases. Security engineers are also not your headache – all security issues are handled by the cloud provider.
Problems usually arise suddenly as your business grows. This is particularly evident in the case of FaaS. Creating serverless applications on something like AWS Lambda is very quick and convenient. You focus only on new features and immediately implement them, increasing your business's value to customers. Unfortunately, the downside of this simplicity is the need to strictly control the efficient use of cloud resources. When, during a surge in visitors, inefficient code generates 80+ million requests, you will be extremely unpleasantly surprised by the bill from the cloud provider. Billing almost always works with a certain delay, and the set limits often do not react in time to short spikes.
Remember that for such models, you must always pay close attention to optimization:- Number of function executions. Launch only what is needed. Avoid unnecessary requests. Cache if possible.
- Duration of their work. Strictly monitor timeouts in your code and logic. Hundreds of thousands of function executions hanging for a long time waiting for an external event will not make you happy.
- Memory allocated for the function
Data transfer. Pay attention to the direction of data flows. They are billed very differently within and between regions. Transmit only what is truly necessary.