More Related Content
Similar to Introduction to Serverless with AWS Lambda (20)
Introduction to Serverless with AWS Lambda
- 1. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless with AWS Lambda
Omar Fathy
DevOps Engineer
- 3. © 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
- 4. © 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)
- 5. © 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)
- 7. © 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 is AWS Lambda.
- 8. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8
With Serverless
- 9. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9
With Serverless…
- 11. © 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.
- 12. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 12
AWS serverless services increase agility
12
Amazon Confidential
Less code
to write
Reduced
maintenance
Built-in
Capabilities
Continuous
improvement
Customers can reduce their development time by 68% with AWS serverless*
- 13. © 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
- 14. © 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
- 15. © 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
- 17. © 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.
- 18. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18
AWS Lambda
- 19. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19
AWS Lambda Core Components
- 20. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20
Event Source Example
- 22. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22
Sample Use Case 1: Real-Time File Processing
- 23. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 23
Sample Use Case 2: Stream Processing
- 24. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24
Sample Use Case 3: Mobile and Web Applications
- 26. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda Limits
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.
- 28. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 28
Demo Architecture
- 29. © 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
§ AWS Lambda The Ultimate Guide
§ What is EDA (Event-Driven Architecture)?