An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

94
An overview of designing microservices based applications on AWS Peter Dalbhanjan, Solutions Architect, AWS

Transcript of An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Page 1: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

An overview of designing microservices based applications on

AWSPeter Dalbhanjan, Solutions Architect, AWS

Page 2: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

EvolutionfromMonolithstoMicroservices

ApproachesforBuildingMicroservicesApplicationsonAWS

CorePrinciplesofMicroservices

Demo

Page 3: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

AccountSupport

Support

ManagedServices

ProfessionalServices

PartnerEcosystem

Training&Certification

SolutionArchitects

AccountManagement

Security&PricingReports

TechnicalAcct.Management

MarketplaceBusiness

Applications

DevOpsTools

BusinessIntelligence

Security

Networking

Database&Storage

SaaSSubscriptions

OperatingSystems

Mobile

Build,Test,MonitorApps

PushNotifications

Build,Deploy,ManageAPIs

DeviceTesting

Identity

EnterpriseApplications

DocumentSharing

Email&Calendaring

HostedDesktops

ApplicationStreaming

Backup

GameDevelopment

3DGameEngine

Multi-playerBackends

Mgmt.Tools

Monitoring

Auditing

ServiceCatalog

ServerManagement

ConfigurationTracking

Optimization

ResourceTemplates

Automation

AnalyticsQueryLargeDataSets

Elasticsearch

BusinessAnalytics

Hadoop/Spark

Real-timeDataStreaming

OrchestrationWorkflows

ManagedSearch

ManagedETL

ArtificialIntelligence

Voice&TextChatbots

MachineLearning

Text-to-Speech

ImageAnalysis

IoT

RulesEngine

LocalComputeandSync

DeviceShadows

DeviceGateway

Registry

Hybrid Devices&EdgeSystems

DataIntegration

IntegratedNetworking

ResourceManagement

VMwareonAWS

IdentityFederation

Migration ApplicationDiscovery

ApplicationMigration

DatabaseMigration

ServerMigrationDataMigration

Infrastructure Regions AvailabilityZones

PointsofPresence

Compute Containers Event-drivenComputing

VirtualMachines SimpleServers AutoScaling BatchWeb

Applications

Storage ObjectStorage Archive BlockStorage ManagedFileStorage

Exabyte-scaleDataTransport

Database MariaDB DataWarehousing NoSQLAurora MySQL Oracle SQLServerPostgreSQL

ApplicationServices Transcoding StepFunctions Messaging

Security CertificateManagement

WebApp.Firewall

Identity&Access

KeyStorage&Management

DDoSProtection

ApplicationAnalysis

ActiveDirectory

DevTools

PrivateGitRepositories

ContinuousDelivery

Build,Test,andDebug

Deployment

Networking IsolatedResources

DedicatedConnections LoadBalancing ScalableDNSGlobalCDN

TheAWSPlatform

Page 4: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

*Asof1March2017

2010

61

1,017

159

2012 2014 2016

516

Page 5: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

“The Monolith”

Page 6: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Challenges with monolithic software

LongBuild/Test/ReleaseCycles(whobrokethebuild?)

Operationsisanightmare(moduleXisfailing,who’stheowner?)

Difficulttoscale

Newreleasestakemonths

Longtimetoaddnewfeatures

Architectureishardtomaintainandevolve

Lackofinnovation

Frustratedcustomers

Lackofagility

Page 7: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Challenges with monolithic software

LongBuild/Test/ReleaseCycles(whobrokethebuild?)

Operationsisanightmare(moduleXisfailing,who’stheowner?)

Difficulttoscale

Newreleasestakemonths

Longtimetoaddnewfeatures

Architectureishardtomaintainandevolve

Lackofinnovation

Frustratedcustomers

Lackofagility

Page 8: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Challenges with monolithic software

LongBuild/Test/ReleaseCycles(whobrokethebuild?)

Operationsisanightmare(moduleXisfailing,who’stheowner?)

Difficulttoscale

Newreleasestakemonths

Longtimetoaddnewfeatures

Architectureishardtomaintainandevolve

Lackofinnovation

Frustratedcustomers

Lackofagility

Page 9: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

“20080219BonMorningDSC_0022B”bySunphol Sorakul .Noalterationsotherthancropping.https://www.flickr.com/photos/83424882@N00/3483881705/ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 10: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Monolith development lifecycle

releasetestbuild

deliverypipeline

app(akathe“monolith”)developers

PhotobySageRoss.Noalterationsotherthancropping.https://www.flickr.com/photos/ragesoss/2931770125/ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 11: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

