DEV Community

Cover image for Serverless! Is it really without servers or something else????
Rohit Shrivastava for AWS Community Builders

Posted on • Updated on • Originally published at Medium

Serverless! Is it really without servers or something else????

Introduction:
         In the recent years the computing technology has been evolving at a phenomenal rate. Data storage has become very affordable and computing power has vastly increased and this has allowed us to build applications that leverage these advancements in the computing space.

Cloud computing for example has made it possible for us to build such cutting-edge applications at a small amount of cost, not only for big ventures but also for small ventures or individual people. Public cloud providers like Amazon AWS, Microsoft Azure, Google Cloud Platform have removed the entry barriers and made computing very easy and affordable for common people.
 
We know the modern-day applications demand high level of power, high level of compute power as well as speed let's take an example if your youtube app doesn’t show you what you need to see as soon as you open the youtube app, most of you might simply close the app and move on. It means the application should be fast and responsive and at the same time, it must be scalable with almost no downtime. Serverless Computing is the new trend in cloud computing which attempts to solve many of these challenges.
 
Serverless in Brief:
                Serverless computing will help you build the next generation of systems that can handle workloads on demand and scale indefinitely without having to provision or manage any servers. Now, if we look at the traditional architecture, there are several activities and tasks that you must perform in order to run any particular application.
 
First, you need to create and setup servers, install operating systems, install and setup databases, manage software patches and hardware updates, manage capacity and scaling, manage high-availability through load-balancing and so on and of course, this server infrastructure and the computing power has its own costs, which are often substantial. On the other hand, with Serverless Architecture, all these tedious tasks of managing the underlying infrastructure are abstracted away from us.
 
So in a way when you use serverless architecture, you won’t really feel like you are using any high-end servers, because you’re not the one who is actually taking care of it.
That’s the reason this approach is called as Serverless.
 
That means, Serverless Computing still uses servers, but you no longer have to worry about managing them or worry about the uptime or availability or anything that has to do with the infrastructure part. With Serverless, you kind of get to be more productive. You can completely focus on writing your code without having to worry about the underlying support system. So you simply upload your code to the cloud provider and it can be run on-demand as and when needed.
 
With Serverless(e.g. AWS Lambda), you write your code in the form of functions, just like you’d write a function in any programming language and these functions then run in the cloud. So, you segregate your application logic in to small independent functions or microservices and upload them to the cloud provider. These functions are stateless and can be invoked in response to different events. These events could be file uploads, database updates, in-app activity, API calls, website clicks, or sensor outputs just like those from IoT devices and so on and all this can be accomplished without having to manage any infrastructure or having to size, provision or scale a bunch of servers, and without having to worry about performance and availability. This seriously allows us to lesser focus on our application code and not get caught up in multitude of infrastructure issues.

Let’s discuss in a more technical terms, these serverless functions often run in Docker-like containers and hence several instances of these functions can be run concurrently, like in a Dockerswarm, thus making them highly scalable. If you’re new to these terms like Docker or Container, nothing to worry. You really don’t need to know about these terms to be able to build Serverless applications.

All this containerization happens behind the scenes and is completely taken care of by the cloud provider. Just for your information though, containers are a lightweight alternative to virtualization they allow you to run your code in isolated preconfigured environments.
 
So, in a nutshell, Serverless means “Event-driven Computing” using “Small independent stateless functions” running inside “containers in the cloud”. That’s the short definition of what Serverless is all about. So, you have your code running on the cloud platform, AWS in our case. Whenever the triggering event occurs, the cloud platform spins up a container or initializes a container, loads the function in it and executes the function. And this happens almost instantaneously, thereby allowing us to build applications that respond quickly to new information and thus enhance user experience. Once the function completes execution, it optionally returns a response back to the caller, and then finally exits or shuts down.
 
Pros

  • No necessity of server management.
  • Scales Quickly.
  • High availability and fault tolerance.
  • Pay as per use.
  • Integration of services with other AWS services to send text notifications, emails.

Cons

  • Level of control.
  • Execution time.

AWS offers Serverless Services in various categories:

Serverless Compute Services:

  • AWS Lambda
  • AWS ECS
  • AWS Fargate
  • AWS EKS

Serverless Application Integration Services:

  • Amazon EventBridge
  • Amazon SQS
  • AWS Step Functions
  • Amazon API Gateway
  • Amazon SNS
  • AWS AppSync

Serverless Database Services:

  • Amazon S3
  • Amazon RDS Proxy
  • Amazon DynamoDB
  • Amazon Aurora Serverless

Serverless Data/Analytics Integration Services:

  • AWS Glue
  • AWS Athena
  • AWS Redshift
  • Amazon Kinesis

Serverless Debugging Tools:

  • AWS X-Ray
  • AWS Cloudwatch

Serverless User Authentication & Mnagement Services:

  • AWS Cognito

For more information you can refer AWS Documentation
 
From the next articles onwards, I’ll discuss about all the above services in my SHORTICLES and detailed articles with their applications.
 

Thanks for reading!!!
 
 

Top comments (0)