SlideShare a Scribd company logo
Microservice Architecture on AWS
using AWS Lambda
and Docker Containers
Danilo Poccia ‒ AWS Technical Evangelist
@danilop
Why Microservices?
http://en.wikipedia.org/wiki/Multitier_architecture
As a Project scales Complexity arises
“Complexity arises when the
dependencies among the elements
become important.”
Complex Adaptive Systems:
An Introduction to Computational Models of Social Life
Scott E. Page, John H. Miller
How to design

smaller services?
Business Domain
+
Loosely Coupled
+
Bounded Context
Microservices
Independent Deployment
Microservices
Choose the Right Tool
Microservices
Adopt New Technologies
Microservices
Culture of Automation
Adrian Cockcroft, Technology Fellow at Battery Ventures
http://www.slideshare.net/adriancockcroft/goto-berlin
How small is small?
“something that could be
rewritten in two weeks”
Two Pizza Teams
Conway’s law
“organizations which design systems ...
are constrained to produce designs which
are copies of the communication
structures of these organizations”
Melvin Conway, 1968
Architecture
DevOps
M
icroservices
Distributed Systems
Independent Scalability
Auto Scaling
Security
Least Privileges
Single Sign-On
Confused Deputy Problem
(for downstream calls
after authentication)
Testing
Automate
Service Tests
End-to-end Tests
Synthetic Monitoring
Monitoring
Expose Service Metrics
Standard Log Format
Correlation ID
From Log collection to
Real-Time Event Routing
Amazon CloudWatch Logs
Amazon Kinesis
Understand your Trends
Discovery
Self-Describing System
Amazon Route 53
(DNS)
AWS Resource
Tagging
Deployment Pipeline
Developer
Developer
Developer
Developer
Developer
Build
Stage #1 Stage #2 … Stage #N Production
Build Build Build Build
Developer
Developer
Developer
Developer
Developer
Build
Stage #1 Stage #2 … Stage #N Production
Build Build Build Build
Bug!
Developer
Developer
Developer
Developer
Developer
Build
Stage #1 Stage #2 … Stage #N Production
Build Build Build Build
Build Build Build Build Build
Build Build Build Build Build
Developer
Developer
Developer
Developer
Developer
Build
Stage #1 Stage #2 … Stage #N Production
Build Build Build Build
Bug!
Build Build Build Build Build
Build Build Build Build Build
Design for Failure
Degrade Functionality
"Jtecul" by own - Own work.
Licensed under CC BY-SA 3.0 via Wikimedia Commons
http://commons.wikimedia.org/wiki/File:Jtecul.jpg#/media/File:Jtecul.jpg
Circuit Breakers
Elastic
Load Balancing
Health
Checks
Service
Consumer(s)
Consumer(s)
Amazon Route 53
Private DNS in VPC
Health
Checks
Service
Consumer(s)
Consumer(s)
Amazon Route 53
Private DNS in VPC
Elastic
Load Balancing
Health
Checks
Service
Consumer(s)
Consumer(s)
Disposable Infrastructure
Immutable Deployments
Why Docker?
Virtual Machine Container
Docker on AWS
Amazon
Linux
A supported and
maintained Linux
image provided by
Amazon Web Services
Amazon EC2
Container
Service
Highly scalable, high
performance container
management service
AWS
Elastic
Beanstalk
For deploying and
scaling web
applications and
services
Amazon EC2 Container Service
Key Components
Container Instances
Clusters
Tasks
Task Definitions
Amazon EC2 instances
Docker daemon
Amazon ECS agent
https://github.com/aws/amazon-ecs-agent
Amazon EC2 Container Service
Key Components
Container Instances
Clusters
Tasks
Task Definitions
Regional
Resource pool
Grouping of Container Instances
Start empty, dynamically scalable
Amazon EC2 Container Service
Key Components
Container Instances
Clusters
Tasks
Task Definitions
Unit of work
Grouping of related Containers
Run on Container Instances
Amazon EC2 Container Service
Key Components
Container Instances
Clusters
Tasks
Task Definitions
[
{
"image": "mysql",
"name": "db",
"cpu": 10,
"memory": 500,
…
Tasks are defined via Task Definitions
[
{
"image": "tutum/wordpress-stackable",
"name": "wordpress",
"cpu": 10,
"memory": 500,
"essential": true,
"links": [
"db"
],
"entryPoint": [
"/bin/sh",
"-c"
],
"environment": [
…
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
]
},
{
"image": "mysql",
"name": "db",
"cpu": 10,
"memory": 500,
"essential": true,
"entryPoint": [
"/entrypoint.sh"
],
"environment": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "pass"
}
],
"portMappings": []
}
]
[
{
"image": "tutum/wordpress-stackable",
"name": "wordpress",
"cpu": 10,
"memory": 500,
"essential": true,
"links": [
"db"
],
"entryPoint": [
"/bin/sh",
"-c"
],
"environment": [
…
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
]
},
]
{
"image": "mysql",
"name": "db",
"cpu": 10,
"memory": 500,
"essential": true,
"entryPoint": [
"/entrypoint.sh"
],
"environment": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "pass"
}
],
"portMappings": []
}
]
From Docker Hub
10 CPU Units (1024 is full CPU),
500 Megabytes of Memory
Environment Variables
No external ports exposed
Tasks are defined via Task Definitions
[
{
"image": "tutum/wordpress-stackable",
"name": "wordpress",
"cpu": 10,
"memory": 500,
"essential": true,
"links": [
"db"
],
"entryPoint": [
"/bin/sh",
"-c"
],
"environment": [
…
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
]
},
[
{
"image": "mysql",
"name": "db",
"cpu": 10,
"memory": 500,
"essential": true,
"entryPoint": [
"/entrypoint.sh"
],
"environment": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "pass"
}
],
"portMappings": []
}
]
Essential to our Task
Docker link to mysql container
Expose port 80 in container
to port 80 on host
Tasks are defined via Task Definitions
Why AWS Lambda?
AWS Lambda
Event driven,
fully managed compute
AWS Lambda
Focus on business logic,
not infrastructure
Customer uploads code,
AWS Lambda handles:
Capacity
Scaling
Deployment
Fault tolerance
Monitoring
Logging
. . .
AWS Lambda
Automatic scaling
Customers pay only
for what they use,
no over/under provisioning
AWS Lambda
Fine-grained pricing
Price compute time by 100ms,
even short jobs make sense
Low request charge
No hourly, daily, or monthly minimums
Free tier
Events come in many different shapes & sizes
S3 event
notifications
DynamoDB
Streams
Kinesis events Custom
events
Amazon EC2 Containers AWS LambdaOn-Premises
Weeks Minutes Seconds Milliseconds
Netflix Architecture
Asgard, Amimator, Hystrix,
Cassandra, JVM, Docker, …
O
n
AW
S
Microservice Architecture on AWS using AWS Lambda and Docker Containers
Hailo Architecture
Hubot, Janky, Jenkins,
Go, RabbitMQ, Cassandra,
Docker, …
O
n
AW
S
Microservice Architecture on AWS using AWS Lambda and Docker Containers
Demo Architecture
Content Management System
Prototype
O
n
AW
S
Lambda
Function
S3 Bucket