“IMG_1760”byRobertCouse-Baker.Noalterationsotherthancropping.https://www.flickr.com/photos/29233640@N07/14859431605/ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 12: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks
Page 13: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks
Page 14: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

“service-orientedarchitecturecomposed ofloosely coupled elementsthat havebounded contexts”

AdrianCockcroft(VP,CloudArchitectureStrategyatAWS)

Page 15: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Servicescommunicatewitheachotheroverthenetwork

“service-orientedarchitecturecomposed ofloosely coupled elementsthat havebounded contexts”

AdrianCockcroft(VP,CloudArchitectureStrategyatAWS)

Page 16: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

“service-orientedarchitecturecomposed ofloosely coupled elementsthat havebounded contexts”

AdrianCockcroft(VP,CloudArchitectureStrategyatAWS)

You canupdatetheservicesindependently;updatingoneservicedoesn’trequirechanginganyotherservices.

Page 17: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

“service-orientedarchitecturecomposed ofloosely coupled elementsthat havebounded contexts”

AdrianCockcroft(VP,CloudArchitectureStrategyatAWS)

Self-contained;youcanupdatethecodewithoutknowinganythingabouttheinternalsofothermicroservices

Page 18: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

“Do one thing, and do it well”

“SwissArmy”bybyJimPennucci.Noalterationsotherthancropping.https://www.flickr.com/photos/pennuja/5363518281/ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 19: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

“Tools”byTonyWalmsley:Noalterationsotherthancropping.https://www.flickr.com/photos/twalmsley/6825340663/ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

“Do one thing, and do it well”

Page 20: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Anatomy of a Micro-service

Page 21: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

DataStore(eg,RDS,DynamoDB

ElastiCache,ElasticSearch)

Anatomy of a Micro-service

Page 22: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Application/Logic(code,libraries,etc)

Anatomy of a Micro-service

DataStore(eg,RDS,DynamoDB

ElastiCache,ElasticSearch)

Page 23: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Application/Logic(code,libraries,etc)

Anatomy of a Micro-service

DataStore(eg,RDS,DynamoDB

ElastiCache,ElasticSearch)

PublicAPIPOST/micro-serviceGET/micro-service

Page 24: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

AvoidSoftwareCoupling

Page 25: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Driversmicro-service

Paymentsmicro-service Location

micro-service

Orderingmicro-service

Restaurantmicro-service

Ecosystem of microservices

Page 26: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks
Page 27: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks
Page 28: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

= 50 million deployments a year

Thousands of teams× Microservice architecture

× Continuousdelivery

× Multipleenvironments

(5708 per hour, or every 0.63 second)

Page 29: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks
Page 30: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks
Page 31: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Driversmicro-service

Paymentsmicro-service Location

micro-service

Orderingmicro-service

Restaurantmicro-service

Typical microservices application

Page 32: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

Approach#1EC2

Page 33: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

EC2

Page 34: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

EC2

Page 35: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

EC2EC2 EC2 EC2

Page 36: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

EC2EC2 EC2 EC2

ElasticLoadBalancer

Page 37: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

EC2EC2 EC2 EC2

ElasticLoadBalancer

AWSElasticBeanstalk

Page 38: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Elastic Beanstalk vs. DIY

Yourcode

HTTPserver

Applicationserver

Languageinterpreter

Operatingsystem

Host

ElasticBeanstalkconfigureseachEC2instanceinyourenvironmentwiththecomponentsnecessarytorunapplicationsfortheselectedplatform.Nomoreworryingaboutloggingintoinstancestoinstallandconfigureyourapplicationstack.

Focusonbuildingyourapplication

Providedbyyou

ProvidedandmanagedbyElasticBeanstalk

On-instanceconfiguration

Page 39: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

Approach#2ContainersUsingECS

Page 40: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

AmazonEC2Container Service(ECS)

istheclustermanagementsystemtorunyourDockercontainers

Page 41: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Cluster Management Made Easy• Nothing to run

• Complete state

• Control and monitoring

• Scale

UseAmazonEC2ContainerServiceforcontainerworkloads

AmazonEC2ContainerService(ECS)

Page 42: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Flexible Scheduling• Applications

• Batch jobs

• Multiple schedulers

UseAmazonEC2ContainerServiceforcontainerworkloads

AmazonEC2ContainerService(ECS)

Page 43: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Designed for Use with Other AWS Services• Elastic Load Balancing• Amazon Elastic Block Store• Amazon Virtual Private Cloud• AWS Identity and Access Management• AWS CloudTrail

