SlideShare a Scribd company logo
Refactoring Into Microservices
Breaking the Monolith
Given by Derek C. Ashmore
November 8, 2016
©2016 Derek C. Ashmore, All Rights Reserved 1
Who am I?
• Professional Geek
since 1987
• Java/J2EE/Java EE
since 1999
• Roles include:
• Developer
• Architect
• Project Manager
• Specialties
• Refactoring
• Performance
Tuning
©2016 Derek C. Ashmore, All Rights Reserved 2
Discussion Resources
• This slide deck
– http://www.slideshare.net/derekashmore
• This resource page
– http://breakthemonolith.guru/resources.html
• Slide deck has hyper-links!
– Don’t bother writing down URLs
©2016 Derek C. Ashmore, All Rights Reserved 3
Agenda
Microservices
and
Monoliths
Tactics to
Refactor
Common
Problems
Summary /
Q&A
©2016 Derek C. Ashmore, All Rights Reserved 4
What is a Monolith?
• Monolith
– Single deployable application
that’s gotten too large and
complex to maintain
• Symptoms
– Hard to change
• QA test cycles are long
• Change causes unintended
consequences
– Hard to onboard new
developers
– Married to your technical
stack
– Harder to diagnose
bottlenecks and memory
issues
©2016 Derek C. Ashmore, All Rights Reserved 5
What’s the cure?
• Smaller services rather than one very
large application
• Refactoring easier said than done
– Hard to do safely
– It’s a hard design problem
• Existing team members often too close
to the problem
– Developers can’t resist common business
binaries
• Reduces code duplication  Increases
coupling
• Coupling is a greater evil than code
duplication!
• Why not a complete rewrite?
– No benefit until the end
– Nobody knows *all* the business
requirements!
– Risk of negative impact to the business
during the transition is high
• Microservices are the other side of
the spectrum
©2016 Derek C. Ashmore, All Rights Reserved 6
Why Break a Monolith?
• Increases Speed to Market
– Monolith is slow to change
• Long QA cycles
– Quicker response to business
competition
• New features added quickly
• Makes continuous delivery possible
– Microservices + Continuous
Delivery
• Lowers Business Risk
– Reduces the defect rate
– Reduces Downtime
– Fixes are faster too
7
• Amazon deploys once a
second
• Netflix deploys over
5,500 times a day
Source: newrelic.com
What are Microservices?
• No concrete definition
• Common microservice traits
– Single functional purpose
• Most/all changes only impact one service
• Not dependent on execution context
– “loosely coupled”
– Independent process/jvm
– Stateless
– Standard Interface (typically Web Service/REST)
– Analogy: Stereo system, Linux utilities
©2016 Derek C. Ashmore, All Rights Reserved 8
Microservices Application Architecture
• Separate Databases
• Eventual
Consistency
• More network
activity
©2016 Derek C. Ashmore, All Rights Reserved 9
Faster Delivery to Market
• High Deployment Rates
– Amazon = 23,000/day
– Netflix = 5,500 / day
• Business Benefits
– New features delivered
more quickly
– Quicker reaction to
competitors actions
• Combined with
– Continuous Delivery
– DevOps
©2016 Derek C. Ashmore, All Rights Reserved 10
Microservice Reuse
©2016 Derek C. Ashmore, All Rights Reserved 11
No Lock-in
• Platform agnostic
• Fewer dependency
conflicts
• Still have cross-cutting
concerns
• “Toll” for first app
• Still have support
concerns
• Others need to be
able to support your
work
12©2016 Derek C. Ashmore, All Rights Reserved
Better Availability and Resiliency
• Fault tolerance built in
– Reaction to failure part of
the design
– Failures designed to be
localized
• Requirements for
Resiliency
– Identify non-essential
features
• Gogo and Twitter
– Context Independent
Design
©2016 Derek C. Ashmore, All Rights Reserved 13
Easier Management /
Higher Throughput
• Easier to manage large
numbers of developers
– Concentrate on
intelligently drawing
service boundaries
– Manage/enforce service
contracts
• Each service team works
independently
• Team independence leads
to higher development
throughput
©2016 Derek C. Ashmore, All Rights Reserved 14
Agenda
Microservices
and
Monoliths
Tactics to
Refactor
Common
Problems
Summary /
Q&A
©2016 Derek C. Ashmore, All Rights Reserved 15
Microservices / Monolith Mixture
• 80 / 20 Rule Applies
• Smaller, less complex, services are easier to support
• Few companies are 100% Microservices
• Traditional architectures do have a place
• They are easier to create and manage while they are small
• Some never grow large enough to refactor
©2016 Derek C. Ashmore, All Rights Reserved 16
Do NOT attempt a complete rewrite
• It’s too big and complex
– Usually no documentation of all implemented business rules
• Not written down
• Nobody has it in their head
– Will negatively impact your business
• The new won’t ‘identically’ match behavior
– Business won’t benefit until the very end
• It’s a large project  Compelte rewrite will take a long time to realize
– Often has no safeguards beyond manual testing
– It’s a *very* big problem to handle all at once.
• Refactor iteratively
– Yes; this will take a longer time
– It’s safer
– It gives staff a chance to learn how to manage microservice libraries
before they have too many to manage manually
– It gives staff a chance to address non-functionals while not also
being burdened with a complete redesign/rewrite
©2016 Derek C. Ashmore, All Rights Reserved 17
Stick with the same technical stack for
the refactoring
• Corollary: Do not rewrite and refactor at the
same time.
–Rewrite after automated contract testing is in
place
• New technical stacks have learning curves
–Refactoring is hard enough
©2016 Derek C. Ashmore, All Rights Reserved 18
Preperation Steps
• Establish a base automated test harness for the
application
–At an integration level, not unit test level
–We want a chance of catching defects refactoring
introduces
–This will *not* be 100% comprehensive
• The monolith is too complex for that
• 80 / 20 rule applies
• Establish Continuous Integration if it doesn’t
exist
–Jenkins CI Builds and Tests
–Run Frequently (at least nightly)
–Fix it immediately when somebody breaks the build
©2016 Derek C. Ashmore, All Rights Reserved 19
Types of Monoliths
• Monoliths are not created equal
• Types of Monoliths
– Feature-Bloated Web Application
– Data Store Strangle
– Over-engineered Tarball
– Distributed Monolith
• Tactics differ per Monolith type
©2016 Derek C. Ashmore, All Rights Reserved 20
Feature-Bloated App
• Feature set to large to manage
– Usually a web app, but could be “Thick”
or “Batch” as well
• Symptoms
– Unintended consequence problem
– Long regression test cycles
• Causes
– New Feature Additions
• Add complexity
• Often not envisioned in original design
– Tacked on
– Developer assumptions
• Streamlines code initially
• Are not documented
• Create landmines for new feature
additions
• Removing unused features
– Never happens
– Benefit not clear to the business
– No stats on used vs unused
©2016 Derek C. Ashmore, All Rights Reserved 21
Tactics: Feature-Bloated Web App
• Chop off it’s head!
– Separate the User Interface
• Separation of concerns
• Leaves consolidated UI
• Forces Monolith to have
REST interface
– Easier to test more
completely
• Makes further refactoring
safer
• Forces you to identify
REST resources within the
monolith
©2016 Derek C. Ashmore, All Rights Reserved 22
Separated UI
• Monolith now has a
REST resource interface
– Easier for automated
testing
• Safety in further
refactoring
– Functionality categorized
into logical units
• Easier to identify sections
to separate out
• Cosmetic changes occur
on their own schedule
©2016 Derek C. Ashmore, All Rights Reserved 23
Factor out additional services
• Factor out by related
REST resources
– Separate underlying
database too
• Prioritize resources by
– Code Change Velocity
– Code Complexity
– Enhancement needs
©2016 Derek C. Ashmore, All Rights Reserved 24
Data Store Strangle
• Data Storage is the Monolith’s
Achilles Heel
• Symptoms
– No flexibility in data access
• Larger memory footprint
– Lots of replicated data
– Complex data access code
– Storage design hardest part of adding
new features
• Causes
– Bad Data Storage Design
• Usually process oriented
– Replicated Data
– Coupled with business process
• Causes code complexity
– Amplifies technical debt
• Storage refactoring difficult
– Never happens
– Benefits not clear to the business
– Carries more risk than refactoring code
©2016 Derek C. Ashmore, All Rights Reserved 25
Tactics: Data Store Strangle
• Tourniquet Strategy
– Separate storage reads/writes into separate
service
• Separate into service
• All access uses central service
• Spin off a read-only copy asynchronously in
legacy format for reporting if needed
– Wrap automated testing around the
tourniquet service
– Refactor the underlying database
incrementally
• Refactoring databases is a difficult topic
– Book: Refactoring Databases: Evolutionary
Database Design
• Introduce new API to simplify access
– Reduces caller complexity
– More targeted and flexible access
– Usually possible only after refactoring
• Deprecate Tourniquet API
©2016 Derek C. Ashmore, All Rights Reserved 26
Over-engineered Tarball
• Internal component obstacle
– Component with unnecessary
complexity
• Symptoms
– Nobody understands it
– Everyone fears changing it
– Common impediment for new
feature enhancements
• Causes
– Bored, talented developers
• Good intentioned
• Manufacturing interesting puzzles
• Real problem when the developer
leaves
– Nobody else can change it safely
– Creates complexity in code
surrounding it
©2016 Derek C. Ashmore, All Rights Reserved 27
Tactics: Over-engineered Tarball
• Tourniquet Strategy
– Separate tarball into separate
service
• Separate into service
• All access uses central service
• Also separate out data storage
– Wrap automated testing
around the tourniquet service
– Refactor the tarball
incrementally or completely
replace
• Automated tests are safety net
©2016 Derek C. Ashmore, All Rights Reserved 28
Distributed Monolith
• Related services that are tightly coupled /
bound together
• Symptoms
– Always deploy a group of services together
• Independent deployments rarely happen
– New features require changes to the same
service group
• Causes
– High coupling between services
• Short-term developer convenience
• Inappropriate Delegation
– Micro-management for indirect service
calls
– Pass-through arguments to one service to
indirectly control behavior of a subsequent
service
• Shared Business Code Binaries
– Changes in binaries force redeployments
• Higher management overhead without
benefits from smaller independent services
©2016 Derek C. Ashmore, All Rights Reserved 29
Tactics: Distributed Monolith
• Solving shared business code problem
– Factor into separate service(s)
• Deployed once and commonly called
• Don’t deploy as library
– Reduces forced deployments
– Performance mitigations
• Expiring Cache
• Make asynchronous
– Coupling worse evil than Code Duplication
©2016 Derek C. Ashmore, All Rights Reserved 30
Tactics: Distributed Monolith (con’t)
• Solving the
Inappropriate
Delegation problem
– Eliminate the middle-
man
©2016 Derek C. Ashmore, All Rights Reserved 31
Agenda
Microservices
and
Monoliths
Tactics to
Refactor
Common
Problems
Summary /
Q&A
©2016 Derek C. Ashmore, All Rights Reserved 32
Common code between services?
• Yes, but….
– Version it
• Services make decision as to when to upgrade
– Changes to common code can’t require the
deployment of multiple services
©2016 Derek C. Ashmore, All Rights Reserved 33
Real-World Problems
• Corporate-Level Reporting
–Reporting for data across the enterprise
–Many read underlying databases for applications
that house the data
–Refactoring will impact this type of reporting
• Database Refactoring
–Much more expensive
–Can’t simply rollback
–Book Recommendation
• Database Factoring: Evolutionary Database Design
©2016 Derek C. Ashmore, All Rights Reserved 34
When is your refactoring complete?
• You can stop at any point
–If what remains of your monolith is supportable,
you can stop
–80 / 20 rule applies
• That’s why services are prioritized by volatility
• You can resume at any point
–Guided by code volatility and defect rates
–Change produces refactoring needs
©2016 Derek C. Ashmore, All Rights Reserved 35
Further Reading
• This slide deck
– http://www.slideshare.net/derekashmore
• This resource page
– http://breakthemonolith.guru/resources.html
©2016 Derek C. Ashmore, All Rights Reserved 36
Questions?
• Derek Ashmore:
– Blog: www.derekashmore.com
– LinkedIn: www.linkedin.com/in/derekashmore
• Connect Invites from attendees welcome
– Twitter: https://twitter.com/Derek_Ashmore
– GitHub: https://github.com/Derek-Ashmore
– Book: http://dvtpress.com/
©2016 Derek C. Ashmore, All Rights Reserved 37

