Software Engineering

Monolith or Microservices? Decide by Operational Cost

Microservices can support independently deployed business capabilities, but impose distributed tracing, network failure, deployment and data-consistency work. A well-structured monolith can be the safer starting architecture.

اقرأ بالعربية
Illustration for Software Engineering
On this page

Choose a boundary you can operate

Architecture should make the organization's work easier to change and run. A monolith packages the application as one deployable unit; microservices separate capabilities into independently operated services. Neither label tells you whether the business rules are clear, the code is maintainable or the team can recover from a failure.

For a technology leader, the useful question is which independence the system actually needs and what it costs to provide. Avoid replacing a working application because another architecture appears more modern. Equally, do not dismiss separation when one capability has a demonstrated need for independent scaling, release timing or operational ownership.

Follow one hypothetical transaction

Consider a distributor with order entry, inventory reservation and invoicing. In a modular monolith, these capabilities can have explicit internal interfaces while sharing a deployment. A business transaction may be implemented within one database boundary when that matches the design.

Separating them into services introduces remote calls or asynchronous messages. An accepted order may reach inventory while invoicing is unavailable. The design now needs to represent partial progress, retry safely and explain status to the user. The previous transaction has not disappeared; responsibility for its distributed outcome has moved into application and operating behavior.

Microsoft's architecture guidance describes microservices around bounded business capabilities and highlights system complexity as a trade-off. Its data guidance discusses ownership and consistency across services. These references support evaluating boundaries; they do not establish a universal company size or traffic threshold at which separation becomes necessary.

Distinguish modularity from process count

A single deployment can still separate responsibilities in code, limit direct data access between modules and define clear interfaces. This can make later extraction easier without paying distributed-system costs immediately. Conversely, several services that all modify the same tables and must deploy together may retain tight coupling while adding network failure.

Start by mapping ownership of business rules and records. If teams cannot agree who may change an order's state inside one application, splitting the application will not settle that policy. Architecture diagrams should expose those decisions rather than hide them behind service boxes.

Compare the operating burden explicitly

For each proposed service, identify its owner, deployment pipeline, runtime credentials, monitoring, logs, tracing, backup needs and on-call response. Define how it authenticates callers and handles unavailable dependencies. A small team may reasonably prefer a shared deployment until a concrete need outweighs this additional work.

  • Which capability must be released without coordinating the others?
  • Which workload has measured resource needs that differ materially?
  • Which data needs immediate consistency, and which can tolerate delay?
  • Who investigates a request that crosses several services?
  • Can the team test and recover a partial failure without manual database edits?

Avoid presenting autonomy as free. Independent deployment requires compatible contracts and an agreed change process. A service can be deployed alone yet still break a consumer that relies on an undocumented field or state transition.

Treat data separation as a business decision

For the distributor, inventory reservation may need a firm decision before an order is promised. A reporting view may tolerate a delay. Describe that difference directly. “Eventually consistent” should explain what may be stale, for how long the business can tolerate it and what happens when the expected update never arrives.

A service should have a defined source of truth for the records it owns. If copies are needed elsewhere, document propagation and reconciliation. Do not casually create multiple writable versions of the same customer or order and assume synchronization will resolve conflicts.

Migrate one justified capability at a time

If separation is warranted, choose a boundary with understandable data ownership and a clear benefit. Introduce a compatible interface, observe its usage and move a bounded workload behind it. Keep a reversible transition where practical and avoid a wholesale rewrite that combines architectural change with new business rules.

An alternative is to improve the existing monolith: isolate a module, optimize a measured bottleneck, or run a background workload separately while preserving a coherent application model. Choose the smallest change that resolves the demonstrated constraint.

Validate the decision with failure, not a diagram

For the hypothetical distributor, interrupt invoicing after inventory reservation and verify the documented outcome. Can an operator see the incomplete transaction? Can processing resume without duplicate invoices or lost reservations? Measure the deployment and diagnosis effort as well as normal response time.

Accept the architecture decision when its ownership, consistency, recovery and release implications are understood and supported by evidence. Revisit it as needs change. Begin an enterprise software architecture discussion with the business boundary and operating capacity, rather than a preferred service count.

Primary references and further reading

PUT IT INTO PRACTICE

Connect the idea to your business.

Start with your goals, existing systems and constraints before choosing a solution.

Software Solutions
CONTINUE EXPLORING

How to Select an Enterprise Software Development Partner

Custom Software vs SaaS: A Business Decision Framework