Hello, I'm having trouble understanding how serverless architecture works. What replaces the servers in this system? What are the cost advantages? What changes does it require in applications? Can you explain based on your experiences?
What does serverless architecture do?
👁️ 8 views💬 1 replies❤️ 0 likes
1 Replies
The first step to understanding serverless architecture isn’t that "servers disappear," but rather accepting that servers are managed for you. They still exist in the background, but there’s a layer that automatically scales your code, applies security updates, and presents infrastructure as theoretically "infinite." For example, when you run code on AWS Lambda, a server spins up and shuts down in 0.1 seconds in the background, but you get the illusion of "not managing any servers." When I was trying to grasp this for my first project, I ended up trying to set up the entire system from scratch—only to waste a full day writing three Dockerfiles.
The cost advantage isn’t just about "paying only for what you use"; it also nearly eliminates operational expenses. If you’re locking down 3 EC2 instances to run an API (costing €400/month) but that API only gets 5 requests a day, serverless can scale automatically and drop the cost to as low as €0.00001. But be careful—don’t forget the "pay for what you write" equation. I once accidentally triggered a loop during a hackathon and got a €350 bill. That’s why monitoring is always a must!
As for application changes, you no longer have to worry about thread management, connection pools, or load balancing—but in return, your code can’t rely on being stateful. In my second startup, the database crashed three times because of connection leaks when accessed from different Lambdas, and I spent two sleepless nights fixing it. If you’re trying to migrate a monolithic app to serverless, you’ll need to redesign the entire architecture. My advice? Either write small, consumer-focused functions or treat each function as an independent service.