More Related Content

What's hot

Writing microservices in Java -- Chicago-2015-11-10
Writing microservices in Java -- Chicago-2015-11-10Writing microservices in Java -- Chicago-2015-11-10
Writing microservices in Java -- Chicago-2015-11-10
Derek Ashmore
 
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Derek Ashmore
 
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Derek Ashmore
 
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Derek Ashmore
 
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Derek Ashmore
 
High Availability Perl DBI + MySQL
High Availability Perl DBI + MySQLHigh Availability Perl DBI + MySQL
High Availability Perl DBI + MySQL
Steve Purkis
 
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Derek Ashmore
 
Sas 2015 event_driven
Sas 2015 event_drivenSas 2015 event_driven
Sas 2015 event_driven
Sascha Möllering
 
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
Adrian Cockcroft
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
Johan Edstrom
 
DevOpsCon Cloud Workshop
DevOpsCon Cloud Workshop DevOpsCon Cloud Workshop
DevOpsCon Cloud Workshop
Sascha Möllering
 
Docker in the Cloud
Docker in the CloudDocker in the Cloud
Docker in the Cloud
Sascha Möllering
 
Java Application Servers Are Dead!
Java Application Servers Are Dead!Java Application Servers Are Dead!
Java Application Servers Are Dead!
Eberhard Wolff
 
