CSE Roadmap

Core tier · about 4 hours · 8 parts

Part 6 of 8 · 1 min read

Monolith case

A simple system, a modest budget, one set of characteristics.

FSA uses a kata (a practice problem) called Silicon Sandwiches: an online sandwich shop where customers can customise orders. After finding the characteristics, the book decides one quantum is enough. It is a simple application on a modest budget, so a monolith appeals. Page 6 mentioned two component designs. The book shows both.

Modular monolith. Domain-centred components, one database, one deployment. A single web interface with care for mobile devices keeps cost down. If time allows, the architect should separate tables by domain component, so a later move to a distributed style is easier. Customisation does not come from the style itself, so the architect adds an Override component where developers upload individual customisations, and each domain component refers to it for every customisable item. FSA notes that this rule would make a perfect fitness function.

Microkernel. Domain isomorphism says customisation maps to plug-ins. The core holds the domain components and a database. The common customisations form one set of plug-ins with its database, and local ones have plug-ins with their own data, uncoupled from each other. The API layer follows the backends for frontends (BFF) pattern: a thin adaptor per device type, such as iOS, that turns the generic reply into the format, paging and timing that device expects.

All communication can be synchronous here, since there are no extreme performance needs and no long operations.

The lesson is that two styles can both be right. The monolith is cheaper. The microkernel suits the customisation need directly. The choice depends on which characteristic is worth more.

Check yourself: 1. Why did the architect decide on a single quantum? 2. What does the Override component do? 3. When would you prefer the microkernel to the plain modular monolith?