Choose a web application's architecture style by starting with the constraints you cannot change—team size, traffic profile, consistency requirements, and deployment environment—then picking the simplest style that satisfies them with room to grow. Architecture style is the structural pattern that governs how components are organized and how they communicate: layered monolith, modular monolith, microservices, event-driven, serverless, or a hybrid. The choice is less about fashion than fit. A five-person team with a steady transactional workload rarely benefits from the operational overhead of a service mesh, while a large organization with independently scaling domains may suffer under a single deployable unit. This guide walks through a decision sequence, compares the main styles on criteria that actually change outcomes, and shows where each one fits.

What "architecture style" means and what it doesn't decide

An architecture style sets the rules for component boundaries and communication. Layered architecture organizes code into presentation, business, and persistence tiers. A modular monolith keeps one deployable artifact but enforces internal module boundaries. Microservices split the system into independently deployable services owning their own data. Event-driven architecture connects components through asynchronous message flows. Serverless pushes execution into managed functions triggered by events. These styles are structural wrappers; they don't by themselves choose your database, your language, or your cloud provider. Those are separate decisions that interact with the style but shouldn't drive it.

The confusion usually comes from mixing style with scale. Microservices are often pitched as "how you scale," yet a well-built monolith behind a load balancer can serve millions of requests when the workload is mostly reads and the team can replicate instances. Conversely, a microservices system with a shared database is arguably worse than a monolith because it pays the distribution cost without gaining the independence. Style is about boundaries and failure modes, not a magic scaling switch.

Start with constraints, not with patterns

The most reliable way to choose is to sequence your constraints and let them eliminate options. Work through them in order, because earlier items usually dominate later ones.

1: Team size and ownership. Count the engineers who will build and operate the system. Under roughly ten, a single deployable unit with enforced modules is usually cheaper to run. Above that, the coordination cost of a monolith's shared release process starts to bite, and splitting along team boundaries becomes productive—Conway's law works whether you plan for it or not. 2: Workload shape. Separate steady-state request volume from burstiness. If traffic is roughly predictable, a monolith scaled horizontally handles it. If specific functions need wildly different scaling—say, video transcoding next to a user profile API—that asymmetry argues for splitting those functions out. 3: Consistency and transaction needs. If most operations touch several tables in one transaction, distributed boundaries will force you into sagas and eventual consistency. That's not impossible, but it's a real cost. A domain with heavy multi-entity transactions fits a modular monolith better. 4: Deployment environment and operational skills. Do you have platform engineers, observability tooling, and on-call rotation? Microservices and event-driven systems demand more of all three. A small team without that support should prefer fewer moving parts. 5: Change cadence and blast radius. How often do you deploy, and how much of the system must change together? If release trains are weekly and features routinely span many modules, independent deployment buys less. If one team's changes must ship without waiting on others, that pressure favors service boundaries. 6: Regulatory and data-residency constraints. Some systems must keep data partitioned per region or tenant. That can justify separate services per partition even without scale pressure.

Write these down. The written constraints become the criteria you compare styles against, and they prevent a later drift toward whatever pattern is currently fashionable.

Compare the main styles on the same criteria

The table below compares the common styles using the same criteria. Treat the cells as tendencies under typical conditions, not absolutes; a carefully built instance of any style can beat a careless instance of another.

Criterion Layered monolith Modular monolith Microservices Event-driven Serverless functions
Deployment units One One Many Many, often with a broker Many small functions
Team-size fit Small Small to medium Medium to large Medium to large Small to medium, bursty loads
Independent scaling Whole app only Whole app, module-level optional Per service Per consumer/producer Per function
Transaction simplicity High High within modules Low (sagas, outbox) Low to moderate Low
Operational overhead Low Low High High Medium to high
Failure isolation Weak Moderate Strong per service Strong, but ordering matters Strong per invocation
Latency profile Predictable Predictable Network hops add latency Async; tail latencies vary Cold starts may add latency
Local development Easy Easy Hard Hard Medium
Best fit CRUD apps, early products Domain-rich apps with one team Large orgs, independent domains Workflows, integrations, streaming Spiky or glue workloads

The point of lining them up this way is that no row decides alone. A team of six with a transactional domain scores well on the modular monolith across most rows. A fifty-person organization with distinct domains scores better on microservices once operational maturity is in place. The trade-off you're really making is coordination cost versus operational cost.

Where the monolith and modular monolith fit

For most new web applications, the layered or modular monolith is the correct starting point. You get one deployable, one database to reason about, straightforward local development, and transactions that just work. The failure mode to watch for is the "big ball of mud": modules that reach into each other's tables and internals until the structure is nominal. The fix is discipline, not distribution—enforce module boundaries in code, expose narrow interfaces, and keep each module's data private.

A modular monolith differs from a plain layered monolith in that it treats internal modules as if they were services: each owns its schema, communicates through explicit APIs, and can later be extracted. That last property is the reason it's often the best hedge. You pay a modest design cost up front and retain the option to split later if a module's scaling or ownership needs diverge. Success check: after a few months, can a new engineer change one module without touching others? If yes, the boundaries are real.

The monolith's honest limit is coordination. When dozens of engineers share one release pipeline, deploys queue, a bug in one area blocks everyone, and blast radius is the whole application. That's when the coordination argument for splitting begins to outweigh the operational savings.

When microservices earn their overhead

