Why Build Outside The Monolith
When you have a creaky monolith the obvious first step is to build new functionality outside the monolith. Working on a greenfield, without the monolith’s constraining design, bugs, and even programming language is highly appealing.
There is a tendency to wander those verdant green fields for months on end and forget that you need to connect that new functionality back to the monolith’s muddy brown field.
Eventually, management loses patience with the project and pushes the team to wrap up. Integration at this point can take months! Worse, because the new project wasn’t talking to the monolith, most of the work tends to be a duplication of what’s in the monolith. Written much better to be sure! But, without value to the client.
Integration is where greenfield projects die. You have to bring two systems together, the monolith which is difficult to work with, and the greenfield, which is intentionally unlike the monolith. Now you need to bring them together, under pressure, and deliver value.
Questions to Ask
When I start working with a team building outside their monolith, integration is the number one issue on my mind.
I push the team to deliver new functionality for the client as early as possible. Here are 3 starting questions I typically ask:
- What new functionality are you building? Not what functionality do you need to build; which parts of it are new for the client?
- How are you going to integrate the new feature into the monolith’s existing workflows?
- What features do you need to duplicate from the monolith? Can you change the monolith instead? You have to work in the monolith sooner or later.
First Create the Seam
I don’t look for the smallest or easiest feature. I look for the smallest seam in the monolith.
For the feature to get used, the monolith must use it. The biggest blocker, the most important thing, is creating a seam in the monolith for the new feature!
A seam is where your feature will be inserted into the workflow. It might be a new function in a procedural straight away, an adapter in your OOP, or even a strangler at your load balancer.
The important part is knowing where and how your feature will fit into the seam.
Second Change The Monolith
Once you have a seam, you have a place to start modifying the monolith to support the feature. This is critical to prevent spending time recreating existing functionality.
Instead of recreating functionality, refactor the seam to provide it to your new service.
Finally Build Outside the monolith
Now that the monolith has a spot for your feature in its workflow, and it can support the external service, building the feature is easy. Drop it right in!
Now, the moment your external service can say “Hello World!”, it is talking to the monolith. It is in production, and even if you don’t finish it 100%, the parts you do finish will still be adding value. Odds are, since your team is delivering, management will be happy to let you go right on adding features and delivering value.
Starting with a seam lets you develop outside the monolith while still being in production with the first release. No working in a silo for months at a time. No recreating functionality.
It delivers faster, partially by doing less work, partially by enabling iterations.