Formon, a startup, is moving away from serverless architecture due to increasing costs and limitations with background tasks. They found that using dedicated EC2 servers became more cost-effective and provided better control over background tasks, allowing for increased performance and vendor neutrality, while maintaining scalability through a hybrid approach with cloud providers.
Serverless Cost
• 00:02:44 Serverless solutions, like AWS Lambda, become increasingly expensive as the number of requests grows, especially for startups with rapidly growing user bases. At 50 million requests per month, the cost was around $90, and projected to increase to $1,000 with a tenfold increase in requests. This would become a significant financial burden for a small startup.
Background Tasks
• 00:07:42 Serverless functions, like AWS Lambda, present challenges when implementing background tasks. The speaker illustrates this with a course editing example where revalidation of cached pages happens in the background, which is hard to manage efficiently in a serverless environment. AWS Lambda has a 15-minute limit for background tasks, whereas dedicated servers allow for indefinite background task execution.
Vendor Lock-in
• 00:07:01 Serverless architecture can lead to vendor lock-in, in this case, to AWS Lambda. Moving to a dedicated server environment allows Formon to avoid this, giving them greater flexibility in choosing and switching cloud providers in the future. This approach provides a greater degree of control and independence over their infrastructure.
Performance and Optimization
• 00:12:21 Moving from a short-lived serverless function environment to a long-running EC2 server environment provides performance benefits. A long-running Node.js process offers the Just-In-Time (JIT) compiler more opportunity to optimize the code execution based on the runtime behavior. This leads to better performance and potential improvements in application speed.
Hybrid Solution
• 00:10:24 Formon utilizes a hybrid solution by combining dedicated servers with cloud providers like AWS. Reserved VMs are used to handle the expected workload, and cloud services act as a scalable fallback for peak demand. This approach provides a balance of predictable cost and the ability to quickly scale up in response to surges in user activity.