microservices on aws: divide & conquer for agility and scalability

125
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Level 200 (Introductory) Jim Tran, AWS Enterprise Solutions Architect July 28 , 2016 Architecting Microservices on AWS Divide and conquer for agility and scalability:

Upload: amazon-web-services

Post on 21-Apr-2017

318 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Microservices on AWS: Divide & Conquer for Agility and Scalability

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Level 200 (Introductory)

Jim Tran, AWS Enterprise Solutions ArchitectJuly 28, 2016

Architecting Microservices on AWSDivide and conquer for agility and scalability:

Page 2: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 3: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 4: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 5: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 6: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 7: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 8: Microservices on AWS: Divide & Conquer for Agility and Scalability

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

Email

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

* As of 1 Feb 2016

2009

48

280

722

82

2011 2013 2015

Page 10: Microservices on AWS: Divide & Conquer for Agility and Scalability

“The Monolith”

Page 11: Microservices on AWS: Divide & Conquer for Agility and Scalability

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

“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: Microservices on AWS: Divide & Conquer for Agility and Scalability

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

Too much software coupling

Page 17: Microservices on AWS: Divide & Conquer for Agility and Scalability

Too much software coupling

Shared libraries

Page 18: Microservices on AWS: Divide & Conquer for Agility and Scalability

Too much software coupling

Shared libraries

Shared data

Page 19: Microservices on AWS: Divide & Conquer for Agility and Scalability

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

“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 21: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 22: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 23: Microservices on AWS: Divide & Conquer for Agility and Scalability

“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 24: Microservices on AWS: Divide & Conquer for Agility and Scalability

“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 25: Microservices on AWS: Divide & Conquer for Agility and Scalability

“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 26: Microservices on AWS: Divide & Conquer for Agility and Scalability

“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 27: Microservices on AWS: Divide & Conquer for Agility and Scalability

“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 28: Microservices on AWS: Divide & Conquer for Agility and Scalability

“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 29: Microservices on AWS: Divide & Conquer for Agility and Scalability

Anatomy of a Micro-service

Page 30: Microservices on AWS: Divide & Conquer for Agility and Scalability

Data Store(eg, RDS, DynamoDB

ElastiCache, ElasticSearch)

Anatomy of a Micro-service

Page 31: Microservices on AWS: Divide & Conquer for Agility and Scalability

Application/Logic(code, libraries, etc)

Anatomy of a Micro-service

Data Store(eg, RDS, DynamoDB

ElastiCache, ElasticSearch)

Page 32: Microservices on AWS: Divide & Conquer for Agility and Scalability

Public API

POST /restaurantsGET /restaurants

Application/Logic(code, libraries, etc)

Anatomy of a Micro-service

Data Store(eg, RDS, DynamoDB

ElastiCache, ElasticSearch)

Page 33: Microservices on AWS: Divide & Conquer for Agility and Scalability

Avoid Software Coupling

Page 34: Microservices on AWS: Divide & Conquer for Agility and Scalability

Driversmicro-services

Paymentsmicro-service Location

micro-services

Orderingmicro-services

Restaurantmicro-service

Ecosystem of micro-services

Page 35: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 36: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 37: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 38: Microservices on AWS: Divide & Conquer for Agility and Scalability

= 50 million deployments a year

Thousands of teams

× Microservice architecture

× Continuous delivery

× Multiple environments

(5708 per hour, or every 0.63 second)

Page 39: Microservices on AWS: Divide & Conquer for Agility and Scalability

Gilt: Luxury designer brands at members-only prices

Page 40: Microservices on AWS: Divide & Conquer for Agility and Scalability

... Sale every day at noon EST

Page 41: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 42: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 43: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 44: Microservices on AWS: Divide & Conquer for Agility and Scalability

Micro-service A Micro-service B

public API public API

Principle 1: Micro-services only rely on each other’s public API

