Monoliths are back and I love it

Sean Franklin
2 min readApr 15, 2019

--

You may be wondering why would anyone want to create a monolith in todays software industry where developers are using functions as a service and separating monolithic applications into microservices. These ideas are great, but as with every architecture concept there are times where it works well and others where an alternative approach works better.

Credit to the n-ix.com “Microservices vs Monolith” article for the image

The case where a frontend app relies heavily on an individual backend’s API to load or operate properly is a great example of where decoupling applications does not provide much benefit, in fact it has some drawbacks. The explosion of Node.js apps over the past 5 years has been an excellent example of combined frontends and backends working exceptionally well together.

What is the difference between a full stack Node app and a combined Node frontend with a Java backend? The answer is not too much besides the language the backend is written in and some configuration setup to combine the two.

One of the key concepts to always keep in mind if combining applications is the possibility that these applications may be separated out again. Thinking this way forces you to model out a modular monolith that will allow the application to be separated out into two with very few changes. It also allows the frontend and backend sections of the combined app to be able to be run locally and tested independently of one another.

The idea of a modular monolith provides several benefits. There is a possibility of cutting operating costs by up to half, depending on your platform setup. For example, if running in the cloud with the total cost being calculated by the number of apps running, then you would go from having two apps down to just one app. Another benefit comes when you need to make changes to an API that in turn forces changes to the UI. Previously you would have to time deployments of both apps perfectly to ensure the smallest change window possible and limit customer impact. With monoliths, you only deploy one app and if using a blue-green deployment strategy you can create a process with zero down time and zero customer impact.

This is not saying that microservices are dying. In fact they are growing faster then ever. This idea of a modular monolith provides another option when evaluating how to architect a software product. Check out my other article which contains a step by step guide to combining a frontend UI and a Java Spring backend.

--

--