liveBook · Manning

Monolithic architecture

As explained in Microservices Patterns, Second Edition

An architecture in which an application is built and deployed as a single unit.

Monolithic architecture structures an application as a single component: one codebase is built and deployed as one unit through a single deployment pipeline. A monolith can still contain distinct modules; deploying together does not require the code to be a tangled mess. section 1.2.2 section 6.1

A monolith is often a practical starting point. A small application and team can deliver quickly without the complexity of a distributed system, and changing boundaries is easier while the domain is still being understood. A few services may be justified from the start when different technologies are essential or modules need separation for scalability, availability, or security. section 1.4.1 section 6.0

The single-component design has advantages and constraints:

  • Development and deployment are comparatively simple. Broad code and schema changes can be built and deployed together, and many operations can use a single transaction. section 6.1.1
  • As the application and organization grow, changes to shared APIs, libraries, or the runtime can require coordination across teams. The single deployment pipeline can become a bottleneck. section 1.2.2
  • A shared technology stack limits runtime choices, while packaging subdomains together limits isolation based on security or business criticality. section 6.1.3

Food delivery monolith

A food delivery application packages order management, billing, payments, and adapters into one Java WAR. Initially, developers can test and deploy it straightforwardly and run multiple instances behind a load balancer. As the application and organization grow, long test cycles and large batches of changes slow delivery; a fault in one module can affect the whole process. section 2.1.1 section 2.1.2 section 2.1.3

Figure 1.7 Even though most modules in this monolithic application are loosely design-time coupled, since there is a single code base, some changes can be difficult to make because they impact numerous teams. A change to a utility module might require simultaneous changes to many other modules. Upgrading 3rd party libraries or the language runtime might also require widespread changes. There’s also a risk that the deployment pipeline becomes a bottleneck due to the large codebase and large number of developers.
design time coupling monolith

See how shared modules and a single pipeline can constrain team autonomy even when most modules are loosely coupled. section 1.2.2

Structure the code around domain concepts to improve modularity and team autonomy, and design build projects to reduce build-time coupling. A modular monolith remains one deployable unit and can still be outgrown. Before migrating to microservices, check whether modularization, an automated pipeline, DevOps practices, or organizational changes address the actual bottleneck. If migration is necessary, avoid a risky big-bang rewrite. section 6.1.4 section 6.5 section 1.4.2

How Microservices Patterns, Second Edition covers it

How deep it goes
Explains benefits and scaling constraints, then discusses domain modularity and build-time coupling as mitigation strategies.
Examples
Illustrates a food delivery application packaged as a Java WAR, with business modules, external adapters, and multiple instances behind a load balancer.
What you can do after
Evaluate architecture choices by weighing delivery bottlenecks, modularization options, and the costs of migration to microservices.
How it connects
Connects monolithic architecture to modular monoliths, microservices, deployment pipelines, team autonomy, and design-time coupling.

Also explained in

Compare how 13 books explain monolithic architecture →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.