StackLift
All terms

Glossary

Monolith (monolithic architecture)

An application built and deployed as one unit, with all its features in a single codebase.

A monolith is an application built and deployed as a single unit: the user interface, business logic and data access live in one codebase and ship together. It is the simplest architecture to build, test and run, which makes it a sound default for early products and small teams.

A monolith is not the same as messy code. A modular monolith keeps clear internal boundaries between features, so the code stays understandable and can be split later if needed.

Problems appear at scale: every change ships the whole app, one slow part can affect everything, and a large codebase can slow big teams down. That is when teams consider microservices.

Start in 60 seconds

Put this to work on your project.

Get an AI-assisted, architect-reviewed scope, cost range, and timeline. Free, no login.

The complete guide

Monolith (monolithic architecture): the complete guide

Updated November 18, 2026 ยท Published by , Founder, StackLift AI. Written with AI assistance; how we make content.

Short answer

A monolith is an application built and deployed as a single unit, where all features share one codebase and usually one database. It is simple to build, test and run, which makes it the sensible default for most new products. It becomes a problem only when size, team count or scaling needs outgrow a single unit, and a well-structured monolith can delay that point for years.

What is a monolith?

A monolith is software where everything lives together. The catalog, the cart, the payments, the accounts and the admin screens are parts of one program. You build it as one thing, test it as one thing and release it as one thing. A change to any part goes out in the same release as the rest.

The word is often used as an insult, but it only describes a shape. A monolith is not automatically old, slow or messy, and many well-known, long-lived products run as one. What matters is how the code inside is organized, not that it is deployed as a single unit.

It is the counterpart to microservices, where an application is split into many independently deployed services. For a side-by-side view, see monolith vs. microservices.

What kinds of monolith are there?

Three common shapes
KindWhat it looks likeGood or bad?
Modular monolithOne deployable, with clear modules, defined interfaces between them and no reaching into each other's dataGood. Easy to run and ready to split later if needed
Layered monolithOne deployable organized by technical layers such as controllers, services and data accessFine for small apps; can blur business boundaries as it grows
Big ball of mudOne deployable with no clear structure; everything calls everythingBad. Changes are risky and slow. The problem is the structure, not the single deployment

Most complaints about monoliths are really complaints about the third kind. The fix for a ball of mud is structure. Splitting it into services without fixing the structure usually produces a tangle that is spread over a network.

What are the advantages of a monolith?

  • Simple to start: one repository, one build, one thing to run.
  • Easy local development: engineers run the whole product on a laptop.
  • Simple testing: calls between parts are ordinary function calls, so integration tests are straightforward.
  • Straightforward transactions: one database makes consistent updates easy.
  • Fewer moving parts to deploy, monitor and secure.
  • Fast calls between features, with no network in between.
  • Lower infrastructure and tooling cost, especially for small teams.

For a new product, these matter a great deal. Early on, you are still learning what the product should be. The ability to change direction quickly is worth more than the ability to scale parts independently.

What are the drawbacks?

Where monoliths strain
ProblemWhy it happens
Slow, risky releasesEvery change ships with everything else, so a small fix needs a full regression test
Team conflictsMany teams edit one codebase and wait on one release train
All-or-nothing scalingYou scale the whole app even if only one feature is busy
Technology lock-inOne language and framework version for everything
Long build and test timesThe pipeline grows with the codebase
Blast radiusA bug or memory leak in one feature can take the whole app down

These problems appear with size, not on day one. A twenty-person company with one product team rarely feels most of them. A product with many teams, heavy traffic and strict uptime needs feels them sooner.

Monolith or microservices: how do you choose?

A decision guide
SituationLean toward
New product, unclear boundaries, small teamMonolith, ideally modular
One team, steady trafficMonolith
Many teams blocking each other's releasesSplitting the pieces that cause the blocking
One feature needs very different scaling or isolationExtract that feature, keep the rest
Strong platform skills and stable business boundariesMicroservices become a real option
Legacy monolith that works but is hard to changeRefactor first, see rebuild vs. refactor

The choice is not permanent. A modular monolith can be split later along its module lines, which is much easier than untangling a mess. Starting simple keeps your options open.

How do you keep a monolith healthy?

  1. Organize code by business capability, such as billing or orders, not only by technical layer.
  2. Give each module a small public interface and keep everything else private.
  3. Forbid modules from reading each other's tables directly; go through the interface.
  4. Enforce the rules with automated checks in CI/CD, so structure does not erode.
  5. Keep the test suite fast, and add tests where modules meet.
  6. Use feature flags to separate deploying from releasing.
  7. Track and pay down technical debt regularly.
  8. Watch the build time, deploy time and change failure rate, and act when they trend worse.

A monolith kept in this state can serve a product for a long time, and any module that eventually earns its own service can leave with little pain.

Can a monolith scale?

Yes, further than most teams expect. You can run many copies of a monolith behind a load balancer, add read replicas and caching to the database, move slow work into background jobs and put a CDN in front of static content. These steps handle large traffic for many products.

Scaling trouble appears when one part of the app needs very different resources from the rest, such as an image-processing job that starves the web requests. The usual answer is to move that single part into its own worker or service and leave the rest alone.

