© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless with AWS Lambda
Omar Fathy
DevOps
Engineer
Omar
Fathy
DevOps
Engineer
linkedin.com/in/
omarmfathy219
github.com/
omarmfathy219
omarmfathy219@gmail.co
m
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
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)
4
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
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)
5
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Introduction to Serverless
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 is AWS Lambda.
7
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
With Serverless
8
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
With Serverless…
9
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why Serverless?
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.
11
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS serverless services increase agility
Less code
to write
Reduced
maintenance
Built-in
Capabilities
Continuous
improvement
Customers can reduce their development time by 68% with AWS serverless*
Amazon Confidential 12
12
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 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
Enterprises are achieving results at-scale on AWS Serverless
”
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
Gatewa
y
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
“
“ Low latency is essential to the user
”
”
https://aws.amazon.com/solutions/case-studies
“ The data is being collected to build data
services for customers that really drive
14
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
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
SMB and Startups scale up with Serverless
• Speed of
Innovation
• Scale at
ease
• Broadest set of
Data, Analytics
and AI/ML
services
15
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is AWS Lambda?
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.
17
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda
18
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda Core Components
19
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event Source Example
20
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda Use Cases
Sample Use Case 1: Real-Time File Processing
22
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sample Use Case 2: Stream Processing
23
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sample Use Case 3: Mobile and Web Applications
24
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda Limitation
AWS Lambda Limits
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Resource Quota
Function memory allocation 128 MB to 10,240 MB.
Function timeout 900 seconds (15 minutes)
Function environment variables 4 KB, for all environment variables associated with the
function, in aggregate
Function layers five layers
Function concurrency scaling limit For 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…
Demo Architecture
28
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
References
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
 AWS Lambda
 Microservices
• Lambda quotas
 Coursera Course
 Serverless on AWS
 AWS Knowledge: Serverless
 AWS Lambda The Ultimate Guide
 What is EDA (Event-Driven Architecture)?
Thank You

awslambda-240508203904-07xsds253491.pptx

  • 1.
    © 2024, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Serverless with AWS Lambda Omar Fathy DevOps Engineer
  • 2.
  • 3.
    © 2024, AmazonWeb 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
  • 4.
    In a monolithicapplication, 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) 4 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 5.
    In a microservicesarchitecture, 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) 5 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 6.
  • 7.
    Introduction to Serverless Theterm “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 is AWS Lambda. 7 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 8.
    With Serverless 8 © 2024,Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 9.
    With Serverless… 9 © 2024,Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 10.
  • 11.
    Why serverless? • Noserver 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. 11 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 12.
    AWS serverless servicesincrease agility Less code to write Reduced maintenance Built-in Capabilities Continuous improvement Customers can reduce their development time by 68% with AWS serverless* Amazon Confidential 12 12 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 13.
    © 2024, AmazonWeb 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
  • 14.
    Enterprises are achievingresults at-scale on AWS Serverless ” 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 Gatewa y 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 “ “ Low latency is essential to the user ” ” https://aws.amazon.com/solutions/case-studies “ The data is being collected to build data services for customers that really drive 14 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 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
  • 15.
    SMB and Startupsscale up with Serverless • Speed of Innovation • Scale at ease • Broadest set of Data, Analytics and AI/ML services 15 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 16.
    What is AWSLambda?
  • 17.
    AWS Lambda is aservice 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. 17 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 18.
    AWS Lambda 18 © 2024,Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 19.
    AWS Lambda CoreComponents 19 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 20.
    Event Source Example 20 ©2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 21.
  • 22.
    Sample Use Case1: Real-Time File Processing 22 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 23.
    Sample Use Case2: Stream Processing 23 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 24.
    Sample Use Case3: Mobile and Web Applications 24 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 25.
  • 26.
    AWS Lambda Limits ©2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Resource Quota Function memory allocation 128 MB to 10,240 MB. Function timeout 900 seconds (15 minutes) Function environment variables 4 KB, for all environment variables associated with the function, in aggregate Function layers five layers Function concurrency scaling limit For 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.
  • 27.
  • 28.
    Demo Architecture 28 © 2024,Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 29.
    References © 2024, AmazonWeb Services, Inc. or its affiliates. All rights reserved.  AWS Lambda  Microservices • Lambda quotas  Coursera Course  Serverless on AWS  AWS Knowledge: Serverless  AWS Lambda The Ultimate Guide  What is EDA (Event-Driven Architecture)?
  • 30.