UseAmazonEC2ContainerServiceforcontainerworkloads

AmazonEC2ContainerService(ECS)

Page 44: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

EC2EC2 EC2 EC2

ElasticLoadBalancer

Page 45: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

EC2EC2 EC2 EC2

ElasticLoadBalancer

Page 46: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

EC2EC2 EC2 EC2

ElasticLoadBalancer

AmazonEC2ContainerService(ECS)tomanagecontainers

Page 47: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceDesign

Approach#3APIGateway+Lambda

Page 48: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

AWSLambdaletsyouruncode

withoutmanagingservers

Page 49: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Lambdaautomatically

scales

Uploadyourcode(Java,JavaScript,

Python)

Payforonlythecomputetime

youuse(sub-secondmetering)

SetupyourcodetotriggerfromotherAWSservices,webservicecalls,orappactivity

Page 50: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

AWSAPIGatewayistheeasiestwaytodeploymicro-services

Page 51: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

CreateaunifiedAPIfrontendfor

multiplemicro-services

…aswellasmonitoring,

logging,rollbacks,clientSDK

generation…

Authenticateandauthorizerequests

HandlesDDoSprotectionandAPIthrottling

Page 52: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle1

Micro-servicesonlyrelyoneachother’spublicAPI

“Contracts”byNobMouse.Noalterationsotherthancropping.https://www.flickr.com/photos/nobmouse/4052848608/

ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 53: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceA Micro-serviceB

publicAPI publicAPI

Principle1: Microservicesonlyrelyoneachother’spublicAPI

DynamoDB

Page 54: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceA Micro-serviceB

publicAPI publicAPI

Principle1: Microservicesonlyrelyoneachother’spublicAPI(HideYourData)

DynamoDB

Page 55: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceA Micro-serviceB

publicAPI publicAPI

Principle1: Microservicesonlyrelyoneachother’spublicAPI(HideYourData)

Nope!

DynamoDB

Page 56: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceA Micro-serviceB

publicAPI publicAPI

Principle1: Microservicesonlyrelyoneachother’spublicAPI(HideYourData)

DynamoDB

Page 57: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceA

publicAPI

Principle1: Microservicesonlyrelyoneachother’spublicAPI(EvolveAPIinbackward-compatibleway…and

document!)

storeRestaurant (id,name,cuisine)Version1.0.0

Page 58: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceA

publicAPI

Principle1: Microservicesonlyrelyoneachother’spublicAPI(EvolveAPIinbackward-compatibleway…and

document!)

storeRestaurant (id,name,cuisine)Version1.0.0

storeRestaurant (id,name,cuisine)storeRestaurant (id,name,arbitrary_metadata)addReview (restaurantId,rating,comments)

Version1.1.0

Page 59: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Micro-serviceA

publicAPI

Principle1: Microservicesonlyrelyoneachother’spublicAPI(EvolveAPIinbackward-compatibleway…and

document!)

storeRestaurant (id,name,cuisine)Version1.0.0

storeRestaurant (id,name,cuisine)storeRestaurant (id,name,arbitrary_metadata)addReview (restaurantId,rating,comments)

Version1.1.0

storeRestaurant (id,name,arbitrary_metadata)addReview (restaurantId,rating,comments)

Version2.0.0

Page 60: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle2

Usetherighttoolforthejob

“Tools#2”byJuanPabloOlmo.Noalterationsotherthancropping.https://www.flickr.com/photos/juanpol/1562101472/

ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 61: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle2:Usetherighttoolforthejob(Embracepolyglotpersistence)

Micro-serviceA Micro-serviceB

publicAPI publicAPI

DynamoDB

Page 62: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle2:Usetherighttoolforthejob(Embracepolyglotpersistence)

Micro-serviceA Micro-serviceB

publicAPI publicAPI

DynamoDB

AmazonElasticsearchService

Page 63: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle2:Usetherighttoolforthejob(Embracepolyglotpersistence)

Micro-serviceA Micro-serviceB

publicAPI publicAPIAmazonElasticsearchService

RDSAurora

Page 64: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle2:Usetherighttoolforthejob(Embracepolyglotprogrammingframeworks)

Micro-serviceA Micro-serviceB

publicAPI publicAPIAmazonElasticsearchService

RDSAurora

Page 65: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle2:Usetherighttoolforthejob(Embracepolyglotprogrammingframeworks)

Micro-serviceA Micro-serviceB