What myths surround monoliths?

  • "Monoliths cannot scale." They scale horizontally and with caching; the limit is usually team size before it is traffic.
  • "Microservices are the modern standard." They are one option with real costs, not a goal.
  • "A monolith means spaghetti code." Structure comes from design and discipline, not deployment shape.
  • "You must choose now." A modular monolith keeps both paths open.
  • "Rewriting as microservices fixes bad code." It moves bad code across a network.

Some teams have publicly described moving from many small services back toward larger ones after finding the overhead too high for their needs. The lesson is to match the architecture to the team and the problem.

What are real-world examples of monolith applications?

Products that fit a monolith well
Product typeWhy one unit works
SaaS MVPSmall team, fast change, boundaries not yet known
Internal business toolModest traffic, few users, simple operations
Content and marketing site with a CMSOne codebase serves pages and admin
E-commerce store on a framework or platformCatalog, cart and orders share data and change together
Line-of-business system such as scheduling or invoicingConsistent transactions matter more than independent scaling
Client portalShared login, data and permissions across features

Frameworks such as Ruby on Rails, Django, Laravel, Spring Boot and Next.js with a single backend are built around this shape, and each has long-running production examples. A SaaS MVP is the classic case.

What tools and practices support a monolith?

  • A mainstream web framework with a clear project structure and conventions.
  • One relational database such as PostgreSQL, with migrations under version control.
  • Background job runners and queues for slow work, so web requests stay quick.
  • Caching with Redis or a similar store for repeated reads.
  • Architecture tests or lint rules that stop modules from importing each other's internals.
  • Containers or a platform service for repeatable deployment, with no need for a cluster at first.
  • Logs, metrics and error tracking from day one (observability).

None of this is exotic. That is the point: a monolith lets a small team spend its effort on the product instead of on platform work.

How do you measure the health of a monolith?

Watch a handful of delivery signals over time. They tell you whether the structure still serves the team, and they give you evidence if a split is ever proposed.

Signals and what they suggest
SignalWhat a bad trend suggests
Time from commit to productionPipeline or test suite has grown too slow
How often releases fail or need rollbackChanges are too tangled to test safely
Number of teams touching the same filesBoundaries are unclear; conflicts are rising
Time for a new engineer to ship a first changeThe code is hard to understand
Share of effort spent on workarounds and fixesTechnical debt is crowding out features
Resource use of one feature compared with the restA candidate for extraction

When is it time to split a monolith?

Look for evidence, not fashion. Common signs are teams that cannot release without coordinating, one area that needs separate scaling or stricter isolation, build and test times that slow everyone, and incidents where a small change causes a wide failure.

Even then, split one piece at a time: extract the part with the clearest boundary, run it alongside the old code, move traffic in steps and keep a way back. See the legacy modernization roadmap and cost to modernize legacy software.

What does it mean for cost, and how does StackLift approach it?

A monolith usually costs less to build and run than a set of services, because there is less infrastructure, fewer pipelines and less to monitor. Effort grows with the number of features, integrations and quality requirements. See web application cost and SaaS platform cost.

StackLift recommends the simplest architecture that meets the need, often a modular monolith with clear seams. A senior architect reviews the choice, agents work on feature branches, and CI/CD, observability, security review and rollback are part of the plan from sprint one. See legacy modernization and the free estimate.

Questions people ask

Is a monolith outdated?

No. It is a deployment shape, and many current products use it. It is a sound choice for most new products and for teams without a need to deploy parts independently.

What is a modular monolith?

A single deployable application organized into clear modules with defined interfaces and no shared database tables between modules. It keeps the simplicity of one unit and makes a later split easier.

Can a monolith scale?

Yes. You can run several copies behind a load balancer, add caching and read replicas, and move heavy jobs to background workers. Splitting out one part is an option when that is not enough.

Is a monolith cheaper to build?

Usually, at the start. There is less infrastructure, fewer pipelines and simpler testing. Costs rise later if the code is allowed to tangle, so structure matters.

How do I know if my monolith has become a problem?

Releases are slow and risky, teams wait on each other, builds take too long, or a small change causes wide failures. If those are true and structure cannot fix them, consider extracting parts.

Should a startup begin with a monolith?

Almost always. A startup is still learning what to build, and a single codebase makes change fast and cheap. Keep modules clean so you can split later if growth demands it.

What is the difference between a monolith and a legacy system?

A monolith describes structure: one deployable unit. Legacy describes age and difficulty to change. A new monolith is not legacy, and a legacy system may or may not be a monolith.

Is a monolith good for AI features?

Yes, for most products. An AI feature can start as a module inside the monolith that calls a hosted model through a thin interface. If it later needs separate scaling, such as heavy background processing, you can move it into its own worker without redesigning everything.

What is the strangler pattern?

A way to replace a system gradually. New services take over one piece of the old application at a time behind a routing layer, until what remains is small enough to leave alone or retire. It avoids a risky all-at-once rewrite.

How do I move from a monolith to microservices?

Gradually. Clean up module boundaries, put a routing layer in front, extract one well-bounded service, move traffic in steps and repeat only where the pain justifies it. Many teams stop after one or two services.

Sources

Sources and further reading

The standards, rules, research and official documentation this page draws on.