Professional Documents
Culture Documents
Demo
Marketplace Mgmt. Tools Analytics Dev Tools Artificial IoT Mobile Enterprise Game
Business Business
Service Catalog
Intelligence Analytics
Server Build, Test, Document
Security Hadoop/Spark Rules Engine
Account Support Management Monitor Apps Sharing
Configuration Real-time Data Private Git Voice & Text Local Compute Push Email &
Support Networking
Tracking Streaming Repositories Chatbots and Sync Notifications Calendaring
Managed Database & Orchestration Continuous Machine Device Build, Deploy, Hosted
Optimization
Services Storage Workflows Delivery Learning Shadows Manage APIs Desktops
Professional SaaS Resource Managed Build, Test, and Device Application 3D Game
Text-to-Speech Device Testing
Services Subscriptions Templates Search Debug Gateway Streaming Engine
Partner Operating Multi-player
Automation Managed ETL Deployment Image Analysis Registry Identity Backup
Ecosystem Systems Backends
Training &
Certification Application Application Database Server
Migration Discovery Migration
Data Migration
Migration Migration
Solution
Data Integrated Identity Resource VMware on Devices & Edge
Architects Hybrid Integration Networking Federation Management AWS Systems
Account
Management Application
Transcoding Step Functions Messaging
Security & Services
Pricing Reports Identity & Key Storage & Active DDoS Application Certificate Web App.
Security Access Management Directory Protection Analysis Management Firewall
Technical Acct.
Management Data
Database Aurora MySQL PostgreSQL Oracle SQL Server MariaDB
Warehousing
NoSQL
Availability Points of
Infrastructure Regions
Zones Presence
1,017
516
159
61
2010 2012 2014 2016
* As of 1 March 2017
The Monolith
Challenges with monolithic software
Difficult to Architecture is
scale hard to maintain Lack of agility
and evolve
Long
New releases
Build/Test/Release Lack of innovation
take months
Cycles
(who broke the build?)
Operations
is a nightmare Long time to add Frustrated customers
(module X is failing, new features
whos the owner?)
Challenges with monolithic software
Difficult to Architecture is
scale hard to maintain Lack of agility
and evolve
Long
New releases
Build/Test/Release Lack of innovation
take months
Cycles
(who broke the build?)
Operations
is a nightmare Long time to add Frustrated customers
(module X is failing, new features
whos the owner?)
Challenges with monolithic software
Difficult to Architecture is
scale hard to maintain Lack of agility
and evolve
Long
New releases
Build/Test/Release Lack of innovation
take months
Cycles
(who broke the build?)
Operations
is a nightmare Long time to add Frustrated customers
(module X is failing, new features
whos the owner?)
20080219BonMorningDSC_0022B by Sunphol Sorakul . No alterations other than cropping. https://www.flickr.com/photos/83424882@N00/3483881705/
Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
Monolith development lifecycle
app
developers (aka themonolith)
delivery pipeline
Data Store
(eg, RDS, DynamoDB
ElastiCache, ElasticSearch)
Anatomy of a Micro-service
Public API
POST /micro-service
GET /micro-service
Payments
micro-service Location
micro-service
Drivers Ordering
micro-service micro-service
Thousands of teams
Microservice architecture
Continuous delivery
Multiple environments
Payments
micro-service Location
micro-service
Drivers Ordering
micro-service micro-service
Micro-service Design
Approach #1
EC2
Micro-service Design
EC2
Micro-service Design
EC2
Micro-service Design
Elastic Load
Balancer
Elastic Load
Balancer
AWS Elastic
Beanstalk
Elastic Beanstalk vs. DIY
On-instance configuration
HTTP server
Elastic Beanstalk configures each
EC2 instance in your environment
Application server
with the components necessary to
run applications for the selected
Language interpreter
platform. No more worrying about
logging into instances to install and
Operating system
configure your application stack.
Host
Provided by you
Approach #2
Containers
Using ECS
Amazon
EC2 Container Service (ECS)
is the cluster management system to
run your Docker containers
Use Amazon EC2 Container Service for container workloads
Flexible Scheduling
Applications
Batch jobs Amazon
EC2 Container
Service (ECS)
Multiple schedulers
Use Amazon EC2 Container Service for container workloads
Elastic Load
Balancer
Elastic Load
Balancer
Elastic Load
Balancer
Approach #3
API Gateway
+ Lambda
AWS Lambda
lets you run code
without managing servers
Upload your code Set up your code to Lambda Pay for only the
(Java, JavaScript, trigger from other AWS automatically compute time
Python) scales you use
services, webservice (sub-second
calls, or app activity metering)
AWS API Gateway
is the easiest way to
deploy micro-services
Create a unified Authenticate and Handles DDoS as well as
API frontend for authorize protection and monitoring,
multiple requests API throttling logging, rollbacks,
micro-services client SDK
generation
Principle 1
Micro-service A Micro-service B
DynamoDB
Micro-service A Micro-service B
DynamoDB
Nope!
Micro-service A Micro-service B
DynamoDB
Micro-service A Micro-service B
DynamoDB
public API
Principle 1: Microservices only rely on each others public API
(Evolve API in backward-compatible wayand
document!)
Version 1.0.0
storeRestaurant (id, name, cuisine)
Micro-service A
Version 1.1.0
storeRestaurant (id, name, cuisine)
storeRestaurant (id, name,
public API arbitrary_metadata)
addReview (restaurantId, rating, comments)
Principle 1: Microservices only rely on each others public API
(Evolve API in backward-compatible wayand
document!)
Version 1.0.0
storeRestaurant (id, name, cuisine)
Micro-service A
Version 1.1.0
storeRestaurant (id, name, cuisine)
storeRestaurant (id, name,
public API arbitrary_metadata)
addReview (restaurantId, rating, comments)
Version 2.0.0
storeRestaurant (id, name,
arbitrary_metadata)
addReview (restaurantId, rating, comments)
Principle 2
Micro-service A Micro-service B
DynamoDB
Micro-service A Micro-service B
DynamoDB
Micro-service A Micro-service B
RDS
Aurora
Micro-service A Micro-service B
RDS
Aurora
Micro-service A Micro-service B
RDS
Aurora
Secrets management
Parameter Store
S3 bucket policies + KMS + IAM
Open-source tools (e.g. Vault, Keywhiz)
Principle 3: Secure Your Services
Defense-in-depth
Network level (e.g. VPC, Security Groups, TLS)
API Gateway Server/container-level
App-level
IAM policies
API Throttling
Stage-level and Method-level throttling
Secrets management
S3 bucket policies + KMS + IAM
Open-source tools (e.g. Vault, Keywhiz)
Principle 4
Be a good citizen
within the ecosystem
Micro-service A Micro-service B
Restaurant
Micro-service
Shared metrics
e.g. service dependency, request/response time
Distributed tracing
AWS X-Ray
3rd party: Zipkin, OpenTracing
AWS X-Ray X-Ray collects data X-Ray combines View the service Drill into the
traces requests about the request the data map to see service showing
made to your from each of the gathered from trace data such unusual
application underlying each service as latencies, behavior to
applications services into singular HTTP statuses, identify the root
it passes through units called and metadata issue
traces for each service
Principle 5
rowing on the river in Bedford by Matthew Hunt. No alterations other than cropping.
https://www.flickr.com/photos/mattphotos/19189529/
Image used with permissions under Creative Commons license 2.0,
Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
Conways Law
Full accountability
Aligned incentives
DevOps
Automate Everything
Auto Elastic
EC2 Lambda Scaling ELB Beanstalk Kinesis
ECS
Its a journey
1. Rely only on the public API 4. Be a good citizen within the ecosystem
Hide your data Have SLAs
Document your APIs Distributed monitoring, logging, tracing
Define a versioning strategy
2. Use the right tool for the job 5. More than just technology transformation
Container journey? (use ECS) Embrace organizational change
Polyglot persistence (data layer) Favor small focused dev teams
Polyglot frameworks (app layer)
Easier to scale
each
individual
micro-service
Rapid
Build/Test/Release
Cycles
https://aws.amazon.com/devops/
Additional AWS resources:
Microservices on AWS whitepaper:
https://d0.awsstatic.com/whitepapers/microservices-on-
aws.pdf
Serverless Webapp - Reference Architecture:
https://github.com/awslabs/lambda-refarch-webapp
Microservices with ECS:
https://aws.amazon.com/blogs/compute/using-amazon-
api-gateway-with-microservices-deployed-on-amazon-ecs/
Microservices without the Servers
https://aws.amazon.com/blogs/compute/
microservices-without-the-servers