How to break apart a monolithic system safely without destroying your team
Moving from a monolith to microservices can be daunting. How do we choose the right bounded contexts? How small should services be? Which teams should get which services? And how do we keep things from falling apart?
By starting with the needs of the team, we can infer some useful heuristics for evolving from a monolithic architecture to a set of more loosely coupled services.
Matthew Skelton is co-founder of Skelton Thatcher Consulting / @matthewpskelton
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Teams and monoliths - Matthew Skelton - LondonCD 2016
1. How to break apart a
monolithic system safely
without destroying your team
Matthew Skelton, Skelton Thatcher Consulting
@matthewpskelton
LondonCD meetup: 11 Oct 2016
#londoncd
2. Today
Cognitive load for teams
‘Monolith’
Code Forensics
Team-first boundaries
Monolith-splitting recipe
20. Cognitive load for teams
• Driskell et al, 1999 ‘Does Stress Lead to a Loss of Team Perspective?’
Group Dynamics: Theory, Research, and Practice 3, no. 4 (1999): 291.
• Fan et al, 2010 ‘Learning HMM-Based Cognitive Load Models for
Supporting Human-Agent Teamwork’. Cognitive Systems Research 11,
no. 1 (2010): 108–119.
• Ilgen & Hollenbeck, 1993 ‘Effective Team Performance under Stress
and Normal Conditions: An Experimental Paradigm, Theory and Data
for Studying Team Decision Making in Hierarchical Teams with
Distributed Expertise’. DTIC Document, 1993.
• Johnston et al, 2002 ‘Application of Cognitive Load Theory to
Developing a Measure of Team Decision Efficiency’. DTIC Document,
2002.
21. “stress impacts team
performance … by narrowing
or weakening the team-level
perspective required for
effective team behavior.”
– Driskell et al, 1999
Group Dynamics: Theory, Research, and Practice 1999, Vol. 3, No. 4,291-302
23. “Don’t start with a monolith
when your goal is a
microservices architecture”
– Stefan Tilkov, innoQ
http://martinfowler.com/articles/dont-start-monolith.html
24. “Start monolithic and extract”
– Tammer Saleh, Pivotal
https://www.infoq.com/presentations/cloud-anti-patterns
28. Joined at
the DB
Difficult to change
separately (but not
impossible)
Risk is (probably)
elevated
Chris Collyer, http://www.stone-circles.org.uk/stone/pentreifan.htm
31. Dangers of splitting a
monolith
•Reduced domain consistency (UX,
Architecture, Data)
•Data duplication (unintentional)
•Additional operational complexity due to
distributed system and async messaging
•Degraded UX across the product
32. Splitting a
monolith
Reiner Flassig - CC BY-SA 2.0 de - Wikipedia
Choose the right
technique for splitting
Understand the nature
of the monolith
33.
34. ‘Fracture planes’ for code
•Business domain bounded context
•Regulatory compliance
•Change cadence
•Risk
•Performance isolation
•User personas
•Team location
47. Code repositories
Repo 1 Build Test Deploy Run
Repo 2 Build Test Deploy Run
Repo 3 Build Test Deploy Run
48. “You can use a monorepo only if
your organisation has published a
scientific paper on Computer
Science. Otherwise, use one repo
per separate deployable thing.”
– Matthew Skelton
LondonCD meetup group, 11 Oct 2016
49. Find natural or available
‘fracture planes’ for splitting
a monolith
(with the team in mind)
51. How to break apart a monolith
without destroying your team
1. Instrument the monolith – logging
2. Grok data flows and fault responses
3. Align teams to available segments
4. Split off segments one-by-one
57. use logging as a
channel/vector to
make distributed systems
more testable
use logging as a
channel/vector to
make distributed systems
more testable
69. Team needs / responsibilities /
capabilities come first
70.
71. How to break apart a monolith
without destroying your team
1. Instrument the monolith – logging
2. Grok data flows and fault responses
3. Align teams to available segments
4. Split off segments one-by-one
72. How to break apart a monolith
without destroying your team
1. Instrument the monolith – logging
2. Grok data flows and fault responses
3. Align teams to available segments
4. Split off segments one-by-one
* plus a few other things
75. Books & articles
• Working Effectively with Legacy Code, by Michael Feathers
• Building Microservices by Sam Newman
• ‘Managing Cognitive Load for Team Learning’ by Jo Pearce
http://12devsofxmas.co.uk/2015/12/day-3-managing-cognitive-
load-for-team-learning/
76. Training
• From Monolith to Microservices (online training) – Sam Newman,
author of Building Microservices
http://www.oreilly.com/live-training/from-monolith-to-
microservices.html
77. Talks & slides
• What is cognitive load theory and why should you care?, by Jo
Pearce - http://www.slideshare.net/JoPearce5/what-is-cognitive-
load-theory-5mins
• Building Microservices by Sam Newman
78. Research papers
• Driskell, James E., Eduardo Salas, and Joan Johnston. ‘Does Stress Lead to a Loss of Team
Perspective?’ Group Dynamics: Theory, Research, and Practice 3, no. 4 (1999): 291.
• Fan, Xiaocong, Po-Chun Chen, and John Yen. ‘Learning HMM-Based Cognitive Load Models
for Supporting Human-Agent Teamwork’. Cognitive Systems Research 11, no. 1 (2010):
108–119.
• Ilgen, Daniel R., and John R. Hollenbeck. ‘Effective Team Performance under Stress and
Normal Conditions: An Experimental Paradigm, Theory and Data for Studying Team Decision
Making in Hierarchical Teams with Distributed Expertise’. DTIC Document, 1993.
http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADA284683.
• Johnston, Joan H., Stephen M. Fiore, Carol Paris, and C. A. Smith. ‘Application of Cognitive
Load Theory to Developing a Measure of Team Decision Efficiency’. DTIC Document, 2002.
http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADA525820.