Microservices make sense when the organization, not the code, is the binding constraint. If you have multiple teams that need to ship independently, own distinct business domains, and can each operate their services, splitting gives each team a clear boundary and a deploy pipeline it controls. The second legitimate driver is asymmetric scaling: one component needs ten times the resources of the rest, and scaling the whole monolith wastes capacity or forces awkward workarounds.

The costs are real and often understated. You trade in-process calls for network calls, which means partial failures, retries, timeouts, and latency you didn't have before. You trade a database transaction for distributed consistency patterns—sagas, outbox tables, idempotent consumers—each of which is extra code and extra failure modes. You need service discovery, centralized logging, tracing, and a deployment platform. Local development gets harder because you can't easily run thirty services on a laptop.

A practical test before committing: can you name the service boundaries in domain terms, and can you assign an owner to each? If the boundaries are unclear or one team would own most services, you'll get distributed monolith behavior—all the coupling, all the network overhead, none of the independence. Another test: do you already have observability and on-call practices that catch a failing service at 3 a.m.? If not, build those before splitting.

Event-driven and serverless: fit the workload, not the trend

Event-driven architecture fits systems where work is naturally asynchronous or where many consumers react to the same fact. Order placement triggering inventory, billing, and notification is the canonical example. The style decouples producers from consumers, which lets you add consumers without changing producers—genuinely useful for integrations and streaming pipelines.

The design cost is that ordering, duplication, and delivery guarantees become your problem. Most brokers offer at-least-once delivery, so consumers must be idempotent. Event schemas become contracts; changing them safely requires versioning. Debugging a flow that spans five consumers is harder than stepping through a call stack, which is why tracing becomes non-negotiable. A useful failure check: replay a batch of events into a fresh consumer and confirm it produces the correct state without duplicating side effects.

Serverless functions fit spiky or intermittent workloads—image processing, webhooks, scheduled jobs, glue between services—where paying for idle capacity is wasteful. The trade-offs are cold-start latency on some runtimes, execution time limits, and a programming model that pushes state into external stores. Serverless is often a complement rather than a whole architecture; many systems pair a monolith or services with functions for specific jobs.

A worked decision sequence

Suppose a team of eight is building a subscription-billing web app. Load is steady, transactions span invoices, payments, and account state, and the team has modest ops experience. Walk the constraints: team size favors one deployable; heavy multi-table transactions favor a single database; steady load means no component needs independent scaling. The modular monolith wins. Modules for billing, accounts, and notifications each own their tables and expose interfaces. If notifications later need burst scaling, extract that module into a service or a function—one boundary, not a rewrite.

Now suppose a media company with forty engineers across four product teams needs a content API, a recommendation engine, a transcoding pipeline, and a billing system. The recommendation engine trains on a different cadence and needs GPU-backed instances; transcoding is bursty; billing is transactional and low-volume. Here the constraints differ per domain: the recommendation and transcoding components have asymmetric scaling, and four teams want independent deploys. Microservices for the compute-heavy domains plus an event-driven pipeline for transcoding, with billing kept transactional inside one service, is a defensible split. The decision isn't "microservices are better"—it's that this organization's constraints make the overhead worth paying.

Common failure modes and how to catch them early

The first failure is choosing a style for a resume or a conference talk rather than a constraint. Symptom: nobody can explain which requirement the style satisfies. Check by asking, "What breaks if we use the simpler option?" If the answer is vague, you've probably over-engineered.

The second is distributed monolith: services that must deploy together and share a database. Symptom: a change to one service routinely requires synchronized changes to others. This is worse than a monolith because you've paid the network and operational costs without gaining independence. The reversible fix is to consolidate the coupled services back into one deployable before the coupling spreads.

The third is premature extraction. Splitting a module into a service before its boundary is stable locks in a wrong boundary that's now expensive to move. A useful rule: extract only after a module's interface has been stable for several release cycles and a concrete pressure exists—scaling, ownership, or release independence.

The fourth is ignoring the data layer. Architecture style debates often skip how data is partitioned. Service-per-database is clean in theory but forces you to design cross-service queries as compositions, which changes your API shapes. Decide data ownership alongside service boundaries; they're the same decision viewed from two angles.

Documentation and evolution

Whatever style you choose, record the decision and its rationale. A short architecture decision record per choice—what was decided, what constraints it serves, what was rejected and why—saves future teams from re-litigating settled questions and reveals when constraints have shifted enough to revisit. Revisit at meaningful triggers: a team-size change, a new scaling bottleneck, a merger, a move to a new deployment environment. Architecture is a series of reversible bets, not a one-time verdict. The best style is the one your current team can operate confidently and change when the constraints move.

FAQ

Can we start with a monolith and move to microservices later? Yes, and that path is usually cheaper than the reverse. The key is to keep module boundaries honest so extraction is a matter of moving code behind a network interface, not untangling shared state. Extraction is still work—data migration and dual-write transitions are the hard parts—but stable boundaries make it tractable.

Does a modular monolith require a single database? No, but a single database is the simplest default. You can give modules separate schemas to reinforce ownership. Separate physical databases inside one deployable add operational complexity without the independence benefit, so do it only when a specific constraint—compliance, isolation—demands it.

How many services is too many? There's no universal number; the real limit is how many services your team can operate, observe, and deploy without coordination pain. If adding a service requires a new on-call rotation or a dedicated platform hire, you've likely exceeded the organization's capacity for that style at that moment.

Does serverless replace the need for an architecture style? No. Serverless is a deployment and execution model; you still decide how functions are organized, who owns data, and how components communicate. A pile of functions with no boundary discipline is a distributed ball of mud.