Serverless
Computing
— Exploring the Future of Cloud Computing
What is it?
05
02
Why use it?
Demo
AWS Lambda
04
01
Serverless Computing
03
Use Cases
01
What is it?
Serverless means…
Serverless Computing Tools…
We will focus on !
02
Why use it?
Reduced operational overhead
Scalability
Faster deployment
Why Serverless Computing?
No need to manage servers, operating systems, or infrastructure.
Automatic scaling up and down based on demand, allowing for cost efficiency.
Functions can be deployed and executed quickly without needing to configure servers.
High availability
Greater flexibility
Improved developer productivity
Why Serverless Computing?
Built-in redundancy and automatic failover capabilities ensure applications are always available.
Developers can choose from a variety of programming languages and frameworks to write and deploy their code.
Developers can focus on writing code rather than worrying about infrastructure and server management.
03
Use Cases
Common Serverless App Use Cases
IoT Backend
Analyze sensor data
Process data from IoT devices
Chatbot
Powering chatbot logic
Web App
Static Websites
Complex Web Apps
Data Processing
Real time
Machine learning interface
Event-driven programming
Batch processing
Web Application Development
Data Processing
Chatbot
04
AWS Lambda
What is AWS Lambda
Supported Languages
AWS Lambda Anatomy
How it works…
Here is an example using AWS Lambda, AWS API Gateway, and Amazon S3 to create a serverless web application to resize images on the fly.
Situation
Solution
Resizing on the fly
Instead of processing and resizing images into all necessary sizes upon upload, the approach of lazily generating images, in which a resized asset is only created if a user requests that specific size.
A user requests a resized asset from an S3 bucket through its static website hosting endpoint. The bucket has a routing rule configured to redirect to the resize API any request for an object that cannot be found.
Because the resized asset does not exist in the bucket, the request is temporarily redirected to the resize API method.
The user’s browser follows the redirect and requests the resize operation via API Gateway.
The API Gateway method is configured to trigger a Lambda function to serve the request.
The Lambda function downloads the original image from the S3 bucket, resizes it, and uploads the resized image back into the bucket as the originally requested key.
When the Lambda function completes, API Gateway permanently redirects the user to the file stored in S3.
The user’s browser requests the now-available resized image from the S3 bucket. Subsequent requests from this and other users will be served directly from S3 and bypass the resize operation. If the resized image is deleted in the future, the above process repeats and the resized image is re-created and replaced into the S3 bucket.
05
Demo
Design
ReactJS
AWS Amplify
Amazon API Gateway
Request
Response
AWS Lambda
Access Lambda Function
Set Up Project
Set Up Project
Create AWS User
Create AWS User
Create AWS User
Create AWS User
Create AWS User
Create AWS User
Create AWS User
Set Up Project
Connect to Cloud
View Project in AWS Console
View Project in AWS Console
Add API and Lambda
Create Lambda Function
Folder Structure
Push our API to AWS
View and Test Lambda Function
AWS Front End Configuration
Access Lambda From Front End
Access Lambda From Front End
Access Lambda From Front End
Access Lambda From Front End
Access Lambda From Front End
Access Lambda From Front End
The Result
Repository Link
For more information…
Q & A