System Design Interviews: When Is a Monolith the Better Answer?
DEV Community

System Design Interviews: When Is a Monolith the Better Answer?

A practical way to choose service boundaries without turning every feature into another deployment.

You draw one application and one database, then feel a tiny urge to apologize for the diagram. Surely a serious system design answer needs more boxes. Maybe a separate service for reviews, another for favorites, and something with an impressive name between them.

I think that little moment deserves attention, because making a diagram look more experienced can quietly make the system harder to operate. A monolith is an application deployed as a unit. Microservices split responsibilities into separately deployable services. Neither label tells us whether the code is organized well, whether the database is overloaded, or whether the team can recover from a bad release.

So let's work through the decision with a small catalog application. By the end, you'll have a defensible starting design, a reason to change it, and an answer for the uncomfortable follow-up about what happens when a service call times out.

Start with the changes that belong together

Imagine a four-person team building a catalog where people browse items, save favorites, and leave reviews. For this exercise, assume those engineers share a release schedule and that their current workload fits comfortably on the database. These are practice assumptions, not a description of a particular company's system.

One application is a reasonable starting point. Inside it, catalog, reviews, and favorites can still have distinct interfaces and clear ownership of their data.

  • Catalog code owns item updates.
  • Review code owns reviews.
  • Favorites code owns saved items.

Another module asks through an agreed interface instead of reaching into a table and changing whatever seems convenient. That discipline matters even when everyone shares the same repository and database. Putting files in three folders doesn't establish a boundary if every folder can rewrite everyone else's state.

Now add one original requirement. Publishing an item must also create its audit entry, and the product must never expose a published item without that entry. With both writes in the same transactional database, the application can commit them together. Keep the database transaction short, and make the publication path use it consistently. An unrelated network call doesn't belong inside that promise just because it happens in the same function.

If those writes move behind separate services with independent databases, preserving the same guarantee becomes a different problem. You may need a distributed transaction, or you may change the workflow so an item remains pending until required work completes. Either choice needs an explanation.

Before separating two responsibilities, ask which outcomes must succeed or fail together.

For another setting, try this Intuit service scaling exercise. Sketch the first version with one application, then choose the requirement that would make you introduce a new boundary. The company tag comes from a reported interview; the four-person team and audit example here are my practice additions.

One deployment doesn't mean one machine

This is where the conversation gets more interesting, because people sometimes use monolith as shorthand for a single server that can never grow. A stateless application can run multiple replicas behind a load balancer. All those replicas can run the same deployable application. You still need to handle shared state, database connections, and the actual capacity of storage, but you haven't become a microservices architecture simply by adding instances.

Suppose a listing endpoint slows down. First inspect where its time goes. An expensive query, missing index, or unnecessary repeated lookup will not automatically improve when you place the same operation behind another HTTP endpoint. Likewise, CPU heavy image processing may justify a separate worker pool before it justifies splitting every business module into an independently owned service. Workers can have their own resource limits and scale separately while sharing code and a release process with the application.

I like making that distinction explicit. Like we can separate execution resources without pretending we've also solved service ownership, data contracts, and independent releases.

Draw the failure before celebrating the split

Let's consider extracting reviews. Give that service ownership of review writes and suppose the catalog calls it over the network. The review service saves a submission, but its response disappears before the caller receives it. The caller times out. Did the write fail? We don't know yet, and that's the important part.

The remote system may have committed successfully even though the caller never received confirmation. Retrying blindly could create a second review. Giving the operation a stable identifier, checking whether it already completed, and returning its recorded result can make retries safer. The service must actually enforce that behavior; adding an ID to a request isn't enough by itself.

Now ask what the browsing page does while reviews are unavailable. If the product allows it, the page might show the item with a clear reviews-unavailable state. It must not turn that missing response into a made-up zero-star rating.

This is also why splitting services doesn't guarantee failure isolation. If every catalog request waits synchronously for five other services, one slow dependency can still hold up the whole page. Timeouts, bounded concurrency, and an intentional degraded response become part of the design.

None of that makes microservices bad. It gives the new boundary a price we can discuss honestly.

Make independence concrete enough to test

Now change our assumptions. A separate reviews team needs frequent releases, and shipping the catalog application repeatedly blocks those releases. Review processing also needs a different scaling profile. The boundary has become stable enough that the two teams can describe what crosses it. That is a much stronger case for extraction than having several nouns in the product description.

Before approving the split, write down four practical agreements.

  • Data ownership. The reviews service owns review writes. Other services don't secretly update its tables and then call the architecture independent.
  • Compatibility. New and old clients can coexist during deployment, with a plan for changing the API or event schema.
  • Failure behavior. Callers know whether to retry, how to identify a repeated operation, and what users see during an outage.
  • Operations. Someone owns deployment, alerts, capacity, and recovery for the new service.

Sharing a database server is not the same as sharing write ownership. Conversely, putting data on different servers doesn't remove coupling if each release still requires all teams to deploy together.

Martin Fowler's Monolith First discusses the difficulty of discovering stable service boundaries early and the overhead of operating multiple services. He also makes clear that the advice is not unanimous. I find that more useful than treating either architecture as a rule everyone must follow.

For a team with established boundaries, independent owners, and mature deployment tooling, starting with several services may be sensible. Security or regulatory isolation requirements may also change the choice before traffic becomes interesting. Ask about those constraints rather than assuming every project starts like our little catalog.

Rehearse the decision, then change your mind on purpose

Try a fifteen-minute practice round with a blank page. This is a rehearsal structure, not a hiring rubric.

  • Spend five minutes drawing a modular application and naming one operation that needs an atomic database update.
  • Use the next five to introduce a real pressure, such as independent releases or a resource-heavy workload.
  • Spend the final five explaining the new failure mode and the condition that would make the change worthwhile.

Your explanation can sound natural while still being precise. With one team and closely coordinated writes, I prefer a modular monolith for this version. It keeps deployment and transactional changes simpler. I'll reconsider the reviews boundary when independent releases or measured resource contention create a specific problem. If we extract it, review ownership, safe retries, and the browsing fallback have to move into the design too.

Notice how that answer gives the interviewer somewhere useful to push. They can change the team structure, the failure requirement, or the workload, and you can reason forward instead of defending your original diagram at all costs.

You don't need to apologize for a small architecture. But you do need to explain what it protects, where it runs out of room, and what you will do when the evidence changes. That's an answer worth practicing before drawing another box.

If you are actively preparing for interviews, stay updated with more such informative solutions.

~ Emily

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.