Refactoring the
Monolith?
Steven Hicks
http://theexceptioncatcher.com
Who am I?
Steven Hicks
http://theexceptioncatcher.com
@theexceptioncat
The Monolith
The monolith is a full application that encompases the entire life
cycle of a user’s interaction:
Web services
Web Rendering
Serving up static resources
Business Logic
Microservices
● Independent operations
● Small in context
○ Smaller Cognitive load
● Can embrace new technologies and
languages without a full cultural shift
What Happens In Reality
● Harder To Standardize
○ Multiple Code bases
○ Duplicated Code Bases
● Serialization and communication
overhead
● Lack of code reuse
● DevOps issues
● Tracing /Fragile system
● Overly Reliant on REST/JSON
● Client is up to the requestor
● Various instances of the same
microservice (WEB SCALE)
● Fiefdoms Develop
How did we get here?
What can we do about
it?
Popular Frameworks for Enterprise Solutions
Spring J2EE
Approach #1:
Modular Monolith
Modular Monolith
● Addressed the complexity issue that
microservices solves
● Makes smaller modules within the
system
● Addresses the network
communication problem
● Relies on the build to put everything
together
● It’s an easier step towards breaking up
the monolith
● Domain Driven Design approach
● Local builds are easy to run locally
Modular Monolith: Downsides
● Tooling is a bit difficult to handle
(multiple dependencies with auto
updates)
● A bit hard to extend and change
design
● It’s still a “monolith.” *
● Cognitive Load still requires system
level interaction
Approach 2
Message Queuing
Message Queuing
● Communication and Messaging is
handled by a central communication
service (the message queue)
● Separation of Responsibility
● Removes need for custom
serialization
● Storage of communication *
Message Queuing: Downsides
● Single Point of Failure
● Tracing (throughout the system)
requires a lot of logging
● Replying to a request may get
complicated
● Versioning becomes difficult
Approach 3
Pipeline and Nodes
Pipeline and Nodes
● Isolation of processing and service
delivery
● Handles the processing of requests
without slowing down other users
● Very Fast Requests
● Can handle complicated requests
● Easy to scale up
● Workflows-like design
● Smaller components to handle logic
Pipeline and Nodes: The Downsides
● Hard on databases
● Doesn’t handle state well
● Consensus and Split Brain Issues
● Large Memory Requirements
● Not great for round trips on live
requests for large transformations
● Still requires a bit of Devops setup
(Less so than microservices)
Questions?
Comments?
Experiences?
http://theexceptioncatcher.com
@theexceptioncat

Refactoring the monolith

  • 1.
  • 2.
    Who am I? StevenHicks http://theexceptioncatcher.com @theexceptioncat
  • 3.
    The Monolith The monolithis a full application that encompases the entire life cycle of a user’s interaction: Web services Web Rendering Serving up static resources Business Logic
  • 4.
    Microservices ● Independent operations ●Small in context ○ Smaller Cognitive load ● Can embrace new technologies and languages without a full cultural shift
  • 5.
    What Happens InReality ● Harder To Standardize ○ Multiple Code bases ○ Duplicated Code Bases ● Serialization and communication overhead ● Lack of code reuse ● DevOps issues ● Tracing /Fragile system ● Overly Reliant on REST/JSON ● Client is up to the requestor ● Various instances of the same microservice (WEB SCALE) ● Fiefdoms Develop
  • 6.
    How did weget here? What can we do about it?
  • 7.
    Popular Frameworks forEnterprise Solutions Spring J2EE
  • 8.
  • 9.
    Modular Monolith ● Addressedthe complexity issue that microservices solves ● Makes smaller modules within the system ● Addresses the network communication problem ● Relies on the build to put everything together ● It’s an easier step towards breaking up the monolith ● Domain Driven Design approach ● Local builds are easy to run locally
  • 10.
    Modular Monolith: Downsides ●Tooling is a bit difficult to handle (multiple dependencies with auto updates) ● A bit hard to extend and change design ● It’s still a “monolith.” * ● Cognitive Load still requires system level interaction
  • 11.
  • 12.
    Message Queuing ● Communicationand Messaging is handled by a central communication service (the message queue) ● Separation of Responsibility ● Removes need for custom serialization ● Storage of communication *
  • 13.
    Message Queuing: Downsides ●Single Point of Failure ● Tracing (throughout the system) requires a lot of logging ● Replying to a request may get complicated ● Versioning becomes difficult
  • 14.
  • 15.
    Pipeline and Nodes ●Isolation of processing and service delivery ● Handles the processing of requests without slowing down other users ● Very Fast Requests ● Can handle complicated requests ● Easy to scale up ● Workflows-like design ● Smaller components to handle logic
  • 16.
    Pipeline and Nodes:The Downsides ● Hard on databases ● Doesn’t handle state well ● Consensus and Split Brain Issues ● Large Memory Requirements ● Not great for round trips on live requests for large transformations ● Still requires a bit of Devops setup (Less so than microservices)
  • 17.

Editor's Notes

  • #3 Hi my name is Steven Hicks I have been developing software as a hobby and professionally for nearly 20+ years. I’ve done development with full stack, embedded systems, and have done big data. Lets smooth this out a bit later
  • #8 Go into how they were constructed as an application in a box approach Both of these approaches cobbled together a lot of technologies under the same system. Spring with it’s core + all of it’s extensions. J2EE with it’s acronym soup
  • #10 Technologies to bring in: OSGI Strict building