Divide and conquer for agility and scalability: An introduction to Microservices
-
Upload
amazon-web-services -
Category
Engineering
-
view
467 -
download
2
Transcript of Divide and conquer for agility and scalability: An introduction to Microservices
![Page 1: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/1.jpg)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Jim Tran
AWS Enterprise Solutions Architect
June 30, 2016
Architecting Microservices on AWSDivide and conquer for agility and scalability:
![Page 2: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/2.jpg)
![Page 3: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/3.jpg)
![Page 4: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/4.jpg)
![Page 5: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/5.jpg)
![Page 6: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/6.jpg)
![Page 7: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/7.jpg)
![Page 8: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/8.jpg)
ENTERPRISE APPS
DEVELOPMENT & OPERATIONSMOBILE SERVICESAPP SERVICESANALYTICS
DataWarehousing
Hadoop/Spark
Streaming Data Collection
Machine Learning
Elastic Search
Virtual Desktops
Sharing & Collaboration
Corporate Email
Backup
Queuing & Notifications
Workflow
Search
Transcoding
One-click App Deployment
Identity
Sync
Single Integrated Console
PushNotifications
DevOps Resource Management
Application Lifecycle Management
Containers
Triggers
Resource Templates
TECHNICAL & BUSINESS SUPPORT
Account Management
Support
Professional Services
Training & Certification
Security & Pricing Reports
Partner Ecosystem
Solutions Architects
MARKETPLACE
Business Apps
Business Intelligence
DatabasesDevOps Tools
NetworkingSecurity Storage
RegionsAvailability Zones
Points of Presence
INFRASTRUCTURE
CORE SERVICES
ComputeVMs, Auto-scaling, & Load Balancing
StorageObject, Blocks, Archival, Import/Export
DatabasesRelational, NoSQL, Caching, Migration
NetworkingVPC, DX, DNS
CDN
Access Control
Identity Management
Key Management & Storage
Monitoring & Logs
Assessment and reporting
Resource & Usage Auditing
SECURITY & COMPLIANCE
Configuration Compliance
Web application firewall
HYBRIDARCHITECTURE
Data Backups
Integrated App Deployments
DirectConnect
IdentityFederation
IntegratedResource Management
Integrated Networking
API Gateway
IoT
Rules Engine
Device Shadows
Device SDKs
Registry
Device Gateway
Streaming Data Analysis
Business Intelligence
MobileAnalytics
![Page 9: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/9.jpg)
* As of 1 Feb 2016
2009
48
280
722
82
2011 2013 2015
![Page 10: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/10.jpg)
“The Monolith”
“Monolith” by Sage Ross. No alterations other than cropping. https://www.flickr.com/photos/ragesoss/2931770125/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
![Page 11: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/11.jpg)
Challenges with monolithic software
Long Build/Test/Release Cycles(who broke the build?)
Operationsis a nightmare(module X is failing, who’s the owner?)
Difficult to scale
New releasestake months
Long time to addnew features
Architecture is hard to maintain and evolve
Lack of innovation
Frustrated customers
Lack of agility
![Page 12: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/12.jpg)
Challenges with monolithic software
Long Build/Test/Release Cycles(who broke the build?)
Operationsis a nightmare(module X is failing, who’s the owner?)
Difficult to scale
New releasestake months
Long time to addnew features
Architecture is hard to maintain and evolve
Lack of innovation
Frustrated customers
Lack of agility
![Page 13: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/13.jpg)
Challenges with monolithic software
Long Build/Test/Release Cycles(who broke the build?)
Operationsis a nightmare(module X is failing, who’s the owner?)
Difficult to scale
New releasestake months
Long time to addnew features
Architecture is hard to maintain and evolve
Lack of innovation
Frustrated customers
Lack of agility
![Page 14: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/14.jpg)
“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/)
![Page 15: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/15.jpg)
Monolith development lifecycle
releasetestbuild
delivery pipeline
app(aka the“monolith”)
developers
Photo by Sage Ross. No alterations other than cropping. https://www.flickr.com/photos/ragesoss/2931770125/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
![Page 16: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/16.jpg)
Too much software coupling
![Page 17: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/17.jpg)
Too much software coupling
Shared libraries
![Page 18: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/18.jpg)
Too much software coupling
Shared libraries
Shared data
![Page 19: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/19.jpg)
Evolving towards microservices
“IMG_1760” by Robert Couse-Baker. No alterations other than cropping. https://www.flickr.com/photos/29233640@N07/14859431605/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
![Page 20: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/20.jpg)
![Page 21: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/21.jpg)
![Page 22: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/22.jpg)
“service-oriented
architecture
composed of
loosely coupled
elements
that have
bounded contexts”
Adrian Cockcroft (former Cloud Architect at Netflix,now Technology Fellow at Battery Ventures)
![Page 23: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/23.jpg)
“service-oriented
architecture
composed of
loosely coupled
elements
that have
bounded contexts”
Adrian Cockcroft (former Cloud Architect at Netflix,now Technology Fellow at Battery Ventures)
Services communicate with each other over the network
![Page 24: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/24.jpg)
“service-oriented
architecture
composed of
loosely coupled
elements
that have
bounded contexts”
Adrian Cockcroft (former Cloud Architect at Netflix,now Technology Fellow at Battery Ventures)
You can update the services independently; updating one service doesn’t require changing any other services.
![Page 25: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/25.jpg)
“service-oriented
architecture
composed of
loosely coupled
elements
that have
bounded contexts”
Adrian Cockcroft (former Cloud Architect at Netflix,now Technology Fellow at Battery Ventures)
Self-contained; you can update the code without knowing anything about the internals of other microservices
![Page 26: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/26.jpg)
“Do one thing, and do it well”
“Swiss Army” by by Jim Pennucci. No alterations other than cropping. https://www.flickr.com/photos/pennuja/5363518281/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
![Page 27: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/27.jpg)
“Tools” by Tony Walmsley: No alterations other than cropping. https://www.flickr.com/photos/twalmsley/6825340663/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
“Do one thing, and do it well”
![Page 28: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/28.jpg)
Anatomy of a Micro-service
![Page 29: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/29.jpg)
Data Store(eg, RDS, DynamoDB
ElastiCache, ElasticSearch)
Anatomy of a Micro-service
![Page 30: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/30.jpg)
Application/Logic(code, libraries, etc)
Anatomy of a Micro-service
Data Store(eg, RDS, DynamoDB
ElastiCache, ElasticSearch)
![Page 31: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/31.jpg)
Public API
POST /restaurantsGET /resturants
Application/Logic(code, libraries, etc)
Anatomy of a Micro-service
Data Store(eg, RDS, DynamoDB
ElastiCache, ElasticSearch)
![Page 32: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/32.jpg)
Avoid Software Coupling
![Page 33: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/33.jpg)
Driversmicro-services
Paymentsmicro-service Location
micro-services
Orderingmicro-services
Restaurantmicro-service
Ecosystem of micro-services
![Page 34: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/34.jpg)
![Page 35: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/35.jpg)
![Page 36: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/36.jpg)
![Page 37: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/37.jpg)
= 50 million deployments a year
Thousands of teams
× Microservice architecture
× Continuous delivery
× Multiple environments
(5708 per hour, or every 0.63 second)
![Page 38: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/38.jpg)
Gilt: Luxury designer brands at members-only prices
![Page 39: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/39.jpg)
... Sale every day at noon EST
![Page 40: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/40.jpg)
![Page 41: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/41.jpg)
![Page 42: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/42.jpg)
Principle 1
Micro-services only rely on each other’s public API
“Contracts” by NobMouse. No alterations other than cropping.https://www.flickr.com/photos/nobmouse/4052848608/
Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
![Page 43: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/43.jpg)
Micro-service A Micro-service B
public API public API
Principle 1: Micro-services only rely on each other’s public API
![Page 44: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/44.jpg)
public API public API
Principle 1: Micro-services only rely on each other’s public API(Hide Your Data)
Micro-service A Micro-service B
![Page 45: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/45.jpg)
public API public API
Nope!
Principle 1: Micro-services only rely on each other’s public API(Hide Your Data)
Micro-service A Micro-service B
![Page 46: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/46.jpg)
public API public API
Principle 1: Micro-services only rely on each other’s public API(Hide Your Data)
Micro-service A Micro-service B
![Page 47: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/47.jpg)
Principle 1: Micro-services only rely on each other’s public API(Evolve API in backward-compatible way…and document!)
storeRestaurant (id, name, cuisine)
Version 1.0
public API
Micro-service A
![Page 48: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/48.jpg)
Principle 1: Micro-services only rely on each other’s public API(Evolve API in backward-compatible way…and document!)
storeRestaurant (id, name, cuisine)
storeRestaurant (id, name, cuisine)storeRestaurant (id, name, arbitrary_metadata)addReview (restaurantId, rating, comments)
Version 1.0
Version 1.1
public API
Micro-service A
![Page 49: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/49.jpg)
Principle 1: Micro-services only rely on each other’s public API(Evolve API in backward-compatible way…and document!)
storeRestaurant (id, name, cuisine)
storeRestaurant (id, name, cuisine)storeRestaurant (id, name, arbitrary_metadata)addReview (restaurantId, rating, comments)
storeRestaurant (id, name, arbitrary_metadata)addReview (restaurantId, rating, comments)
Version 1.0
Version 1.1
Version 2.0
public API
Micro-service A
![Page 50: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/50.jpg)
Principle 2
Use the right tool for the job
“Tools #2” by Juan Pablo Olmo. No alterations other than cropping.https://www.flickr.com/photos/juanpol/1562101472/
Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
![Page 51: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/51.jpg)
public API public API
Principle 2: Use the right tool for the job(Embrace polyglot persistence)
DynamoDB
Micro-service A Micro-service B
![Page 52: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/52.jpg)
public API public API
Principle 2: Use the right tool for the job(Embrace polyglot persistence)
DynamoDB
Micro-service A Micro-service B
AmazonElasticsearchService
![Page 53: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/53.jpg)
public API public API
Principle 2: Use the right tool for the job(Embrace polyglot persistence)
RDSAurora
Micro-service A Micro-service B
AmazonElasticsearchService
![Page 54: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/54.jpg)
public API public API
Principle 2: Use the right tool for the job(Embrace polyglot persistence)
RDSAurora
Micro-service A Micro-service B
AmazonElasticsearchService
![Page 55: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/55.jpg)
public API public API
Principle 2: Use the right tool for the job(Embrace polyglot persistence)
RDSAurora
Micro-service A Micro-service B
AmazonElasticsearchService
![Page 56: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/56.jpg)
Let’s builda micro-service!
![Page 57: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/57.jpg)
![Page 58: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/58.jpg)
Restaurant Micro-service
GET /restaurants
POST /restaurants
![Page 59: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/59.jpg)
Restaurant Micro-service
Approach #1
EC2
![Page 60: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/60.jpg)
Restaurant Micro-service
EC2
![Page 61: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/61.jpg)
Restaurant Micro-service
EC2
![Page 62: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/62.jpg)
Restaurant Micro-service
EC2EC2 EC2 EC2
![Page 63: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/63.jpg)
Restaurant Micro-service
EC2EC2 EC2 EC2
Elastic Load Balancer
![Page 64: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/64.jpg)
Restaurant Micro-service
Approach #2
ContainersUsing ECS
![Page 65: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/65.jpg)
Restaurant Micro-service
EC2EC2 EC2 EC2
Elastic Load Balancer
![Page 66: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/66.jpg)
Restaurant Micro-service
EC2EC2 EC2 EC2
Elastic Load Balancer
![Page 67: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/67.jpg)
Restaurant Micro-service
EC2EC2 EC2 EC2
Elastic Load Balancer
AmazonEC2 ContainerService (ECS)
to managecontainers
![Page 68: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/68.jpg)
• Prototype in less than 2 months
• Deployment time: hours minutes
• Each team can now develop itsrespective applications independently
Coursera13 million users from 190 countries1,000 courses from 119 institutions
![Page 69: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/69.jpg)
Restaurant Micro-service
Approach #3
API Gateway+ Lambda
![Page 70: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/70.jpg)
DynamoDB
Restaurant Micro-service
![Page 71: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/71.jpg)
DynamoDB
Lambda
Restaurant Micro-service
![Page 72: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/72.jpg)
DynamoDB
Lambda
Restaurant Micro-service
API Gateway
![Page 73: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/73.jpg)
AWS Lambda
lets you run code
without managing servers
![Page 74: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/74.jpg)
Upload your code(Java, JavaScript,
Python)
![Page 75: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/75.jpg)
Upload your code(Java, JavaScript,
Python)
Set up your code to trigger from other AWS
services, webservicecalls, or app activity
![Page 76: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/76.jpg)
Lambda automatically
scales
Upload your code(Java, JavaScript,
Python)
Set up your code to trigger from other AWS
services, webservicecalls, or app activity
![Page 77: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/77.jpg)
Lambda automatically
scales
Upload your code(Java, JavaScript,
Python)
Pay for only the compute time
you use(sub-second metering)
Set up your code to trigger from other AWS
services, webservicecalls, or app activity
![Page 78: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/78.jpg)
AWS API Gateway
is the easiest way to deploy microservices
![Page 79: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/79.jpg)
Create a unified API frontend for
multiplemicro-services
![Page 80: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/80.jpg)
Create a unified API frontend for
multiplemicro-services
Authenticate and authorize requests
![Page 81: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/81.jpg)
Create a unified API frontend for
multiplemicro-services
Authenticate and authorize requests
Handles DDoSprotection and API throttling
![Page 82: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/82.jpg)
Create a unified API frontend for
multiplemicro-services
…as well as monitoring,
logging, rollbacks,
client SDK generation…
Authenticate and authorize requests
Handles DDoSprotection and API throttling
![Page 83: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/83.jpg)
![Page 84: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/84.jpg)
Restaurant Micro-service
![Page 85: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/85.jpg)
DynamoDB
Restaurant Micro-service
![Page 86: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/86.jpg)
DynamoDB
Lambdato retrieverestaraunts
Restaurant Micro-service
Lambdato store
restaraunts
![Page 87: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/87.jpg)
DynamoDB
Lambdato retrieverestaraunts
Restaurant Micro-service
API Gateway
POST GET
Lambdato store
restaraunts
![Page 88: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/88.jpg)
DynamoDB
Lambdato retrieverestaraunts
Restaurant Micro-service
API Gateway
POST GET
Web UI
Lambdato store
restaraunts
![Page 89: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/89.jpg)
![Page 90: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/90.jpg)
DynamoDB
Lambda toretrieverestaraunts
Restaurant Micro-service
API Gateway
POST GET
Web UI
Lambda tostore
restaraunts
![Page 91: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/91.jpg)
Highly Scalable• Inherently scalable
Secure• API Gateway acts as “front door”• Can add authN/authZ; or throttle API if needed• S3 bucket policies• IAM Roles for Lambda invocations
Cost-efficient• Only pay for actual microservice usage
![Page 92: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/92.jpg)
Micro-service A Micro-service B
public API public API
From a few…
![Page 93: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/93.jpg)
Driversmicro-services
Paymentsmicro-service Location
micro-services
Orderingmicro-services
Restaurantmicro-service
…to an ecosystem
![Page 94: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/94.jpg)
Principle 3
Secure Your Services
“security” by Dave Bleasdale. No alterations other than cropping.https://www.flickr.com/photos/sidelong/3878741556/
Image used with permissions under Creative Commons license 2.0,Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
![Page 95: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/95.jpg)
Principle 3: Secure Your Services
• Defense-in-depth• Network level (e.g. VPC, Security Groups, TLS)• Server/container-level• App-level• IAM policies
• Gateway (“Front door”)
• API Throttling
• Authentication & Authorization• Client-to-service, as well as service-to-service• API Gateway: custom Lambda authorizers• IAM-based Authentication• Token-based auth (JWT tokens, OAuth 2.0)
• Secrets management• S3 bucket policies + KMS + IAM• Open-source tools (e.g. Vault, Keywhiz)
API Gateway
![Page 96: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/96.jpg)
Principle 4
Be a good citizenwithin the ecosystem
“Lamington National Park, rainforest” by Jussarian. No alterations other than cropping.https://www.flickr.com/photos/kerr_at_large/87771074/
Image used with permissions under Creative Commons license 2.0,Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
![Page 97: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/97.jpg)
Hey Sally, we need to call your micro-service to fetch
restaurants details.
Sure Paul. Which APIs you need to call? Once I know
better your use cases I’ll give you permission to register
your service as a client on our service’s directory entry.
Micro-service A Micro-service B
public API public API
Principle 4: Be a good citizen within the ecosystem
![Page 98: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/98.jpg)
Principle 4: Be a good citizen within the ecosystem(Have clear SLAs)
RestaurantMicro-service
15 TPS100 TPS5 TPS20 TPS
Before we let you call our micro-service we
need to understand your use case, expected load
(TPS) and accepted latency
![Page 99: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/99.jpg)
…and many,many others!
Distributed monitoring and tracing• “Is the service meeting its SLA?”• “Which services were involved in a request?”• “How did downstream dependencies perform?”
Shared metrics• e.g. request time, time to first byte
Distributed tracing• e.g. Zipkin, OpenTracing
User-experience metrics
Principle 4: Be a good citizen within the ecosystem(Distributed monitoring, logging and tracing)
![Page 100: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/100.jpg)
Principle 5
More than justtechnology transformation
“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/)
![Page 101: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/101.jpg)
“Any organization that designs a system will inevitably produce a design whose structure is a copy of the organization’scommunication structure.”
Melvin E. Conway, 1967
Conway’s Law
![Page 102: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/102.jpg)
Decentralize governance and data management
Image from Martin Fowler’s article on microservices, athttp://martinfowler.com/articles/microservices.html
No alterations other than cropping.Permission to reproduce: http://martinfowler.com/faq.html
![Page 103: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/103.jpg)
Decentralize governance and data management
Image from Martin Fowler’s article on microservices, athttp://martinfowler.com/articles/microservices.html
No alterations other than cropping.Permission to reproduce: http://martinfowler.com/faq.html
![Page 104: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/104.jpg)
Silo’d functional teams silo’d application architectures
Image from Martin Fowler’s article on microservices, athttp://martinfowler.com/articles/microservices.html
No alterations other than cropping.Permission to reproduce: http://martinfowler.com/faq.html
![Page 105: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/105.jpg)
Silo’d functional teams silo’d application architectures
Image from Martin Fowler’s article on microservices, athttp://martinfowler.com/articles/microservices.html
No alterations other than cropping.Permission to reproduce: http://martinfowler.com/faq.html
![Page 106: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/106.jpg)
Cross functional teams self-contained services
Image from Martin Fowler’s article on microservices, athttp://martinfowler.com/articles/microservices.html
No alterations other than cropping.Permission to reproduce: http://martinfowler.com/faq.html
![Page 107: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/107.jpg)
Cross functional teams self-contained services
Image from Martin Fowler’s article on microservices, athttp://martinfowler.com/articles/microservices.html
No alterations other than cropping.Permission to reproduce: http://martinfowler.com/faq.html
![Page 108: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/108.jpg)
“Two-pizza teams” at Amazon
Full ownership
Full accountability
Aligned incentives
“DevOps”
Non-pizza image from Martin Fowler’s article on microservices, athttp://martinfowler.com/articles/microservices.html
No alterations other than cropping.Permission to reproduce: http://martinfowler.com/faq.html
![Page 109: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/109.jpg)
Principle 6
Automate Everything
“Robot” by Robin Zebrowski. No alterations other than cropping.https://www.flickr.com/photos/firepile/438134733/
Image used with permissions under Creative Commons license 2.0,Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)
![Page 110: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/110.jpg)
releasetestbuild
Focused agile teams
2-pizza team delivery pipeline service
![Page 111: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/111.jpg)
releasetestbuild
releasetestbuild
Focused agile teams
2-pizza team delivery pipeline service
![Page 112: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/112.jpg)
releasetestbuild
releasetestbuild
releasetestbuild
Focused agile teams
2-pizza team delivery pipeline service
![Page 113: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/113.jpg)
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
Focused agile teams
2-pizza team delivery pipeline service
![Page 114: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/114.jpg)
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
Focused agile teams
2-pizza team delivery pipeline service
![Page 115: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/115.jpg)
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
Focused agile teams
2-pizza team delivery pipeline service
![Page 116: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/116.jpg)
Principle 6: Automate everything
AWS
CodeCommit
AWS
CodePipeline
AWS
CodeDeploy
EC2 ELBAuto
ScalingLambdaECS
DynamoDBRDS ElastiCache SQS SWF
SES SNS
API GatewayCloudWatch Cloud Trail
KinesisElasticBeanstalk
![Page 117: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/117.jpg)
It’s a journey…
Expect challenges along the way…
• Understanding of business domains
• Coordinating txns across multiple services
• Eventual Consistency
• Service discovery
• Lots of moving parts requires increased coordination
• Complexity of testing / deploying / operating a distributed system
• Cultural transformation
![Page 118: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/118.jpg)
Principles of Microservices
1. Rely only on the public API Hide your data Document your APIs Define a versioning strategy
2. Use the right tool for the job Polygot persistence (data layer) Polyglot frameworks (app layer)
3. Secure your services Defense-in-depth Authentication/authorization
6. Automate everything Adopt DevOps
4. Be a good citizen within the ecosystem Have SLAs Distributed monitoring, logging, tracing
5. More than just technology transformation Embrace organizational change Favor small focused dev teams
![Page 119: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/119.jpg)
Benefits of microservices
Rapid Build/Test/Release Cycles
Clear ownership andaccountability
Easier to scaleeach individual micro-service
New releasestake minutes
Short time to addnew features
Easier to maintain and evolve
Increase innovation
Delighted customers
Increased agility
![Page 120: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/120.jpg)
Benefits of microservices
Rapid Build/Test/Release Cycles
Clear ownership andaccountability
Easier to scaleeach individual micro-service
New releasestake minutes
Short time to addnew features
Easier to maintain and evolve system
Faster innovation
Delighted customers
Increased agility
![Page 121: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/121.jpg)
Benefits of microservices
Rapid Build/Test/Release Cycles
Clear ownership andaccountability
Easier to scaleeach individual micro-service
New releasestake minutes
Short time to addnew features
Easier to maintain and evolve system
Faster innovation
Delighted customers
Increased agility
![Page 122: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/122.jpg)
Additional AWS resources:• Zombie Microservices Workshop:
https://github.com/awslabs/aws-lambda-zombie-workshop• 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/
• Serverless Service Discovery:https://aws.amazon.com/blogs/developer/serverless-service-discovery-part-1-get-started/
• ECS Service Discovery:https://aws.amazon.com/blogs/compute/service-discovery-an-amazon-ecs-reference-architecture/
• Microservices without the Servershttps://aws.amazon.com/blogs/compute/microservices-without-the-servers
Popular open-source tools:• Serverless – http://serverless.com• Apex - http://apex.run/
https://aws.amazon.com/devops/
Additional resources
![Page 123: Divide and conquer for agility and scalability: An introduction to Microservices](https://reader030.fdocuments.in/reader030/viewer/2022020203/587efe9f1a28ab35528b68af/html5/thumbnails/123.jpg)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Jim Tran
Thank you!