Basics of Serverless architecture

Ravindra Elicherla
3 min readJul 30, 2018

--

Did you ever come across this situation?

Your Product Owner came up with a brilliant idea just well timed with your sprint planning meeting. You heard the idea, your team heard with even more enthusiasm and all are excited to build the product in next three weeks. on day 2 you realised, you need to procure a new server as you ran out of capacity with existing products. You pinged your friend in infrastructure team. He asked you to first fill a form, submit for approvals before Thursday 11 am. You did diligently and your infra friend gave cost estimation. You got approvals from your rich and kind boss. Again you submitted the form. After internal approvals your infra friend said, “I need to procure server, you will get in four weeks”. Your heart is broken and you are still thinking how to tell your Product Owner.

What if there is no sever required to run your code? Does that sound great? You can pretty much get to start the moment you heard the idea from Product Owner. Well.. how the code will run without server? “Serverless” is not exactly same as “Tubeless”. There is a server definitely; but you will not provision it and you are not going to run it. Someone else will do for you. That is the only difference. The closest comparison i can think is hiring a Uber taxi. You did not buy car. But when you need it, you will book and use it. After your trip is done in the morning, someone else will use it. May be you will again book Uber taxi in the evening. Again you will get a taxi, perhaps a different taxi and a driver. But all you care is, you wanted to travel from office to home. That is kind of availing car service without owning a car.

Benefits or Serverless:

  1. Reduced time to market: You can reduce cycle time from idea to live as there is no head ache to provision and run the servers.
  2. Reduced cost: If you are using the service occasionally, there is no meaning in provisioning entire server. As the cost is based on pay-per-use model, you will reduce cost.
  3. Scalability: Server provider manages the servers for you. Serverless architecture takes care of sudden peaks in traffic. Still the good news remains. You pay only when you use it.
  4. You can unfriend your infra friends and be the owner of end to end product: There is no admin required to manage. Application development team can own the operations.

What are the other names?

BaaS: Backend as a service eg: Google Firebase

FaaS: Function as a service eg: AWS Lambda, Google Cloud Functions, Azure functions

Where can you use Serverless?

Web application backend, Mobile application backend, real-time file processing, real-time stream processing, Automation of small tasks (eg: resize photo), IOT backends

Where is it not recommended to use Serverless?

  1. Any long running functions with heavy data processing. AWS Lambda has 300 seconds limitation. 300 seconds is also a max default in Azure. But you can change it to 600 seconds.

2. Serverless is based on event-driven architecture. If you do not have good instrumentation and monitoring mechanism, it is not recommended.

3. High volume of concurrent users. For example, AWS has set limit of total concurrent executions across all functions within a given region to 1000. Anything beyond this, there is danger of denial of service.

4. You do not want to get locked into a vendor.

--

--

Ravindra Elicherla

Geek, Painter, Fitness enthusiast, Book worm, Options expert and Simple human