publicAPI publicAPIAmazonElasticsearchService

RDSAurora

Page 66: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle3

SecureYourServices

“security”byDaveBleasdale.Noalterationsotherthancropping.https://www.flickr.com/photos/sidelong/3878741556/

ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 67: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle 3: Secure Your Services• Defense-in-depth

• Networklevel(e.g.VPC,SecurityGroups,TLS)• Server/container-level• App-level• IAMpolicies• IAMrolesonECStasks• CloudTrail logs

• Authentication&Authorization• Client-to-service,aswellasservice-to-service• IAM-basedAuthentication

• Secretsmanagement• ParameterStore• S3bucketpolicies+KMS+IAM• Open-sourcetools(e.g.Vault,Keywhiz)

AmazonEC2ContainerService(ECS)

Page 68: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle 3: Secure Your Services• Defense-in-depth

• Networklevel(e.g.VPC,SecurityGroups,TLS)• Server/container-level• App-level• IAMpolicies

• Gateway (“Frontdoor”)

• APIThrottling• Stage-levelandMethod-levelthrottling

• Authentication&Authorization• Client-to-service,aswellasservice-to-service• AWSCognito:userpools,federatedidentities• APIGateway:customLambdaauthorizers• IAM-basedAuthentication• Token-basedauth (JWTtokens,OAuth 2.0)

• Secretsmanagement• S3bucketpolicies+KMS+IAM• Open-sourcetools(e.g.Vault,Keywhiz)

APIGateway

Page 69: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle4

Beagoodcitizenwithintheecosystem

“LamingtonNationalPark,rainforest”byJussarian.Noalterationsotherthancropping.https://www.flickr.com/photos/kerr_at_large/87771074/

ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 70: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

HeySally,weneedtocallyourmicro-servicetofetch

restaurantsdetails.

SurePaul.WhichAPIsyouneedtocall?OnceIknow

betteryourusecasesI’llgiveyoupermissiontoregisteryourserviceasaclienton

ourservice’sdirectoryentry.

Micro-serviceA Micro-serviceB

publicAPI publicAPI

Principle 4: Be a good citizen within the ecosystem

Page 71: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle 4: Be a good citizen within the ecosystem(Have clear SLAs)

RestaurantMicro-service

15TPS100TPS5TPS20TPS

Beforeweletyoucallourmicro-serviceweneedtounderstand

yourusecase,expectedload(TPS)andaccepted

latency

Page 72: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

…andmany,manyothers!

Distributedmonitoringandtracing• “IstheservicemeetingitsSLA?”• “Whichserviceswereinvolvedinarequest?”• “Howdiddownstreamdependenciesperform?”

Sharedmetrics• e.g.servicedependency,request/responsetime

Distributedtracing• AWSX-Ray• 3rd party:Zipkin,OpenTracing

User-experiencemetrics• Statuscodes,latency,errorcounts,timetofirstbyte

Principle4:Beagoodcitizenwithintheecosystem(Distributedmonitoring,loggingandtracing)

Page 73: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

AWSX-RayDistributedtracingservicethat

enablesdeveloperstoanalyzethebehavioroftheirapplications

Page 74: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

AWSX-Raytracesrequestsmadetoyourapplication

X-Ray service

X-Raycombinesthedata

gatheredfromeachserviceintosingularunitscalled

traces

Viewtheservicemaptosee

tracedatasuchaslatencies,HTTPstatuses,andmetadataforeachservice

Drillintotheserviceshowing

unusualbehaviorto

identifytherootissue

X-Raycollectsdataabouttherequestfromeachofthe

underlyingapplicationsservicesitpassesthrough

Page 75: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle5

Morethanjusttechnologytransformation

“rowingontheriverinBedford”byMatthewHunt.Noalterationsotherthancropping.https://www.flickr.com/photos/mattphotos/19189529/

ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 76: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

“Anyorganizationthatdesignsasystemwillinevitablyproduceadesignwhosestructureisacopyoftheorganization’scommunicationstructure.”

MelvinE.Conway,1967

Conway’sLaw

Page 77: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Silo’d functional teams à silo’d application architectures

ImagefromMartinFowler’sarticleonmicroservices,athttp://martinfowler.com/articles/microservices.html

Noalterationsotherthancropping.Permissiontoreproduce:http://martinfowler.com/faq.html

Page 78: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Cross functional teams à self-contained services

ImagefromMartinFowler’sarticleonmicroservices,athttp://martinfowler.com/articles/microservices.html

