SlideShare a Scribd company logo
Michael T. Nygard
@mtnygard
Grinding the java monolith
This Photo by Unknown Author is licensed under CC BY-NC
This Photo by Unknown Author is licensed under CC BY-SA
Grinding the java monolith
This Photo by Unknown Author is licensed under CC BY-SA
UI
Domain
Persistence
Application
Users Orders Suppliers Finance
Users Orders Suppliers Finance
Users Orders Suppliers Finance
Monitoring
Logging
Authn/Authz
Context
A large system that requires decomposition.
Mix of high-level and low-level concerns
Several operations are at the same level of abstraction
Layers POSA 1
Solution
Therefore, structure your system into an appropriate number of layers and place them
on top of each other.— Buschmann, et. al., Pattern Oriented Software Architecture,
Vol 1.
Each layer should have a narrow, well-specified interface. It should be possible to
substitute a different implementation of the layer without change to higher layers in the
stack.
• Forces
• Late changes should have limited ripple effect
• Interfaces should be stable, may be standardized
• Parts should be interchangeable
• Other systems may reuse lower layers
• Responsibilities should be grouped for
comprehension and maintainability
• Further decomposition is needed for team structure
and design.
Example: TCP stack Failed example: Ruby on Rails
Question: What makes a better or worse implementation of layers?
Layer 1
1.1 1.2 1.3
Layer 2
2.1 2.2
Layer 3
3.1 3.2 3.3
<<uses>>
Grinding the java monolith
http://www.michaelnygard.com/blog/2015/07/the-fear-cycle/
▪No limits to effect of bad code
▪Common-mode failures in shared code
▪Latent semantic coupling
▪Poor monitoring
▪Poor retry / timeout handling
▪Disruptive deployments
▪ My experience: 2 out of 3 such projects will not
succeed.
▪ The killers:
▪ Impatience
▪ Unrealistic expectations
▪ Hubris
Grinding the java monolith
▪ Premise
▪ Refactor to create interfaces between subdomains, then turn those into HTTP interfaces
▪ Failure modes:
1. It takes too long. Executive impatience will defeat the plan.
2. Ongoing feature work introduces new dependencies faster than they are removed.
▪ Tempting to make your key domain objects into services.
▪ Makes deployments more disruptive
▪ Creates common dependency from many features to the entity services.
▪ Premise
▪ Keep developer utilization high by drawing them from a pool for the duration of a project.
▪ When the project is done, throw the developers back into the pool.
▪ Failure modes:
1. Project-orientation favors deadlines over code health & architecture initiatives.
2. Developers doing the hard work of refactoring should be able to enjoy the fruit of their
efforts.
▪ Instead:
1. Use product teams
▪ Premise:
▪ We know the domain, let’s design new services that leave the past behind.
▪ Reality:
▪ We make the same mistakes over and over.
▪ “Second system effect”
▪ Designers’ optimism not supported by any past evidence
▪ Instead:
▪ Design in context.
▪ Accept the scars of the past.
▪ Premise:
▪ Create an intercepting proxy that can divert some kinds of traffic to one new service at a
time.
▪ Reality:
▪ Sometimes works
▪ However, you will not like the service design.
▪ Services must be designed expediently and in the context of the current system’s interaction
▪ That’s OK, they can be replaced easier after the first effort.
▪ Premise:
▪ The current system works.
▪ Devs know what’s needed in their own areas
▪ But are afraid of the far-distant effects of their changes
▪ Response:
▪ Break into “product” teams
▪ Give each one a copy of the code
▪ Let them delete anything they don’t need.
▪ Reality:
▪ Coupling via the DB lasts a long time
▪ Services will be larger than desired
▪ Premise
▪ Microservices are never “done”
▪ Keep the pressure on simplifying design
▪ Reality
▪ Devs are often uncomfortable with ambiguity
▪ Deleting services & code that were just barely deployed feels “wrong”
▪ Premise
▪ Objects with long lifespans that serve multiple uses are hard to change
▪ Therefore, find major boundaries in the business process
▪ Make the “before” and “after” portions into separate services
▪ Reality
▪ Addresses consistency better than entity services
▪ Supports converging business processes
▪ Not as easy to support divergence
▪ Premise
▪ Domain objects make good representations to transfer in APIs
▪ An API can be expressed as REST on domain objects.
▪ Reality
▪ Makes it very difficult to handle multiple versions of APIs
▪ Leaks implementation detail & internals of the service
▪ Instead
▪ Treat request data as data
▪ At most, map into object that represent the interface itself
Grinding the java monolith
▪ Premise
▪ Hexagonal architecture expresses the domain independently of integration & persistence
tech
▪ Reality
▪ Improved testability
▪ Smaller domain
▪ Better support for monitoring, metrics, and ALM
Grinding the java monolith
Grinding the java monolith
Grinding the java monolith
Michael Nygard (@mtnygard)