Page 45: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 46: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 47: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 48: Microservices on AWS: Divide & Conquer for Agility and Scalability

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.0

public API

Micro-service A

Page 49: Microservices on AWS: Divide & Conquer for Agility and Scalability

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.0

Version 1.1.0

public API

Micro-service A

Page 50: Microservices on AWS: Divide & Conquer for Agility and Scalability

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.0

Version 1.1.0

Version 2.0.0

public API

Micro-service A

Page 51: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 52: Microservices on AWS: Divide & Conquer for Agility and Scalability

public API public API

Principle 2: Use the right tool for the job(Embrace polyglot persistence)

DynamoDB

Micro-service A Micro-service B

Page 53: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 54: Microservices on AWS: Divide & Conquer for Agility and Scalability

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

public API public API

Principle 2: Use the right tool for the job(Embrace polyglot programming frameworks)

RDSAurora

Micro-service A Micro-service B

AmazonElasticsearchService

Page 56: Microservices on AWS: Divide & Conquer for Agility and Scalability

public API public API

Principle 2: Use the right tool for the job(Embrace polyglot programming frameworks)

RDSAurora

Micro-service A Micro-service B

AmazonElasticsearchService

Page 57: Microservices on AWS: Divide & Conquer for Agility and Scalability

Let’s builda micro-service!

Page 58: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 59: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

GET /restaurants

POST /restaurants

Page 60: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

Approach #1

EC2

Page 61: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

EC2

Page 62: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

EC2

Page 63: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

EC2EC2 EC2 EC2

Page 64: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

EC2EC2 EC2 EC2

Elastic Load Balancer

Page 65: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

Approach #2

ContainersUsing ECS

Page 66: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

EC2EC2 EC2 EC2

Elastic Load Balancer

Page 67: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

EC2EC2 EC2 EC2

Elastic Load Balancer

Page 68: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

EC2EC2 EC2 EC2

Elastic Load Balancer

AmazonEC2 ContainerService (ECS)

to managecontainers

Page 69: Microservices on AWS: Divide & Conquer for Agility and Scalability

• 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 70: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

Approach #3

API Gateway+ Lambda

Page 71: Microservices on AWS: Divide & Conquer for Agility and Scalability

DynamoDB

Restaurant Micro-service

Page 72: Microservices on AWS: Divide & Conquer for Agility and Scalability

DynamoDB

Lambda

Restaurant Micro-service

Page 73: Microservices on AWS: Divide & Conquer for Agility and Scalability

DynamoDB

Lambda

Restaurant Micro-service

API Gateway

Page 74: Microservices on AWS: Divide & Conquer for Agility and Scalability

AWS Lambda

lets you run code

without managing servers

Page 75: Microservices on AWS: Divide & Conquer for Agility and Scalability

Upload your code(Java, JavaScript,

Python)

Page 76: Microservices on AWS: Divide & Conquer for Agility and Scalability

Upload your code(Java, JavaScript,

Python)

Set up your code to trigger from other AWS

services, webservicecalls, or app activity

Page 77: Microservices on AWS: Divide & Conquer for Agility and Scalability

Lambda automatically

scales

Upload your code(Java, JavaScript,

Python)

Set up your code to trigger from other AWS

services, webservicecalls, or app activity

Page 78: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 79: Microservices on AWS: Divide & Conquer for Agility and Scalability

AWS API Gateway

is the easiest way to deploy micro-services

Page 80: Microservices on AWS: Divide & Conquer for Agility and Scalability

Create a unified API frontend for

multiplemicro-services

Page 81: Microservices on AWS: Divide & Conquer for Agility and Scalability

Create a unified API frontend for

multiplemicro-services

Authenticate and authorize requests

Page 82: Microservices on AWS: Divide & Conquer for Agility and Scalability

Create a unified API frontend for

multiplemicro-services

Authenticate and authorize requests

Handles DDoSprotection and API throttling

