re: Explain Serverless Like I'm Five VIEW POST

VIEW FULL DISCUSSION
 

Basically, however obscure it sounds, Serverless still uses servers. Shocker right!? Anyhow, Serverless Architecture is when you use cloud services to run your code without managing servers. In the case of AWS, you use Lambda as the compute service to run the code and API Gateway to create API endpoints to point at the Lambda functions. Under the hood, once a Lambda is invoked through the event trigger which is the API Gateway endpoint, a Docker container is spun up to run the code you deployed into the cloud.

What the Serverless framework does is that it automates the process of creating all the necessary services on the cloud provider. Once you run sls deploy the config file, which is called serverless.yml is transformed into a CloudFormation template. Okay, CloudFormation template? CloudFormation is a special language AWS uses to spin up AWS services by running commands from a file. Pretty cool. Okay, once the serverless.yml has been transformed into a CloudFormation template it gets sent to AWS to create the services you specified, all API Gateway routes, all Lambdas, and anything else you specified. Apart from that, the Serverless framework also packages up all the code you have written and sends it to AWS S3, in the process, creating a bucket to keep the code. This bucket will have all the versions of the code you have ever deployed. Effectively, the Serverless framework grabs the latest version from the bucket and sends it to the Lambda it created.

That's a quick rundown. :)

Here's a course I just recently published on the topic.

 

Thanks Adnan for this concise explanation.

 

It's worth nothing that the serverless framework is one of many ways to use serverless architectures. Alteratives include:

  • Managing lambdas yourself in AWS's console (or equivalent for other platforms like Azure, etc)
  • Building & deploying your application with chalice AWS Lambda & Python ONLY
  • deploying your aplication with apex (AWS ONLY)
  • deploy a traditional Python WSGI app to AWS using Zappa
  • lots of other options.

The main advantage of the serverless framework is that it has the biggest userbase currently and works with many service providers (AWS, Azure, Google, OpenWhisk, OpenFAAS, Kubeless, just to name a few)

code of conduct - report abuse