More Related Content

PPTX
Splunk Ninjas: New Features and Search Dojo
PDF
How to estimate the cost of a Maximo migration project with a high level of c...
PDF
Advanced web application architecture - Talk
PPTX
The "Why", "What" and "How" of Microservices
PPTX
API-driven Legacy Migration: Results from Project Winterfell
PDF
09-01-services-slides.pdf for educations
PPTX
DDD Domain Relationships Radars
PPTX
Serverless Computing Model
Splunk Ninjas: New Features and Search Dojo
How to estimate the cost of a Maximo migration project with a high level of c...
Advanced web application architecture - Talk
The "Why", "What" and "How" of Microservices
API-driven Legacy Migration: Results from Project Winterfell
09-01-services-slides.pdf for educations
DDD Domain Relationships Radars
Serverless Computing Model

Similar to Grinding the java monolith (20)

PDF
Architectural Decisions: Smoothly and Consistently
PDF
Architectural Decisions: Smoothly and Consistently
PDF
Meteor + React
PDF
Microservices Architecture
PPTX
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
PPTX
Introduction to Microservices
PDF
Stay productive_while_slicing_up_the_monolith
PPTX
Patterns of enterprise application architecture
PDF
Why we got to Docker
PDF
Understanding Microservices
PPTX
Building FoundationDB
PDF
Software Architecture and Architectors: useless VS valuable
PDF
SOA with Zend Framework
PDF
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
PPTX
Going Serverless on AWS
PDF
Patterns and Pains of Migrating Legacy Applications to Kubernetes
PDF
Patterns and Pains of Migrating Legacy Applications to Kubernetes
PDF
The Future of Serverless
PPTX
Enterprise Software Development Patterns
PPTX
Best practices for application migration to public clouds interop presentation
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
Meteor + React
Microservices Architecture
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Introduction to Microservices
Stay productive_while_slicing_up_the_monolith
Patterns of enterprise application architecture
Why we got to Docker
Understanding Microservices
Building FoundationDB
Software Architecture and Architectors: useless VS valuable
SOA with Zend Framework
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
Going Serverless on AWS
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
The Future of Serverless
Enterprise Software Development Patterns
Best practices for application migration to public clouds interop presentation
Ad

More from Michael Nygard (7)

PPTX
Uncoupling
PDF
Tempo, Maneuverability, and Initiative
PDF
Manueverable architecture
PDF
Architecture without an end state
PDF
Chef in the cloud and on the ground code freeze 2012
PDF
The Big Red Button
PDF
Where to put_my_data
Uncoupling
Tempo, Maneuverability, and Initiative
Manueverable architecture
Architecture without an end state
Chef in the cloud and on the ground code freeze 2012
The Big Red Button
Where to put_my_data
Ad

Recently uploaded (20)

PPTX
history of c programming in notes for students .pptx
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Introduction to Artificial Intelligence
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Nekopoi APK 2025 free lastest update
PPTX
ai tools demonstartion for schools and inter college
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Transform Your Business with a Software ERP System
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
history of c programming in notes for students .pptx
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
How to Choose the Right IT Partner for Your Business in Malaysia
Navsoft: AI-Powered Business Solutions & Custom Software Development
Introduction to Artificial Intelligence
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PTS Company Brochure 2025 (1).pdf.......
Design an Analysis of Algorithms I-SECS-1021-03
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Nekopoi APK 2025 free lastest update
ai tools demonstartion for schools and inter college
Operating system designcfffgfgggggggvggggggggg
2025 Textile ERP Trends: SAP, Odoo & Oracle
Odoo POS Development Services by CandidRoot Solutions
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Transform Your Business with a Software ERP System
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool

Grinding the java monolith

  • 3. This Photo by Unknown Author is licensed under CC BY-NC
  • 4. This Photo by Unknown Author is licensed under CC BY-SA
  • 6. This Photo by Unknown Author is licensed under CC BY-SA
  • 12. Context A large system that requires decomposition. Mix of high-level and low-level concerns Several operations are at the same level of abstraction Layers POSA 1 Solution Therefore, structure your system into an appropriate number of layers and place them on top of each other.— Buschmann, et. al., Pattern Oriented Software Architecture, Vol 1. Each layer should have a narrow, well-specified interface. It should be possible to substitute a different implementation of the layer without change to higher layers in the stack. • Forces • Late changes should have limited ripple effect • Interfaces should be stable, may be standardized • Parts should be interchangeable • Other systems may reuse lower layers • Responsibilities should be grouped for comprehension and maintainability • Further decomposition is needed for team structure and design. Example: TCP stack Failed example: Ruby on Rails Question: What makes a better or worse implementation of layers? Layer 1 1.1 1.2 1.3 Layer 2 2.1 2.2 Layer 3 3.1 3.2 3.3 <<uses>>
  • 15. ▪No limits to effect of bad code ▪Common-mode failures in shared code ▪Latent semantic coupling
  • 16. ▪Poor monitoring ▪Poor retry / timeout handling ▪Disruptive deployments
  • 17. ▪ My experience: 2 out of 3 such projects will not succeed. ▪ The killers: ▪ Impatience ▪ Unrealistic expectations ▪ Hubris
  • 19. ▪ Premise ▪ Refactor to create interfaces between subdomains, then turn those into HTTP interfaces ▪ Failure modes: 1. It takes too long. Executive impatience will defeat the plan. 2. Ongoing feature work introduces new dependencies faster than they are removed.
  • 20. ▪ Tempting to make your key domain objects into services. ▪ Makes deployments more disruptive ▪ Creates common dependency from many features to the entity services.
  • 21. ▪ Premise ▪ Keep developer utilization high by drawing them from a pool for the duration of a project. ▪ When the project is done, throw the developers back into the pool. ▪ Failure modes: 1. Project-orientation favors deadlines over code health & architecture initiatives. 2. Developers doing the hard work of refactoring should be able to enjoy the fruit of their efforts. ▪ Instead: 1. Use product teams
  • 22. ▪ Premise: ▪ We know the domain, let’s design new services that leave the past behind. ▪ Reality: ▪ We make the same mistakes over and over. ▪ “Second system effect” ▪ Designers’ optimism not supported by any past evidence ▪ Instead: ▪ Design in context. ▪ Accept the scars of the past.
  • 23. ▪ Premise: ▪ Create an intercepting proxy that can divert some kinds of traffic to one new service at a time. ▪ Reality: ▪ Sometimes works ▪ However, you will not like the service design. ▪ Services must be designed expediently and in the context of the current system’s interaction ▪ That’s OK, they can be replaced easier after the first effort.
  • 24. ▪ Premise: ▪ The current system works. ▪ Devs know what’s needed in their own areas ▪ But are afraid of the far-distant effects of their changes ▪ Response: ▪ Break into “product” teams ▪ Give each one a copy of the code ▪ Let them delete anything they don’t need. ▪ Reality: ▪ Coupling via the DB lasts a long time ▪ Services will be larger than desired
  • 25. ▪ Premise ▪ Microservices are never “done” ▪ Keep the pressure on simplifying design ▪ Reality ▪ Devs are often uncomfortable with ambiguity ▪ Deleting services & code that were just barely deployed feels “wrong”
  • 26. ▪ Premise ▪ Objects with long lifespans that serve multiple uses are hard to change ▪ Therefore, find major boundaries in the business process ▪ Make the “before” and “after” portions into separate services ▪ Reality ▪ Addresses consistency better than entity services ▪ Supports converging business processes ▪ Not as easy to support divergence
  • 27. ▪ Premise ▪ Domain objects make good representations to transfer in APIs ▪ An API can be expressed as REST on domain objects. ▪ Reality ▪ Makes it very difficult to handle multiple versions of APIs ▪ Leaks implementation detail & internals of the service ▪ Instead ▪ Treat request data as data ▪ At most, map into object that represent the interface itself
  • 29. ▪ Premise ▪ Hexagonal architecture expresses the domain independently of integration & persistence tech ▪ Reality ▪ Improved testability ▪ Smaller domain ▪ Better support for monitoring, metrics, and ALM