Most software starts as one thing. A small team writes one program that handles the sign-in, the shop, the search, and the payment. There is one place to look when something goes wrong and one thing to release when the work is done. For a long time, that simple shape is enough.

A monolith is that shape, kept on purpose. It is one big system that does everything in one place. The parts that handle accounts, orders, payments, and messages live together in a single program, share the same memory, and are released together as one unit. The word comes from the idea of a single large block of stone: one solid piece, rather than many small pieces joined together.

What a monolith is

A monolith is a single application that contains all the work a system needs to do. When a user signs in, the same program checks the password, loads the account, and shows the home page. When the user buys something, the same program takes the order, checks the stock, and records the payment. Nothing is handed to a separate service over a network, because there is no separate service.

That closeness is the point. The parts call each other directly. A function that checks stock can call a function that records an order without waiting for a network or agreeing on the shape of a message. The whole system is there, in one place, and every part can reach every other part.

One large dark machine standing alone in a dim room in warm off-white light, with one small coral-red glowing light on its front

How everything fits in one place

Inside a monolith, the work is usually organised into layers or modules, but those modules are parts of one program rather than programs of their own. One module might handle the pages a user sees, another the rules for pricing, and a third the records where orders are kept. They are separate in the code, but they are built and released together, as a single whole.

The program runs on a server, a machine that waits for requests and answers them. When a request arrives, the server hands it to the program, and the program does the whole job from start to finish: it reads the request, does the work, saves what needs saving, and sends the answer back. There is no journey between services, and no waiting for another program to reply.

Because the parts share the same memory, they can also share one store of data. One set of records holds the accounts, the orders, and the stock. That makes some work simple: moving money from one account to another can be done in one step, with the whole change either happening or not happening.

Monoliths and microservices

The clearest way to understand a monolith is to compare it with its opposite. A microservice is one small service doing one job well, and a system built from microservices is many such services talking to each other over a network. A monolith is the other choice: one big system that does everything in one place, with no network between its parts.

The difference is not in what the system does, but in where its boundaries sit. In a monolith, the boundary is around the whole system. Everything inside is one program. In a microservice system, the boundary is around each small job, and the system is the conversation between them. Neither shape is right for every project. The question is which shape fits the team, the size of the work, and the way the work is likely to change.

A single tall dark building at night in warm off-white light, with one coral-red glowing window among its dark windows

Why teams keep one big system

The first reason is simplicity. A monolith is one thing to run, one thing to watch, and one thing to deploy. A team does not need to keep track of many services, many versions, and many conversations between them. When something goes wrong, there is one place to look, and when a fix is ready, there is one release to make.

The second reason is speed of change, at least while the system is small. A developer can change a rule in one module and test the whole system in one go, without updating one service and then another. A new member of the team can run the whole system on one machine and learn it by reading one program.

The third reason is that some work is easier when it happens in one place. A task that touches accounts, orders, and stock at the same time can be done as one step inside a monolith. Split across services, the same task becomes a sequence of calls, each of which can fail on its own.

What one big system costs

A monolith is not free of cost, and its cost grows with its size. As more features are added, every change touches a larger whole. A developer who wants to change the payment rules must still build, test, and release the entire system. Releases become larger, slower, and more careful, because each one carries more change.

Scale brings its own problem. If one part of the system is busy, the whole system must be given more resources, because the parts cannot be scaled separately. A busy search page and a quiet settings page run in the same program, so the team cannot give extra power to search alone.

There is also the risk that a fault in one part affects the whole. A mistake in a rarely used feature can bring down the program that handles everything else, because there is only one program to bring down. Careful testing helps, but the shape itself offers no wall between one part and another.

A single large dark stone block standing alone in a dim hall in warm off-white light, with one small coral-red glowing strip on its surface

When a monolith fits

A monolith fits best when the system is small enough for one team to hold in mind, and when the work changes together rather than in separate directions. A new product, a small team, and a short list of features are the natural home of a monolith. The team can move quickly, keep the whole system in one place, and learn what the product needs to be before deciding how to split it.

It also fits when the parts are closely tied. If a change to orders almost always means a change to stock and to payments, keeping those parts in one program saves the team from coordinating three separate releases.

Like any program, a monolith is written in a programming language and turned into a running program by a compiler or an interpreter. What is different is not the code inside it, but the shape around the code: one program, one release, one place where the whole system lives.

A monolith is one big system that does everything in one place. That shape is simple to run and simple to change while it stays small. It grows harder as the system grows, and at some point a team may choose to split it into smaller services. Until that point, one big system is not a failure to split. It is a choice, and for many systems it is the right one.

Back to the journalDiscuss a project