Microservice Architectures for Scalability, Agility...
Transcript of Microservice Architectures for Scalability, Agility...
Microservice Architectures for Scalability, Agility and Reliability in E-Commerce
Prof. Dr. Wilhelm (Willi) HasselbringSoftware Engineering Group, Kiel University, Germany
http://se.informatik.uni-kiel.de/Competence Cluster Software Systems Engineering
http://kosse-sh.de/
Guido SteinackerOtto GmbH & Co KG
Werner-Otto-Straße 1–7D-22179 Hamburg, Germany
https://dev.otto.de/
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 1
Context: otto.de
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 2http://www.ottogroup.com/de/presse/material.php
Web Shop until 2013
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 3
https://support.intershop.com/kb/index.php/Display/276B90
Scaling such Web Information Systems
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker
Source: [Abbott & Fisher 2015]
Approaches to Scalability on the database layer:• Big enterprise server• Database replication• Database sharding
4
However, you have to scale everything to scale anything!
Agenda
1. Context2. Microservice Architectures for Scalability3. Microservice Architectures for Agility4. Microservice Architectures for Reliability5. Scalable Development of Microservices6. Takeaways
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 5
Polyglot Persistence
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker
Page Assembly
Backend Integration
Prod
uct
Trac
king
Rec
omm
en-
datio
n
Ord
er
Sear
ch
Wide Column
Database
Full-TextDatabase
GraphDatabase
RelationalDatabase
Time Series
Database
6
[Hasselbring 2016]
Project Lhotse 2011-2013• In 2011, Otto started a complete re-implementation of
their ecommerce software from scratch.• The drivers for this decision were diverse, but had
mostly to do with non-functional requirements like scalability, performance and fault tolerance. – Regarding scalability, they were not only thinking about
technical scalability in terms of load or data. – They needed a solution that was scaling with respect to
the number of teams and/or developers working on the software at a given time.
– In addition to that, they planned to practice DevOps including continuous deployment, in order to deliver features quickly to the customer.
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 7
https://www.otto.de/unternehmen/de/newsroom/dossiers/lhotse.php
Modernization Strategy
• What they have found was in the first place a little bit unusual, but in the end highly successful:– Instead of setting up a single development team to create a new
platform for the shop, they were actively employing Conway’s Law by starting development with initially four separate teams with four loosely coupled applications (a.k.a. microservices):
• Product, being responsible for products and their presentation.• Order for shopping carts and the order process.• Promotion, serving product recommendations and promotions for assortments,
brands, and so on.• Search and Navigation for search and navigation in the shop.
• In the following years, they founded several more teams and systems.
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 8
Verticals at otto.de
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 9
Back
offic
e
Shop
page
s
Sear
ch &
Nav
igat
ion
Prod
uct
Prom
otio
n
Ord
er
Use
r
Afte
rSal
es
Auth
Insi
ghts
Link
Han
dler
Trac
king
Page Assembly Proxy
Backend Integration Proxy
Verticals and Microservices at otto.de
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 10
Page Assembly Proxy
Backend Integration Proxy
...
This architecture allows elasticity for horizontal scalability[van Hoorn et al. 2009, von Massow et al. 2011, Hasselbring 2016]
Agenda
1. Context2. Microservice Architectures for Scalability3. Microservice Architectures for Agility4. Microservice Architectures for Reliability5. Scalable Development of Microservices6. Takeaways
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 11
DevOps & Software Architecture
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker
“The deployment pipeline is the place where the architectural aspects and the process aspects of DevOps intersect.”
[Bas et al. 2015]
12
Scaling Delivery Pipelines at otto.deContinuous Deployment and DevOps
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 13
Goals:• Set up new pipelines quickly and automatically using a templating mechanism.• Being able to build pipelines just like the microservices from tested code
maintained in a Git repository.• Because most of the time, pipelines are simply waiting to be triggered, they aim
at a solution that does not waste hardware resources while not in use.Solution: LambdaCD (internal domain-specific language written in Clojure)
Life Deployments @ Otto.de
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 14
Agenda
1. Context2. Microservice Architectures for Scalability3. Microservice Architectures for Agility4. Microservice Architectures for Reliability5. Scalable Development of Microservices6. Takeaways
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 15
Deployment Pipeline with Quality Gates
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 16
[Breetzmann et al. 2014][Farley 2007]
Automated Quality AssuranceExample: Regression Benchmarking
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker
Integrated into Continuous Integration Setup[Waller et al. 2015]
Should include automated anomaly detection [Marwede et al. 2009, Ehlers et al. 2011]
17
https://build.se.informatik.uni-kiel.de/jenkins/job/kieker-nightly-release/plot/
Life Deployments & Incidents @ Otto.de
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 18
Agenda
1. Context2. Microservice Architectures for Scalability3. Microservice Architectures for Agility4. Microservice Architectures for Reliability5. Scalable Development of Microservices6. Takeaways
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 19
Conway’s Law“The basic thesis of this article is that organizations which design systems […] are constrained to produce designs which are copies of the communication structures of these organizations”
[Conway 1968]
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 20
If the organizational structure is decomposed vertically and according to the microservices structure into cross-functional feature teams, • scaling development capacities according to changing business
requirements is enabled.• The feature teams should be highly independent, having
members of all roles and skills that are required to build and maintain their microservice.
Decoupling teams as relevant as decoupling software modules
Component vs. Middleware Reuse
Example:https://github.com/otto-de/
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 21
Shared Component C
Component A Component B
Component A
Component BOpen Source Middleware
Microservice Architectures for Scalability, Agility and
Reliability
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 22
Scalability for both, runtime performance and development performance.
Reliability
Backup
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 23
Microservice Architecture Variations
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker
“Scalability is managed by each service individually and is included in its SLA in the form of a guaranteed response time given a particular load.”
[Bas et al. 2015, Chapter 4]
“The trade-off between many small components and a few large components must be considered in component and system design.”
[Hasselbring 2002a]
[Steinacker 2014][Bas et al. 2015]
24
[Kraus et al. 2013]
Back
offic
e
Shop
page
s
Sear
ch &
Nav
igat
ion
Prod
uct
Prom
otio
n
Ord
er
Use
r
Afte
rSal
es
Auth
Insi
ghts
Link
Han
dler
Trac
king
Page Assembly Proxy
Backend Integration Proxy
References[Abbott & Fisher 2015] M.L. Abbott, M.T. Fisher: The Art of Scalability. Addison-Wesley, 2nd Edition, 2015.[Bas et al. 2015] Len Bass, Ingo Weber, Liming Zhu: “DevOps: A Software Architect’s Perspective”, Addison-Wesley 2015.[Breetzmann et al. 2014] R Breetzmann, S. Kraus, C. Stamm: “Null Toleranz für Fehler: Wie wir auf otto.de die Qualität hoch halten“, OBJEKTspektrum
4/2014, 18-23.[Conway 1968] M.E. Conway: How do committees invent? Datamation, 14(4):28-31, April 1968.[Ehlers et al. 2011] J. Ehlers, A. van Hoorn, J. Waller, W. Hasselbring: Self-Adaptive Software System Monitoring for Performance Anomaly Localization. In:
8th IEEE/ACM International Conference on Autonomic Computing (ICAC 2011).[Farley 2007] D. Farley: “The Deployment Pipeline”. ThoughtWorks, Inc. https://continuousdelivery.com/, 2007.[Hasselbring 2000] W. Hasselbring: “Information System Integration” In: Communications of the ACM, 43(6): 32-36, June 2000.[Hasselbring 2002a] W. Hasselbring: “Component-Based Software Engineering” In: Handbook of Software Engineering and Knowledge Engineering. World
Scientific Publishing, Singapore, pp. 289-305, 2002.[Hasselbring 2002b] W. Hasselbring: “Web Data Integration for E-Commerce Applications,” IEEE Multimedia, vol. 9, no. 1, pp. 16–25, 2002.[Hasselbring 2006] W. Hasselbring: “Software-Architektur”. In: Informatik-Spektrum 29(1): 48-52, February 2006.[Hasselbring 2016] W. Hasselbring: “Microservices for scalability: Keynote talk abstract,” In: Proceedings of the 7th ACM/SPEC on International
Conference on Performance Engineering (ICPE 2016). ACM, 2016, pp. 133–134.[Kraus et al. 2013] S. Kraus, G. Steinacker, O. Wegner: “Teile und Herrsche – Kleine Systeme für große Architekturen“, OBJEKTspektrum 5/2013, 8-13.[Marwede et al. 2009] N. Marwede, M. Rohr, A. van Hoorn, W. Hasselbring: “Automatic Failure Diagnosis in Distributed Large-Scale Software Systems
based on Timing Behavior Anomaly Correlation“, In: 13th European Conference on Software Maintenance and Reengineering (CSMR 2009).[Steinacker 2014] G. Steinacker: Scaling with Microservices and Vertical Decomposition. http://dev.otto.de/2014/07/29/scaling-with-microservices-and-
vertical-decomposition/, 2014.[van Hoorn et al. 2009] A. van Hoorn, M. Rohr, I.A. Gul, W. Hasselbring: “An Adaptation Framework Enabling Resource-efficient Operation of Software
Systems” In: 2nd Warm Up Workshop for ACM/IEEE ICSE 2010 (WUP 2009) . [van Hoorn et al. 2012] A. van Hoorn, J. Waller, W. Hasselbring: “Kieker: A Framework for Application Performance Monitoring and Dynamic Software
Analysis”, In: 3rd joint ACM/SPEC International Conference on Performance Engineering (ICPE 2012).[von Massow et al. 2011] R. von Massow, A. van Hoorn, W. Hasselbring: “Performance simulation of runtime reconfigurable component-based software
architectures” In: Proceedings ECSA 2011, 2011, pp. 43–58.[Waller et al. 2015] Jan Waller, Nils Ehmke, Wilhelm Hasselbring: “Including Performance Benchmarks into Continuous Integration to Enable DevOps“, In:
ACM SIGSOFT Software Engineering Notes, 40(2).
ICSA, 05.04.2017 W. Hasselbring & G. Steinacker 25