Journey towards serverless infrastructure
Journey towards serverless infrastructureJourney towards serverless infrastructure
Journey towards serverless infrastructure
Ville Seppänen
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the Wild
Tomer Gabel
 
ActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresActiveMQ 5.9.x new features
ActiveMQ 5.9.x new features
Christian Posta
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco Repository
Jeff Potts
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
Sander Temme
 

What's hot (18)

Writing microservices in Java -- Chicago-2015-11-10
Writing microservices in Java -- Chicago-2015-11-10Writing microservices in Java -- Chicago-2015-11-10
Writing microservices in Java -- Chicago-2015-11-10
 
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
 
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
 
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
 
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
 
High Availability Perl DBI + MySQL
High Availability Perl DBI + MySQLHigh Availability Perl DBI + MySQL
High Availability Perl DBI + MySQL
 
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
 
Sas 2015 event_driven
Sas 2015 event_drivenSas 2015 event_driven
Sas 2015 event_driven
 
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
 
DevOpsCon Cloud Workshop
DevOpsCon Cloud Workshop DevOpsCon Cloud Workshop
DevOpsCon Cloud Workshop
 
Docker in the Cloud
Docker in the CloudDocker in the Cloud
Docker in the Cloud
 
Java Application Servers Are Dead!
Java Application Servers Are Dead!Java Application Servers Are Dead!
Java Application Servers Are Dead!
 