#1
S3 Bucket

#2
DynamoDB

Table
ECS

Task
ECS

Cluster
Images
+

Medatada
Upload Object
+ Metadata
Event
Notification
Thumbnail
Write
Metadata
Run
Schedule
Read
Metadata
Write
“index.html”
1
2
3
<demo>
…
</demo>
Iterate
Continuous Improvement
Kaizen
@danilop

More Related Content

PDF
Microservices on AWS using AWS Lambda and Docker Containers
PDF
AWS Lambda
PDF
AWS Lambda
PDF
Serverless Applications on AWS
PDF
AWS Lambda from the Trenches
PPT
Aws Lambda Cart Microservice Server Less
PDF
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
PPTX
DevOps, Microservices and Serverless Architecture
Microservices on AWS using AWS Lambda and Docker Containers
AWS Lambda
AWS Lambda
Serverless Applications on AWS
AWS Lambda from the Trenches
Aws Lambda Cart Microservice Server Less
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
DevOps, Microservices and Serverless Architecture

Similar to Microservice Architecture on AWS using AWS Lambda and Docker Containers (20)

PDF
Aws microservice keynote
PPTX
Introduction to AWS and Docker on ECS
PDF
More Containers Less Operations
PDF
Amazon EC2 Container Service Live Demo - Microservices Web Day
PDF
Deep Dive on Microservices and Docker
PDF
Running Docker Containers on AWS
PPTX
Tech connect aws
PPTX
Getting Started With Docker on AWS
PDF
Container Days: Architecting Modern Apps on AWS
PPTX
Leveraging Amzon EC2 Container Services for Container Orchestration
PDF
Containers in AWS
PDF
Docker dev ops for cd meetup 12-14
PDF
Microservices: moving parts around
PDF
Micro service in aws meetup
PDF
Getting Started with Docker on AWS
PPTX
Wi t containerizemicroservices
PPTX
Introduction to Amazon EC2 Container Service and setting up build pipeline wi...
PPTX
AWS ECS Meetup Talentica
PPTX
AWS SSA Webinar 12 - Getting started on AWS with Containers
PDF
Microservices and Docker at Scale: The PB&J of Modern Systems
Aws microservice keynote
Introduction to AWS and Docker on ECS
More Containers Less Operations
Amazon EC2 Container Service Live Demo - Microservices Web Day
Deep Dive on Microservices and Docker
Running Docker Containers on AWS
Tech connect aws
Getting Started With Docker on AWS
Container Days: Architecting Modern Apps on AWS
Leveraging Amzon EC2 Container Services for Container Orchestration
Containers in AWS
Docker dev ops for cd meetup 12-14
Microservices: moving parts around
Micro service in aws meetup
Getting Started with Docker on AWS
Wi t containerizemicroservices
Introduction to Amazon EC2 Container Service and setting up build pipeline wi...
AWS ECS Meetup Talentica
AWS SSA Webinar 12 - Getting started on AWS with Containers
Microservices and Docker at Scale: The PB&J of Modern Systems
Ad

