Serverless architecture is essentially Function-as-a-service (FaaS) that can be integrated with Backend-as-a-service (BaaS) to build a whole ecosystem which is event-driven. This means there is a server doing all the heavy lifting; just that the organization does not see or maintain it. It is about getting the work done in a timely manner without caring where in the world the infrastructure is located.
It aims to push microservices into the future by entirely skipping over containers and DevOps from the organization’s perspective. It has been adopted by many big players like BBC, Airbnb, Netflix, Nike etc. FaaS are typically triggered by event types defined by the provider. With Amazon AWS such stimuli include S3 (file/object) updates, time (scheduled tasks), and messages added to a message bus (e.g., Kinesis).
Amazon’s AWS Lambda is the biggest and best-known example of serverless computing. The other providers include Google Cloud Functions, Microsoft Azure Functions, IBM etc. These providers let you run code without provisioning or managing servers. You pay only for the compute time you consume – there is no charge when your code is not running.
Why serverless architecture?
- It is more cost-effective than renting/purchasing a fixed quantity of servers or even traditional cloud
- It is highly scalable
- Developers and operators do not need to spend time setting up and tuning autoscaling policies or systems. The cloud provider is responsible for high scalability and availability. This can lead to savings in human resources cost.
- The programmer does not have to worry about multithreading or directly handling HTTP requests in their code, simplifying the task of back-end software development
- Allows focus to be only on business and user experience
- Allows for organizations to take advantage of improved and advanced security
When should we use serverless architecture?
- When your services are used frequently.
- When your product is not in the decline stage
- If your application does not require extremely high computing capabilities.
- If your application is not prone to major performance and usage problems and does not require very specific monitoring or debugging tools
- If you don’t require highly specialized or customized security for your application
- If your product and its data can be exposed to the third party providers
- If your microservices are not too complex and can be broken down into functions that can run individually.
- When the smallest function that you can break your microservice into, takes a relatively short time (Eg: AWS Lambda allows a function to run for a maximum of 5 minutes).
Jason McGee, VP and CTO of IBM Cloud, said at ServerlessConf 2017 that IBM analysts predict the serverless market will grow 7–10 times by 2021, meaning cloud vendors are noting the early success of AWS Lambda. A Markets and Markets report predicted smaller, yet still substantial, growth, predicting the serverless market will grow from a $1.88 billion market in 2016 to $7.72 billion by 2021 (411 percent).
Serverless architecture is still relatively new and is on the path to maturity. There are many third party add-ons available and being developed for any customized need based on the experience of organizations who have adopted this architecture. Even though, there is a learning curve attached to this architecture, if done correctly, it will have great pay offs in the longer run.