Journey towards serverless infrastructure
Journey towards serverless infrastructureJourney towards serverless infrastructure
Journey towards serverless infrastructure
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the Wild
 
ActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresActiveMQ 5.9.x new features
ActiveMQ 5.9.x new features
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco Repository
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 

Similar to Refactoring Into Microservices 2016-11-08

Microservices for Java Architects (Chicago, April 21, 2015)
Microservices for Java Architects (Chicago, April 21, 2015)Microservices for Java Architects (Chicago, April 21, 2015)
Microservices for Java Architects (Chicago, April 21, 2015)
Derek Ashmore
 
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Derek Ashmore
 
Microservices for java architects schamburg-2015-05-19
Microservices for java architects schamburg-2015-05-19Microservices for java architects schamburg-2015-05-19
Microservices for java architects schamburg-2015-05-19
Derek Ashmore
 
Microservices for Architects - Atlanta 2018-03-28
Microservices for Architects - Atlanta 2018-03-28Microservices for Architects - Atlanta 2018-03-28
Microservices for Architects - Atlanta 2018-03-28
Derek Ashmore
 
Microservices for Java Architects (Indianapolis, April 15, 2015)
Microservices for Java Architects (Indianapolis, April 15, 2015)Microservices for Java Architects (Indianapolis, April 15, 2015)
Microservices for Java Architects (Indianapolis, April 15, 2015)
Derek Ashmore
 
Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...
Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...
Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...
Derek Ashmore
 
