4. Photo by Thibault Mokuenko on Unsplash
A way to centrally manage code and data
that is shared across multiple functions
5. Lambda Layers Use Cases
• Custom code, that is used by more than one function
• Libraries, modules, frameworks to simplify the
implementation of your business logic
6. Lambda Layers Benefits
• Enforce separation of concerns, between dependencies and
your custom business logic
• Make your function code smaller and more focused on
what you want to build
• Speed up deployments, because less code must be
packaged and uploaded, and dependencies can be reused
7. Using Lambda Layers
• Put common components in a ZIP file and upload it as a Lambda Layer
• Layers can be versioned to manage updates
• Each version is immutable
• When a version is deleted or permissions to use it are revoked,
functions that used it previously will continue to work, but you won’t
be able to create new ones
8. Using Lambda Layers
• In the configuration of a function, you can reference up to five layers
• One of which can optionally be a custom runtime
• When the function is invoked, layers are installed in the execution
environment in the order you provided
• The overall, uncompressed size of function and layers is subject to the usual
unzipped deployment package size limit (256MB)
9. How Lambda Layers Work
• Order is important because each layer is a ZIP file, and they are all
extracted in the same path
• /opt
• Each layer can potentially overwrite the previous one
• This approach can be used to customize the environment
• For example, the first layer can be a custom runtime and the second layer adds
specific versions of the libraries you need
• The storage of your Lambda Layers takes part in the AWS
Lambda Function storage per region limit (75GB)
16. Photo by Jeremy Lapak on Unsplash
A simple interface to use
any programming
language, or a specific
language version, for
developing your
functions
17. Lambda Runtime API
You can now select a custom runtime in the console (provided in the
API/SDKs/CLI) as the runtime of a Lambda function
With this selection, the function must include (in its code or in a layer) an
executable file called bootstrap
• The runtime bootstrap is responsible for the communication between your code and
the Lambda environment
• Your code can use any programming language
18. Runtime Boostrap
The runtime bootstrap uses a simple HTTP based interface to
• get the event payload for a new invocation and
• return back the response from the function
Information on the interface endpoint and the function handler are
shared as environment variables
19. Using Custom Runtimes
For the execution of your code, you can use anything that can run in
the Lambda execution environment.
• For example, you can bring an interpreter for the programming language of your
choice.
You only need to know how the Runtime API works if you want to manage
or publish your own runtimes
As a developer, you can quickly use runtimes that are shared with you as
layers
• Custom runtimes can be shared as layers so that developers can pick them up and
use their favorite programming language when authoring Lambda functions
46. Introducing: API Gateway WebSocket APIs
Invoke AWS services
like Lambda, Kinesis, or any
HTTP endpoint based on
message content
Build real-time two-way
communication applications
chat, alerts and notifications,
and streaming dashboards
Fully managed APIs
to handle connections and
messages transfer between
users and backend services
Pay for what you use
based on connection minutes
and messages transferred
Stateful connection Stateless connection
Amazon API Gateway
WebSockets API
Public
endpoints on
Amazon EC2
Lambda
functions
Any other
AWS service
All publicly
accessible
endpoints
Amazon
Kinesis
Mobile apps
Chat
AWS IoT
devices
Dashboards
55. Why service mesh proxy
vs. Libraries or app code
Overall—migrate to microservices safer and faster
Reduce work required
by developers
Follow best practices Use any language
or platform
Simplify visibility,
troubleshooting, and
deployments
56. OSS project
Wide community support, numerous integrations
Stable and production-proven
“Graduated Project” in Cloud Native Computing
Foundation
Started at Lyft in 2016
App Mesh uses Envoy proxy
58. Today App Mesh is available as a preview for all
customers
Observability and traffic control
Easily export logs, metrics, and traces (available)
Client side traffic policies—circuit breaking, retries (coming soon)
Routes for deployments (available)
AWS container services compatibility
Today: Amazon Elastic Container Service (Amazon ECS) & Amazon
Elastic Container Service for Kubernetes (Amazon EKS)
Coming soon: AWS Fargate
60. Complexity of modern architectures
• Wide variety of resources
• Complexity grows exponentially
• Multiple versions and stages coexist
• Infrastructure scales dynamically
• Unhealthy resources are replaced
61. Service Discovery
Finding the location of a service provider
myapp: {10.24.34.5:8080, 10.24.34.6:8080}
mylogs: {S3bucket1, S3bucket2}
How to find resources to connect to?
62. Server-side service discovery pattern
- Connections are proxied
- Discovery is abstracted away
- Availability and capacity impact
- Additional latency
Client
Service
Provider
Service
Provider
Service
Provider
Request Request
LB +
Service
Registry
Register
Register
63. - Clients connect directly to providers
- Fewer components in the system
- Clients must be registry-aware
- Client-side load balancing
Client
Service
Provider
Service
Provider
Service
Provider
Service
Registry
Request
Register
Register
Register
Query
Client-side service discovery pattern
64. Existing solutions require setup and management
Service
Registries
Service
registry
doozerd
SmartStack
Eureka
65. Build the dynamic map of your cloud
Define convenient names
for all cloud resources
Discover resources
with specific attributes
Ensure only healthy
resources are discovered
Use highly available
DNS and regional API
69. AWS Cloud Map registry
cloudmapdemo.com
backend
Name = backend
DNS record = A
TTL = 60 sec
Health Check = Yes
Instance-1
172.10.0.1
Instance-2
172.10.0.2
Instance-3
172.10.0.3
• Namespace
• Service
• Service Instance