Page 83: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 84: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 85: Microservices on AWS: Divide & Conquer for Agility and Scalability

Restaurant Micro-service

Page 86: Microservices on AWS: Divide & Conquer for Agility and Scalability

DynamoDB

Restaurant Micro-service

Page 87: Microservices on AWS: Divide & Conquer for Agility and Scalability

DynamoDB

Lambdato retrieverestaurants

Restaurant Micro-service

Lambdato store

restaurants

Page 88: Microservices on AWS: Divide & Conquer for Agility and Scalability

DynamoDB

Lambdato retrieverestaurants

Restaurant Micro-service

API Gateway

POST GET

Lambdato store

restaurants

Page 89: Microservices on AWS: Divide & Conquer for Agility and Scalability

DynamoDB

Lambdato retrieverestaurants

Restaurant Micro-service

API Gateway

POST GET

Web UI

Lambdato store

restaurants

Page 90: Microservices on AWS: Divide & Conquer for Agility and Scalability
Page 91: Microservices on AWS: Divide & Conquer for Agility and Scalability

DynamoDB

Lambdato retrieverestaurants

Restaurant Micro-service

API Gateway

POST GET

Web UI

Lambdato store

restaurants

Page 92: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 micro-service usage

Page 93: Microservices on AWS: Divide & Conquer for Agility and Scalability

Micro-service A Micro-service B

public API public API

From a few…

Page 94: Microservices on AWS: Divide & Conquer for Agility and Scalability

Driversmicro-services

Paymentsmicro-service Location

micro-services

Orderingmicro-services

Restaurantmicro-service

…to an ecosystem

Page 95: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 96: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 97: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 98: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 99: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 100: Microservices on AWS: Divide & Conquer for Agility and Scalability

…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 101: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 102: Microservices on AWS: Divide & Conquer for Agility and Scalability

“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 103: Microservices on AWS: Divide & Conquer for Agility and Scalability

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 105: Microservices on AWS: Divide & Conquer for Agility and Scalability

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 107: Microservices on AWS: Divide & Conquer for Agility and Scalability

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: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 109: Microservices on AWS: Divide & Conquer for Agility and Scalability

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

Cross functional teams self-contained services(“Two-pizza teams” at Amazon)

Page 110: Microservices on AWS: Divide & Conquer for Agility and Scalability

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

Cross functional teams self-contained services(“Two-pizza teams” at Amazon)

Page 111: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 112: Microservices on AWS: Divide & Conquer for Agility and Scalability

releasetestbuild

Focused agile teams

2-pizza team delivery pipeline service

Page 113: Microservices on AWS: Divide & Conquer for Agility and Scalability

releasetestbuild

releasetestbuild

Focused agile teams

2-pizza team delivery pipeline service

Page 114: Microservices on AWS: Divide & Conquer for Agility and Scalability

releasetestbuild

releasetestbuild

releasetestbuild

Focused agile teams

2-pizza team delivery pipeline service

Page 115: Microservices on AWS: Divide & Conquer for Agility and Scalability

releasetestbuild

releasetestbuild

releasetestbuild

releasetestbuild

Focused agile teams

2-pizza team delivery pipeline service

Page 116: Microservices on AWS: Divide & Conquer for Agility and Scalability

releasetestbuild

releasetestbuild

releasetestbuild

releasetestbuild

releasetestbuild

Focused agile teams

2-pizza team delivery pipeline service

Page 117: Microservices on AWS: Divide & Conquer for Agility and Scalability

releasetestbuild

releasetestbuild

releasetestbuild

releasetestbuild

releasetestbuild

releasetestbuild

Focused agile teams

2-pizza team delivery pipeline service

Page 118: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 119: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 120: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 121: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 122: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 123: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 124: Microservices on AWS: Divide & Conquer for Agility and Scalability

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 125: Microservices on AWS: Divide & Conquer for Agility and Scalability

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Jim Tran

[email protected]

Thank you!