Implementing DevOps Automation Best Practices and Common Mistakes
Implementing DevOps AutomationBest Practices and Common MistakesImplementing DevOps AutomationBest Practices and Common Mistakes
Implementing DevOps Automation Best Practices and Common Mistakes
Derek Ashmore
 
Microservices for java architects coders-conf-2015-05-15
Microservices for java architects coders-conf-2015-05-15Microservices for java architects coders-conf-2015-05-15
Microservices for java architects coders-conf-2015-05-15
Derek Ashmore
 
Writing microservices in java java one-2015-10-28
Writing microservices in java java one-2015-10-28Writing microservices in java java one-2015-10-28
Writing microservices in java java one-2015-10-28
Derek Ashmore
 
Get Loose! Microservices and Loosely Coupled Architectures
Get Loose! Microservices and Loosely Coupled Architectures Get Loose! Microservices and Loosely Coupled Architectures
Get Loose! Microservices and Loosely Coupled Architectures
DevOps.com
 
Get Loose! Microservices and Loosely Coupled Architectures
Get Loose! Microservices and Loosely Coupled ArchitecturesGet Loose! Microservices and Loosely Coupled Architectures
Get Loose! Microservices and Loosely Coupled Architectures
Deborah Schalm
 
ConFoo: Moving web performance testing to the left
ConFoo: Moving web performance testing to the leftConFoo: Moving web performance testing to the left
ConFoo: Moving web performance testing to the left
Tom Chavez
 
How Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom LineHow Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom Line
Imaginet
 
Microservices - Scaling Development and Service
Microservices - Scaling Development and ServiceMicroservices - Scaling Development and Service
Microservices - Scaling Development and Service
Paulo Gaspar
 
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
Derek Ashmore
 
DevOps / Agile Tools Seminar 2013
DevOps / Agile Tools Seminar 2013DevOps / Agile Tools Seminar 2013
DevOps / Agile Tools Seminar 2013
Ethan Ram
 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
Eric Wyles
 
Why retail companies can't afford database downtime
Why retail companies can't afford database downtimeWhy retail companies can't afford database downtime
Why retail companies can't afford database downtime
DBmaestro - Database DevOps
 
WE-06-Testing.ppt
WE-06-Testing.pptWE-06-Testing.ppt
WE-06-Testing.ppt
javed281701
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
Eduard Tomàs
 

Similar to Refactoring Into Microservices 2016-11-08 (20)

Microservices for Java Architects (Chicago, April 21, 2015)
Microservices for Java Architects (Chicago, April 21, 2015)Microservices for Java Architects (Chicago, April 21, 2015)
Microservices for Java Architects (Chicago, April 21, 2015)
 
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
 
Microservices for java architects schamburg-2015-05-19
Microservices for java architects schamburg-2015-05-19Microservices for java architects schamburg-2015-05-19
Microservices for java architects schamburg-2015-05-19
 
Microservices for Architects - Atlanta 2018-03-28
Microservices for Architects - Atlanta 2018-03-28Microservices for Architects - Atlanta 2018-03-28
Microservices for Architects - Atlanta 2018-03-28
 
Microservices for Java Architects (Indianapolis, April 15, 2015)
Microservices for Java Architects (Indianapolis, April 15, 2015)Microservices for Java Architects (Indianapolis, April 15, 2015)
Microservices for Java Architects (Indianapolis, April 15, 2015)
 
Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...
Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...
Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...
 
Implementing DevOps Automation Best Practices and Common Mistakes
Implementing DevOps AutomationBest Practices and Common MistakesImplementing DevOps AutomationBest Practices and Common Mistakes
Implementing DevOps Automation Best Practices and Common Mistakes
 
Microservices for java architects coders-conf-2015-05-15
Microservices for java architects coders-conf-2015-05-15Microservices for java architects coders-conf-2015-05-15
Microservices for java architects coders-conf-2015-05-15
 
Writing microservices in java java one-2015-10-28
Writing microservices in java java one-2015-10-28Writing microservices in java java one-2015-10-28
Writing microservices in java java one-2015-10-28
 
Get Loose! Microservices and Loosely Coupled Architectures
Get Loose! Microservices and Loosely Coupled Architectures Get Loose! Microservices and Loosely Coupled Architectures
Get Loose! Microservices and Loosely Coupled Architectures
 
