DEV Community

Cover image for There’s Serverless for Everyone!
Delia Ayoko for AWS Community Builders

Posted on

There’s Serverless for Everyone!

When you reunite your family for brunch one Saturday morning, you leave the kitchen with two plates of steak in both hands, shouting at the top of your lungs, "There's Serverless for Everyone!”

Your spouse is devouring whatever. Emma, on the other hand, can't help but stare into space.

"You're not eating anymore, Emma."

“What exactly is Serverless, Mom? How come we're having it for breakfast?”

AWS Lambda is an event-based compute service offered by Amazon Web Services that allows you to run code without controlling or provisioning servers. It was created to upload photos and objects to Amazon S3, update DynamoDB tables, respond to website clicks, as well as react to sensor readings on a smart device. AWS Lambda is essentially a service that runs code in response to events while also automatically managing the compute resources required by that code.

Serverless does not imply the absence of servers. Serverless means that if a server crashes at 3:54 am, it’s not your problem.

How Lambda Works

  • The Deployment: Deploying a function is as simple as configuring it in a container. In the event that the function is a package with dependencies, it must first be zipped and uploaded to an S3 bucket. AWS is the step's active character. So that the developer can concentrate on their code, AWS builds the container, configures it, and manages it.

    AWS creates an instance, which is a container made from Amazon Linux AMIs (Amazon Machine Images) that has a configurable runtime of 1–900 seconds, a RAM range of 128MB–10240 MB, and temporary storage ranging from 512MB–10GB.

How AWS Lambda works

  • The Event: The function you write should be set to trigger an event. It might be a simple SMS or call, a fire alarm, or both, but it needs to cause stimuli.

    You don't have access to any infrastructure resources that would let you take control of the cloud infrastructure because serverless computing helps to abstract it.

  • The Operations involved: Only when the event is triggered will your code run, and only during the time-span of the runtime will payments be made. This specific feature is advantageous for Lambda users who wish to use Lambda to provision back-end services prompted by HTTP requests (for example), as it preserves resources when not in use. As a result, since you only pay for the compute time you actually use when using Lambda, cost is almost never an issue.

In addition to being entirely event-driven, Lambda also conducts autonomous vertical scaling. Within milliseconds, it can scale up to many parallel resources. The /tmp folder contains temporal storage, which is only locally accessible for the duration of the instance. The scaling down process is also handled automatically, and active operations are discarded once they are complete.

AWS Lambda natively supports numerous programming languages and frameworks, and also offers customization options based on uploaded functions. It is used for serverless websites, log analysis, bulk real-time data processing, automated backups, back-end cleaning, and any other use case that calls for on-demand use.

In the following blog-post, Ryan Kauffman shows how to use Python, AWS IOT, AWS Lambda, and TwilioWireless to save a toddler's life.

“You still haven't explained what serverless is, mom.”

“Okay Emma. Serverless is a concept.”

“What concept?”

"Serverless is comparable to driving to the mall. Fuel is the only thing you used to arrive there.”

“Okay. That begins to make some sense.”

“There’s also this serverless quote: ‘Serverless also means that it's not your problem if a server crashes at two in the morning’. Let's use Bruno as an example. Bruno's duty is to watch after us when we sleep at night. Because Bruno is the one who should be chasing thieves away, it is not your responsibility if you wake up one night and notice one trying to sneak around this property. Bruno is Lambda because while we’re asleep, he takes care of us.”

Top comments (0)