Introduction to Serverless with AWS Lambda

OmarMFathy 1,158 views 30 slides May 08, 2024
Slide 1
Slide 1 of 30
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30

About This Presentation

• Introduction to Serverless
• Why Serverless?
• What is AWS Lambda?
• AWS Lambda Use Cases
• Demo Time
• Q&A


Slide Content

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless with AWSLambda
Omar Fathy
DevOps Engineer

Omar Fathy
DevOps Engineer
linkedin.com/in/omarmfathy219
github.com/omarmfathy219
[email protected]
x.com/omarmfathy219

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
•Introduction to Serverless
•Why Serverless?
•What is AWS Lambda?
•AWS Lambda Use Cases
•Demo Time
•Q&A

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4
In a monolithic application, if one piece were to fail, the entire
application would crash, as this example illustrates. If there is
a spike in demand, the entire architecture must be scaled.
Adding features to a monolithic application becomes more
complex as time goes on. Pieces of the code
base must work with each other to sync properly.
Monolithic application (tightly coupled)

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5
In a microservices architecture, an application is built as
independent components that run each application process as
a service. These services communicate through a well-defined
interface by using lightweight APls.
Microservices application (loosely coupled)

Introduction to Serverless

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 7
Introduction to Serverless
The term “serverless” means that your code runs on servers, but you do not need to provision or manage these servers. With
serverless computing, you can focus more on innovating new products and features instead of maintaining servers.
Another benefit of serverless computing is the flexibility to scale serverless applications automatically. Serverless computing
can adjust the applications' capacity by modifying the units of consumptions, such as throughput and memory.
An AWS service for serverless computing isAWS Lambda.

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8
With Serverless

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9
With Serverless…

Why Serverless?

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 11
Why serverless?
•No server management
Eliminate operational overhead so your teams can release quickly, get feedback, and iterate to get to market faster.
•Automatic scaling
With technologies that automatically scale from zero to peak demands, you can adapt to customer needs faster than ever.
•High availability built in
With technologies that automatically scale from zero to peak demands, you can adapt to customer needs faster than ever.
•Pay for value billing model
With a pay-for-value billing model, resource utilization is automatically optimized and you never pay for over-provisioning.
•Build better applications, easier
Serverless applications have built-in service integrations, so you can focus on building your application instead of configuring it.

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 12
AWS serverless services increase agility
12Amazon Confidential
Less code
to write
Reduced
maintenance
Built-in
Capabilities
Continuous
improvement
Customers can reduce their development time by 68% with AWS serverless*

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
“Serverless is the fastest way to build your ideas into applications
with lowest TCO”
Source: Deloitte 2019
41%
Increase in frequency to
deploy new features
23%
Increase in compute
utilization
39%
Reduction in IT
infrastructure spend
Known x AWS Survey of 505 U.S enterprises and 30 IT decision makers

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 14
Enterprises are achieving results at-scale on AWS Serverless


Low latency is essential to the user
experience, which is why we’re
committed to a serverless solution on
AWS
- Michael Connor, chief architect for Coca-Cola
The new contactless Coca-Cola
Freestyle solution enables
consumers to choose and pour
drinks from their phones in just a
few seconds, without having to
create an account or download
an app.
Scaled the Web App from
Prototype to 10,000 Machines in
150 Days
Amazon
Lambda
Amazon
API
Gateway
Going serverless accelerated our
engineering teams. The more we
experimented with a serverless mind-set,
the more we started to see a flywheel effect
where we could deliver value into the hands
of our business partners quickly
- Dave Anderson,
Director of technology at Liberty Mutual
Liberty Mutual Reduces Costs,
Improves Time to Market by Going
Serverless on AWS
Liberty Mutual has a serverless-first
policy, so engineers must first strive
to build serverless software or
functions.
Amazon
Lambda
AWS
Step
Functions
““


https://aws.amazon.com/solutions/case-studies
The data is being collected to build data
services for customers that really drive
satisfaction and provide new capabilities
around safety and convenience
- Mahadevan Krishnan, principal architect of
Toyota Connected,
Amazon
Lambda
Amazon
Kinesis
Toyota uses customer vehicle
data for improving safety,
security and experience, with
privacy by design
Real time millions of data points
from connected vehicles globally

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 15
SMB and Startups scale up with Serverless
•Speed of
Innovation
•Scale at ease
•Broadest set of
Data, Analytics
and AI/ML
services

What is AWS Lambda?

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 17
AWS Lambda
is a service that lets you run code without needing to provision or manage servers.
While using AWS Lambda, you pay only for the compute time that you consume. Charges apply only when your code is
running. You can also run code for virtually any type of application or backend service, all with zero administration.
For example, a simple Lambda function might involve automatically resizing uploaded images to the AWS Cloud. In this case,
the function triggers when uploading a new image.

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18
AWS Lambda

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19
AWS Lambda Core Components

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20
Event Source Example

AWS Lambda Use Cases

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22
Sample Use Case 1: Real-Time File Processing

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 23
Sample Use Case 2: Stream Processing

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24
Sample Use Case 3: Mobile and Web Applications

AWS Lambda Limitation

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda Limits
ResourceQuota
Functionmemory allocation128 MB to 10,240 MB.
Function timeout900 seconds (15 minutes)
Functionenvironment variables4 KB, for all environment variables associated with the
function, in aggregate
Functionlayers five layers
Functionconcurrency scaling limitFor each function, 1,000 execution environments every 10
seconds
Deployment package (.zip file archive)size
50 MB (zipped, for direct upload)
250 MB (unzipped)
This quota applies to all the files you upload, including layers
and custom runtimes.

Demo…

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 28
Demo Architecture

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
References
§AWS Lambda
§Microservices
•Lambda quotas
§Coursera Course
§Serverless on AWS
§AWS Knowledge: Serverless
§AWSLambda The Ultimate Guide
§What is EDA (Event-Driven Architecture)?

Thank You