Get Loose! Microservices and Loosely Coupled Architectures
Get Loose! Microservices and Loosely Coupled ArchitecturesGet Loose! Microservices and Loosely Coupled Architectures
Get Loose! Microservices and Loosely Coupled Architectures
 
ConFoo: Moving web performance testing to the left
ConFoo: Moving web performance testing to the leftConFoo: Moving web performance testing to the left
ConFoo: Moving web performance testing to the left
 
How Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom LineHow Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom Line
 
Microservices - Scaling Development and Service
Microservices - Scaling Development and ServiceMicroservices - Scaling Development and Service
Microservices - Scaling Development and Service
 
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
 
DevOps / Agile Tools Seminar 2013
DevOps / Agile Tools Seminar 2013DevOps / Agile Tools Seminar 2013
DevOps / Agile Tools Seminar 2013
 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
 
Why retail companies can't afford database downtime
Why retail companies can't afford database downtimeWhy retail companies can't afford database downtime
Why retail companies can't afford database downtime
 
WE-06-Testing.ppt
WE-06-Testing.pptWE-06-Testing.ppt
WE-06-Testing.ppt
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 

Recently uploaded

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

Refactoring Into Microservices 2016-11-08

  • 1. Refactoring Into Microservices Breaking the Monolith Given by Derek C. Ashmore November 8, 2016 ©2016 Derek C. Ashmore, All Rights Reserved 1
  • 2. Who am I? • Professional Geek since 1987 • Java/J2EE/Java EE since 1999 • Roles include: • Developer • Architect • Project Manager • Specialties • Refactoring • Performance Tuning ©2016 Derek C. Ashmore, All Rights Reserved 2
  • 3. Discussion Resources • This slide deck – http://www.slideshare.net/derekashmore • This resource page – http://breakthemonolith.guru/resources.html • Slide deck has hyper-links! – Don’t bother writing down URLs ©2016 Derek C. Ashmore, All Rights Reserved 3
  • 5. What is a Monolith? • Monolith – Single deployable application that’s gotten too large and complex to maintain • Symptoms – Hard to change • QA test cycles are long • Change causes unintended consequences – Hard to onboard new developers – Married to your technical stack – Harder to diagnose bottlenecks and memory issues ©2016 Derek C. Ashmore, All Rights Reserved 5
  • 6. What’s the cure? • Smaller services rather than one very large application • Refactoring easier said than done – Hard to do safely – It’s a hard design problem • Existing team members often too close to the problem – Developers can’t resist common business binaries • Reduces code duplication  Increases coupling • Coupling is a greater evil than code duplication! • Why not a complete rewrite? – No benefit until the end – Nobody knows *all* the business requirements! – Risk of negative impact to the business during the transition is high • Microservices are the other side of the spectrum ©2016 Derek C. Ashmore, All Rights Reserved 6
  • 7. Why Break a Monolith? • Increases Speed to Market – Monolith is slow to change • Long QA cycles – Quicker response to business competition • New features added quickly • Makes continuous delivery possible – Microservices + Continuous Delivery • Lowers Business Risk – Reduces the defect rate – Reduces Downtime – Fixes are faster too 7 • Amazon deploys once a second • Netflix deploys over 5,500 times a day Source: newrelic.com
  • 8. What are Microservices? • No concrete definition • Common microservice traits – Single functional purpose • Most/all changes only impact one service • Not dependent on execution context – “loosely coupled” – Independent process/jvm – Stateless – Standard Interface (typically Web Service/REST) – Analogy: Stereo system, Linux utilities ©2016 Derek C. Ashmore, All Rights Reserved 8
  • 9. Microservices Application Architecture • Separate Databases • Eventual Consistency • More network activity ©2016 Derek C. Ashmore, All Rights Reserved 9
  • 10. Faster Delivery to Market • High Deployment Rates – Amazon = 23,000/day – Netflix = 5,500 / day • Business Benefits – New features delivered more quickly – Quicker reaction to competitors actions • Combined with – Continuous Delivery – DevOps ©2016 Derek C. Ashmore, All Rights Reserved 10
  • 11. Microservice Reuse ©2016 Derek C. Ashmore, All Rights Reserved 11
  • 12. No Lock-in • Platform agnostic • Fewer dependency conflicts • Still have cross-cutting concerns • “Toll” for first app • Still have support concerns • Others need to be able to support your work 12©2016 Derek C. Ashmore, All Rights Reserved
  • 13. Better Availability and Resiliency • Fault tolerance built in – Reaction to failure part of the design – Failures designed to be localized • Requirements for Resiliency – Identify non-essential features • Gogo and Twitter – Context Independent Design ©2016 Derek C. Ashmore, All Rights Reserved 13
  • 14. Easier Management / Higher Throughput • Easier to manage large numbers of developers – Concentrate on intelligently drawing service boundaries – Manage/enforce service contracts • Each service team works independently • Team independence leads to higher development throughput ©2016 Derek C. Ashmore, All Rights Reserved 14
  • 16. Microservices / Monolith Mixture • 80 / 20 Rule Applies • Smaller, less complex, services are easier to support • Few companies are 100% Microservices • Traditional architectures do have a place • They are easier to create and manage while they are small • Some never grow large enough to refactor ©2016 Derek C. Ashmore, All Rights Reserved 16
  • 17. Do NOT attempt a complete rewrite • It’s too big and complex – Usually no documentation of all implemented business rules • Not written down • Nobody has it in their head – Will negatively impact your business • The new won’t ‘identically’ match behavior – Business won’t benefit until the very end • It’s a large project  Compelte rewrite will take a long time to realize – Often has no safeguards beyond manual testing – It’s a *very* big problem to handle all at once. • Refactor iteratively – Yes; this will take a longer time – It’s safer – It gives staff a chance to learn how to manage microservice libraries before they have too many to manage manually – It gives staff a chance to address non-functionals while not also being burdened with a complete redesign/rewrite ©2016 Derek C. Ashmore, All Rights Reserved 17
  • 18. Stick with the same technical stack for the refactoring • Corollary: Do not rewrite and refactor at the same time. –Rewrite after automated contract testing is in place • New technical stacks have learning curves –Refactoring is hard enough ©2016 Derek C. Ashmore, All Rights Reserved 18
  • 19. Preperation Steps • Establish a base automated test harness for the application –At an integration level, not unit test level –We want a chance of catching defects refactoring introduces –This will *not* be 100% comprehensive • The monolith is too complex for that • 80 / 20 rule applies • Establish Continuous Integration if it doesn’t exist –Jenkins CI Builds and Tests –Run Frequently (at least nightly) –Fix it immediately when somebody breaks the build ©2016 Derek C. Ashmore, All Rights Reserved 19
  • 20. Types of Monoliths • Monoliths are not created equal • Types of Monoliths – Feature-Bloated Web Application – Data Store Strangle – Over-engineered Tarball – Distributed Monolith • Tactics differ per Monolith type ©2016 Derek C. Ashmore, All Rights Reserved 20
  • 21. Feature-Bloated App • Feature set to large to manage – Usually a web app, but could be “Thick” or “Batch” as well • Symptoms – Unintended consequence problem – Long regression test cycles • Causes – New Feature Additions • Add complexity • Often not envisioned in original design – Tacked on – Developer assumptions • Streamlines code initially • Are not documented • Create landmines for new feature additions • Removing unused features – Never happens – Benefit not clear to the business – No stats on used vs unused ©2016 Derek C. Ashmore, All Rights Reserved 21
  • 22. Tactics: Feature-Bloated Web App • Chop off it’s head! – Separate the User Interface • Separation of concerns • Leaves consolidated UI • Forces Monolith to have REST interface – Easier to test more completely • Makes further refactoring safer • Forces you to identify REST resources within the monolith ©2016 Derek C. Ashmore, All Rights Reserved 22
  • 23. Separated UI • Monolith now has a REST resource interface – Easier for automated testing • Safety in further refactoring – Functionality categorized into logical units • Easier to identify sections to separate out • Cosmetic changes occur on their own schedule ©2016 Derek C. Ashmore, All Rights Reserved 23
  • 24. Factor out additional services • Factor out by related REST resources – Separate underlying database too • Prioritize resources by – Code Change Velocity – Code Complexity – Enhancement needs ©2016 Derek C. Ashmore, All Rights Reserved 24
  • 25. Data Store Strangle • Data Storage is the Monolith’s Achilles Heel • Symptoms – No flexibility in data access • Larger memory footprint – Lots of replicated data – Complex data access code – Storage design hardest part of adding new features • Causes – Bad Data Storage Design • Usually process oriented – Replicated Data – Coupled with business process • Causes code complexity – Amplifies technical debt • Storage refactoring difficult – Never happens – Benefits not clear to the business – Carries more risk than refactoring code ©2016 Derek C. Ashmore, All Rights Reserved 25
  • 26. Tactics: Data Store Strangle • Tourniquet Strategy – Separate storage reads/writes into separate service • Separate into service • All access uses central service • Spin off a read-only copy asynchronously in legacy format for reporting if needed – Wrap automated testing around the tourniquet service – Refactor the underlying database incrementally • Refactoring databases is a difficult topic – Book: Refactoring Databases: Evolutionary Database Design • Introduce new API to simplify access – Reduces caller complexity – More targeted and flexible access – Usually possible only after refactoring • Deprecate Tourniquet API ©2016 Derek C. Ashmore, All Rights Reserved 26
  • 27. Over-engineered Tarball • Internal component obstacle – Component with unnecessary complexity • Symptoms – Nobody understands it – Everyone fears changing it – Common impediment for new feature enhancements • Causes – Bored, talented developers • Good intentioned • Manufacturing interesting puzzles • Real problem when the developer leaves – Nobody else can change it safely – Creates complexity in code surrounding it ©2016 Derek C. Ashmore, All Rights Reserved 27
  • 28. Tactics: Over-engineered Tarball • Tourniquet Strategy – Separate tarball into separate service • Separate into service • All access uses central service • Also separate out data storage – Wrap automated testing around the tourniquet service – Refactor the tarball incrementally or completely replace • Automated tests are safety net ©2016 Derek C. Ashmore, All Rights Reserved 28
  • 29. Distributed Monolith • Related services that are tightly coupled / bound together • Symptoms – Always deploy a group of services together • Independent deployments rarely happen – New features require changes to the same service group • Causes – High coupling between services • Short-term developer convenience • Inappropriate Delegation – Micro-management for indirect service calls – Pass-through arguments to one service to indirectly control behavior of a subsequent service • Shared Business Code Binaries – Changes in binaries force redeployments • Higher management overhead without benefits from smaller independent services ©2016 Derek C. Ashmore, All Rights Reserved 29
  • 30. Tactics: Distributed Monolith • Solving shared business code problem – Factor into separate service(s) • Deployed once and commonly called • Don’t deploy as library – Reduces forced deployments – Performance mitigations • Expiring Cache • Make asynchronous – Coupling worse evil than Code Duplication ©2016 Derek C. Ashmore, All Rights Reserved 30
  • 31. Tactics: Distributed Monolith (con’t) • Solving the Inappropriate Delegation problem – Eliminate the middle- man ©2016 Derek C. Ashmore, All Rights Reserved 31
  • 33. Common code between services? • Yes, but…. – Version it • Services make decision as to when to upgrade – Changes to common code can’t require the deployment of multiple services ©2016 Derek C. Ashmore, All Rights Reserved 33
  • 34. Real-World Problems • Corporate-Level Reporting –Reporting for data across the enterprise –Many read underlying databases for applications that house the data –Refactoring will impact this type of reporting • Database Refactoring –Much more expensive –Can’t simply rollback –Book Recommendation • Database Factoring: Evolutionary Database Design ©2016 Derek C. Ashmore, All Rights Reserved 34
  • 35. When is your refactoring complete? • You can stop at any point –If what remains of your monolith is supportable, you can stop –80 / 20 rule applies • That’s why services are prioritized by volatility • You can resume at any point –Guided by code volatility and defect rates –Change produces refactoring needs ©2016 Derek C. Ashmore, All Rights Reserved 35
  • 36. Further Reading • This slide deck – http://www.slideshare.net/derekashmore • This resource page – http://breakthemonolith.guru/resources.html ©2016 Derek C. Ashmore, All Rights Reserved 36
  • 37. Questions? • Derek Ashmore: – Blog: www.derekashmore.com – LinkedIn: www.linkedin.com/in/derekashmore • Connect Invites from attendees welcome – Twitter: https://twitter.com/Derek_Ashmore – GitHub: https://github.com/Derek-Ashmore – Book: http://dvtpress.com/ ©2016 Derek C. Ashmore, All Rights Reserved 37