Noalterationsotherthancropping.Permissiontoreproduce:http://martinfowler.com/faq.html

Page 79: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Fullownership

Fullaccountability

Alignedincentives

“DevOps”

Non-pizzaimagefromMartinFowler’sarticleonmicroservices,athttp://martinfowler.com/articles/microservices.html

Noalterationsotherthancropping.Permissiontoreproduce:http://martinfowler.com/faq.html

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

Page 80: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle6

AutomateEverything

“Robot”byRobinZebrowski.Noalterationsotherthancropping.https://www.flickr.com/photos/firepile/438134733/

ImageusedwithpermissionsunderCreativeCommonslicense2.0,AttributionGenericLicense(https://creativecommons.org/licenses/by/2.0/)

Page 81: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

releasetestbuild

Focused agile teams

2-pizzateam deliverypipeline service

Page 82: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

releasetestbuild

releasetestbuild

Focused agile teams

2-pizzateam deliverypipeline service

Page 83: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

releasetestbuild

releasetestbuild

Focused agile teams

2-pizzateam deliverypipeline service

releasetestbuild

Page 84: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

releasetestbuild

releasetestbuild

Focused agile teams

2-pizzateam deliverypipeline service

releasetestbuild

releasetestbuild

Page 85: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

releasetestbuild

releasetestbuild

Focused agile teams

2-pizzateam deliverypipeline service

releasetestbuild

releasetestbuild

releasetestbuild

Page 86: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

releasetestbuild

releasetestbuild

Focused agile teams

2-pizzateam deliverypipeline service

releasetestbuild

releasetestbuild

releasetestbuild

releasetestbuild

Page 87: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principle 6: Automate everything

AWSCodeCommit AWSCodePipeline AWSCodeDeploy

ELBAutoScalingEC2 LambdaECS

DynamoDBRDS ElastiCache

SQS SWF SESSNS

APIGatewayCloudWatch CloudTrail

KinesisElastic

Beanstalk

Page 88: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

It’s a journey…

Expectchallengesalongtheway…

• Understandingofbusinessdomains• EventualConsistency• Servicediscovery• Lotsofmovingpartsrequiresincreased

coordination• Complexityoftesting/deploying/

operatingadistributedsystem• Culturaltransformation

Page 89: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Principles of Microservices

1.RelyonlyonthepublicAPI� Hideyourdata� DocumentyourAPIs� Defineaversioningstrategy

2.Usetherighttoolforthejob� Containerjourney?(useECS)� Polyglotpersistence(datalayer)� Polyglotframeworks(applayer)

3.Secureyourservices� Defense-in-depth� Authentication/authorization

6.Automateeverything� AdoptDevOps

4.Beagoodcitizenwithintheecosystem� HaveSLAs� Distributedmonitoring,logging,tracing

5.Morethanjusttechnologytransformation� Embraceorganizationalchange� Favorsmallfocuseddev teams

Page 90: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Benefits of microservices

RapidBuild/Test/ReleaseCycles

Clearownershipandaccountability

Easiertoscaleeachindividualmicro-service

Page 91: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Benefits of microservices

RapidBuild/Test/ReleaseCycles

Clearownershipandaccountability

Easiertoscaleeachindividualmicro-service

Newreleasestakeminutes

Shorttimetoaddnewfeatures

Easiertomaintainandevolvesystem

Page 92: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Benefits of microservices

RapidBuild/Test/ReleaseCycles

Clearownershipandaccountability

Easiertoscaleeachindividualmicro-service

Newreleasestakeminutes

Shorttimetoaddnewfeatures

Easiertomaintainandevolvesystem

Fasterinnovation

Delightedcustomers

Increasedagility

Page 93: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

AdditionalAWSresources:• MicroservicesonAWSwhitepaper:

https://d0.awsstatic.com/whitepapers/microservices-on-aws.pdf

• ServerlessWebapp - ReferenceArchitecture:https://github.com/awslabs/lambda-refarch-webapp

• MicroserviceswithECS:https://aws.amazon.com/blogs/compute/using-amazon-api-gateway-with-microservices-deployed-on-amazon-ecs/

• MicroserviceswithouttheServershttps://aws.amazon.com/blogs/compute/microservices-without-the-servers

Popularopen-sourcetools:• Serverless – http://serverless.com• Apex – http://apex.run/

https://aws.amazon.com/devops/

Additional resources

Page 94: An Overview of Designing Microservices Based Applications on AWS - March 2017 AWS Online Tech Talks

Thank you!Peter Dalbhanjan

[email protected]