More Related Content Similar to From Monolithic to Microservices (20) More from Amazon Web Services (20) From Monolithic to Microservices 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
From Monolith to Microservices
Daniele Stroppa, Solutions Architect, AWS
Ville Takanen, VP Engineering, Digital Goodie
September 18th, 2018
2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
2009
48
280
722
82
2011 2013 2015
3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
“The Monolith”
4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Challenges with monolithic software
Long
Build/Test/Release
Cycles
(who broke the build?)
Operations
is a nightmare
(module X is failing,
who’s the owner?)
Difficult to
scale
New releases
take months
Long time to add
new features
Architecture is hard
to maintain and
evolve
Lack of innovation
Frustrated customers
Lack of agility
5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential“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/)
6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Monolith development lifecycle
releasetestbuild
Delivery pipeline
App
(aka the“monolith”)Developers
7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Too much software coupling
Shared libraries
Shared data
8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
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/)
9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
“service-oriented
architecture
composed of
loosely coupled
elements
that have
bounded contexts”
Adrian Cockcroft (former Cloud Architect at Netflix and
Technology Fellow at Battery Ventures, now VP Cloud
Architecture Strategy at AWS)
11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
“service-oriented
architecture
composed of
loosely coupled
elements
that have
bounded contexts”
Services communicate
with each other over the
network
Adrian Cockcroft (former Cloud Architect at Netflix and
Technology Fellow at Battery Ventures, now VP Cloud
Architecture Strategy at AWS)
12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
“service-oriented
architecture
composed of
loosely coupled
elements
that have
bounded contexts”
You can update the
services independently;
updating one service
doesn’t require changing
any other services.
Adrian Cockcroft (former Cloud Architect at Netflix and
Technology Fellow at Battery Ventures, now VP Cloud
Architecture Strategy at AWS)
13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
“service-oriented
architecture
composed of
loosely coupled
elements
that have
bounded contexts” Self-contained; you can
update the code without
knowing anything about
the internals of other
microservices
Adrian Cockcroft (former Cloud Architect at Netflix and
Technology Fellow at Battery Ventures, now VP Cloud
Architecture Strategy at AWS)
14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
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
15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Benefits of microservices
Rapid
Build/Test/Release
Cycles
Clear ownership and
accountability
Easier to scale
each individual
micro-service
New releases
take minutes
Short time to add
new features
Easier to
maintain and
evolve system
Faster innovation
Delighted customers
Increased agility
16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
= 50 million deployments a year
Thousands of teams
× Microservice architecture
× Continuous delivery
× Multiple environments
(5708 per hour, or every 0.63 second)
18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Challenges of Microservices
1. Distributed System
Ÿ Performance
Ÿ Reliability
2. Eventual Consistency
Ÿ Decentralized data management
3. Operational Complexity
Ÿ Deployments
Ÿ Monitoring
19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
For less-complex systems,
the extra baggage required to manage
microservices reduces productivity
As complexity kicks in,
Productivity starts failing rapidly
the decreased coupling
of microservices
reduces the attenuation
of productivity
https://www.martinfowler.com/microservices/#when
20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Strangling the Monolith
Database
StoreFront
UI
Browser
Cart
Service
Account
Service
User
Service
21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
No New Feature on the Monolith
Database
StoreFront
UI
Browser
New
Microservice
New DB
Cart
Service
Account
Service
User
Service
22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Anti-Corruption Layer for Integration
ACL
Database
StoreFront
UI
Browser
New
Microservice
New DB
Cart
Service
Account
Service
User
Service
23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Cart
Service
Account
Service
Start with a Simple Existing Service…
Database
StoreFront
UI
Browser
User
Microservice
User DB
New
Microservice
New DB
User
Service
Client
24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Account
Service
User
Service
Client
…Move on to More Complicated Services
Cart
Microservice
Database
StoreFront
UI
Browser
User
Microservice
User DB
New
Microservice
New DB
ACL
Cart DB
Cart
Service
25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
…Keep Walking and…
Cart
Microservice
Database
StoreFront
UI
Browser
User
Microservice
User DB
New
Microservice
New DB
Account
Microservice
Cart DB Account DB
Account
Service
User
Service
Client
ACL
Cart
Service
ACL
26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
…The Monolith is Eventually Gone
Cart
Microservice
StoreFront
UI
Browser
User
Microservice
User DB
New
Microservice
New DB
Account
Microservice
Cart DB Account DB
27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Microservices Architecture on AWS
CloudFront API
Gateway
Application
Load Balancer
ECS
EC2
Lambda ElastiCache
RDS
DynamoDB
CloudWatchS3
Static
content
28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Digital Goodie
From Monolith to Microservices
29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
It’s a journey…
Expect challenges along the way…
• Understanding of business domains
• Coordinating transactions across
multiple services
• Eventual Consistency
• Service discovery
• Lots of moving parts requires
increased coordination
• Complexity of testing / deploying /
operating a distributed system
• Cultural transformation
30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
Thank you!
stroppad@amazon.com