More from Danilo Poccia (20)

PDF
Get Value from Your Data
PDF
Building Event-Driven Serverless Applications
PDF
Connecting the Unconnected: IoT Made Simple
PDF
Building Event-driven Serverless Apps
PDF
An Introduction to AWS IoT
PDF
Event-driven (serverless) Applications
PDF
Machine Learning for Developers
PDF
Masterclass Advanced Usage of the AWS CLI
PDF
Cloud-powered Mobile Apps
PDF
Get Value From Your Data
PDF
Amazon Elastic File System (Amazon EFS)
PDF
AWS Mobile Hub Overview
PDF
Data Analytics on AWS
PDF
Managing Containers at Scale
PDF
Amazon API Gateway and AWS Lambda: Better Together
PDF
Amazon Aurora Let's Talk About Performance
PDF
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
PDF
Amazon Aurora: Amazon’s New Relational Database Engine
PDF
Infrastructure as Code: Manage your Architecture with Git
PDF
Infrastructure as Code: Manage your Architecture with Git
Get Value from Your Data
Building Event-Driven Serverless Applications
Connecting the Unconnected: IoT Made Simple
Building Event-driven Serverless Apps
An Introduction to AWS IoT
Event-driven (serverless) Applications
Machine Learning for Developers
Masterclass Advanced Usage of the AWS CLI
Cloud-powered Mobile Apps
Get Value From Your Data
Amazon Elastic File System (Amazon EFS)
AWS Mobile Hub Overview
Data Analytics on AWS
Managing Containers at Scale
Amazon API Gateway and AWS Lambda: Better Together
Amazon Aurora Let's Talk About Performance
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Amazon Aurora: Amazon’s New Relational Database Engine
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
Ad

Recently uploaded (20)

PPTX
Introduction to Artificial Intelligence
PPTX
Presentation of Computer CLASS 2 .pptx
PPTX
CRUISE TICKETING SYSTEM | CRUISE RESERVATION SOFTWARE
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
FLIGHT TICKET RESERVATION SYSTEM | FLIGHT BOOKING ENGINE API
PDF
System and Network Administration Chapter 2
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
System and Network Administraation Chapter 3
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPT
Introduction Database Management System for Course Database
PPTX
Safe Confined Space Entry Monitoring_ Singapore Experts.pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
top salesforce developer skills in 2025.pdf
Introduction to Artificial Intelligence
Presentation of Computer CLASS 2 .pptx
CRUISE TICKETING SYSTEM | CRUISE RESERVATION SOFTWARE
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PTS Company Brochure 2025 (1).pdf.......
FLIGHT TICKET RESERVATION SYSTEM | FLIGHT BOOKING ENGINE API
System and Network Administration Chapter 2
VVF-Customer-Presentation2025-Ver1.9.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
System and Network Administraation Chapter 3
Odoo POS Development Services by CandidRoot Solutions
How Creative Agencies Leverage Project Management Software.pdf
Introduction Database Management System for Course Database
Safe Confined Space Entry Monitoring_ Singapore Experts.pptx
L1 - Introduction to python Backend.pptx
How to Choose the Right IT Partner for Your Business in Malaysia
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
top salesforce developer skills in 2025.pdf

Microservice Architecture on AWS using AWS Lambda and Docker Containers