What is Serverless Architecture?

Reading Time: 4 mins


Serverless Architecture is a lot more than a buzzword in computing. It’s a known cloud trend and has already started to revolutionise the software development industry.

What is serverless architecture?

So, what exactly is Serverless architecture? Does it mean there are no servers? And what does it mean for the developers?

Let me clear the first point on the most misleading aspect of serverless; it still requires servers. Actually the name is totally confusing.

Here, serverless is about no maintenance, and it is more about (micro) functionality. Typically, it hosts applications that significantly or fully incorporate third-party, cloud-hosted applications or services, to manage server-side logic and state.

Traditional vs Serverless architecture
Traditional vs Serverless architecture

A Serverless architecture is a way to run applications and services without having to manage infrastructure. Means, your application still runs on servers. But, all the server management like the setup, capacity planning, scaling and server management is handled by the cloud provider.

You get rid of the need to manage uptime, server maintenance, upgrades, security vulnerabilities etc. The only thing developers need to be aware of is the code. That’s it.

In serverless, things should be event driven, meaning you have to design it with the idea that if nobody is using it, then nothing is running. Because, the concept is, the server resources are triggered on some event and we need to pay for those things.

Service providers

architecture cloud providers
Cloud provider for serverless

There are two main aspects, Baas(Backend as a service) and Faas(Functions as a services) services provided by major cloud service providers like:

  • AWS Lambda:
    Provided by Amazon web services, AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume. Just upload your code and Lambda takes care of everything required to run and scale your code with high availability. You can set up your code to automatically trigger from other AWS services or call it directly from any web or mobile app.
serverless architecture - AWS Lambda
AWS Lambda
  • Google Cloud Functions:
    Provided by Google cloud, Google Cloud Functions is a lightweight compute solution for developers to create single-purpose, stand-alone functions that respond to Cloud events without the need to manage a server or runtime environment.
serverless architecture - Google cloud functions
Google cloud functions
  • Azure Functions:
    Service by Microsoft Azure, helps you develop more efficiently with Functions, an event-driven serverless compute platform that can also solve complex orchestration problems. Build and debug locally without additional setup, deploy and operate at scale in the cloud, and integrate services using triggers and bindings.
serverless architecture - Microsoft Azure functions
Microsoft Azure functions

These are the major service providers, there are many available in the market and even evolving. Also, there is open source framework, check on https://serverless.com/
The Serverless Framework helps you build serverless apps with radically less overhead and cost. It provides a powerful, unified experience to develop, deploy, test, secure and monitor your serverless applications.

In short, serverless architecture is an outsourcing solution allowing you to pay someone else to manage your servers, databases, and even application logic that you might manage yourself otherwise. You would pay less for your managed database because a vendor that hosts you is running thousands of very similar databases.

Obviously, it is not simpler to migrate to serverless architecture, because you need to rely on other things in this case of serverless framework. Like, session management, ORM, middleware etc. We need to rewrite our whole service functionality and use libraries or external dependencies provided by them.

Relation between cloud computing, microservices and serverless

serverless architecture - cloud, miroservices, serverless

Serverless is a cloud computing execution model where the cloud provider dynamically manages the allocation and provisioning of servers. Serverless is a subset of cloud. It’s a way of building and deploying cloud applications. And when serverless architecture is started, the first approach is to design microservices first.

Approach is to build a series of services that then scale separately from each other with a serverless backend. Serverless is more granular than microservices and provides a much higher degree of functionality.
Learn more about microservices architecture.

Benefits of serverless architecture

  • Productivity:
    Developers can focus on their core product instead of worrying about managing and operating servers or runtimes. This reduces overhead lets developers reclaim time and energy that can be spent on developing great products which scale and that are reliable.
  • Scaling:
    Application can be scaled automatically or by adjusting its capacity through threshold value, based on the units of consumption (e.g. throughput, memory) rather than units of individual servers. And you need to pay for consistent throughput or execution duration rather than by individual server units. No need to worry about the number of concurrent requests.
  • Availability:
    We don’t need to worry about the capabilities or need to architect things, this is automated at provider end. they provide built-in availability and fault tolerance for services.
  • Pay on use:
    It costs you nothing to run if nobody is using it. Obliviously, excluding data storage costs. It reduces operations costs in terms of infrastructure and operation. Cost is based on the number of function executions, measured in milliseconds instead of hours.
  • Agility:
    Smaller deployable units result in faster delivery of features to the market, increasing the ability to adapt to change.

Serverless is already used in production by companies like Netflix, Reuters, Codepen, AOL, Telenor and many other giants.

Use cases

You can learn more about the serverless with use cases on my podcast:
Use cases @ 09:20

Know more about my podcast Stuff Developer Should Know.

Here is recommended reading: https://martinfowler.com/articles/serverless.html
Image Source : https://www.google.com/


Dear reader, a sincere review from you would encourage me to write even more 😉

Stay tuned. Happy Learning.

0 0 votes
Article Rating
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Diptiranjan
Diptiranjan
4 years ago

Nice one Vishal… really good and helpful.

2
0
Would love your thoughts, please comment.x
()
x