Book a free call

How Much Do Microservices Cost to Build and Run?

Microservices cost more to build and run than a monolith at first, because each service adds infrastructure and upkeep. Here is what drives the bill.

Hertiv engineering teamReviewed by a senior engineer
6 min read
How Much Do Microservices Cost to Build and Run?
On this page

Short answer

Microservices cost more than a monolith, because each service needs its own deployment, monitoring, logging and testing. The bill has three parts: the cost of splitting the system, the running cost of the extra infrastructure, and the ongoing cost of keeping many services healthy. The trade is that each service can scale and change on its own, so spending grows with use rather than with the whole system.

What are microservices?

Microservices are a way of building software as a set of small, independent services, each responsible for one job, such as payments, search or user accounts. Each service runs on its own, has its own data store and talks to the other services over a network. A monolith, by contrast, is one large application where all of those jobs live in a single codebase and deploy together.

The idea is that a team can change, test and deploy one service without touching the rest. That independence is what makes microservices attractive, and it is also what makes them cost more: every service you add is another thing to build, run and watch.

Most teams do not start with microservices. Microservices make sense once a system is large enough that one codebase slows everyone down, which is usually after the product has found its users.

What makes up the cost of microservices?

The cost of microservices falls into five parts, and the build cost is only the first. A team that budgets for the build and forgets the running cost gets a surprise in the second year, when the infrastructure bill and the maintenance work arrive together.

Cost part What it covers When it hits
Splitting the system Designing service boundaries and pipelines Up front, during the build
Infrastructure Compute, storage and network per service Every month, while live
Observability Logging, monitoring, tracing and alerts Setup, then monthly
Team time Upgrades, fixes and on-call across services Ongoing, every week
Data and messaging Queues, registries and data stores Setup, then monthly

Observability is the part teams underestimate most. One application needs one set of logs and dashboards. Twelve services need twelve, plus a way to follow one request across all of them. That tooling costs money and engineering time to set up and keep working, which is why teams often bring in DevOps support for the first setup.

How do build costs differ from running costs?

Build costs are mostly people. Splitting a monolith means designing service boundaries, setting up deployment pipelines for each service, writing the code that lets services talk to each other, and testing the whole system in its new shape. That work is front-loaded: it is heaviest in the first months and then falls away.

Running costs are mostly infrastructure and upkeep. Each service needs compute, storage and network, plus monitoring, log storage and alerting. Those costs grow with the number of services and with traffic, and they never go to zero while the system is live.

The balance matters more than either number alone. A build that costs $200,000 and runs for $2,000 a month is a different decision from a build that costs $80,000 and runs for $8,000 a month. Ask for both numbers before you approve the split, and ask what happens to the running cost if traffic doubles.

How do you estimate microservices cost?

Estimate in three passes: count the services, price each one, then add the shared costs that no single service owns. The first pass is the hardest, because the number of services decides almost everything else.

  1. List the services you actually need, not the ones you might need later.
  2. Price one service end to end: build, deploy, monitor and test.
  3. Multiply by the number of services, then add shared costs for messaging, logging and security.
  4. Add a buffer for the work you cannot see yet, such as debugging across services.
  5. Compare the total with the cost of keeping the monolith for another year.

Keep the estimate honest by pricing the shared costs separately. A message queue, a log store and a service registry are not free, and they are easy to leave out of a per-service estimate because no single team owns them.

Example (hypothetical): a 12-service retail platform

Example (hypothetical): a retail company splits its monolith into 12 services, from product search to checkout. The build takes a team of six engineers six months. At a planning rate of $10,000 per engineer per month, the build costs $360,000.

Running costs are smaller but permanent. Each service costs about $120 a month in compute and storage, which is $1,440 a month for 12 services. Monitoring, logging and messaging add about $400 a month. The total running cost is about $1,840 a month, or $22,080 a year.

The arithmetic shows where the money goes. The build is a one-off cost of $360,000, while the running cost is $22,080 a year. If the split lets the team ship twice as fast, the build pays for itself in saved delay. If it does not change shipping speed, the company has bought $22,080 a year of extra running cost for nothing.

The point of the example is not the numbers, which are planning figures. It is the shape: a large one-off build cost, a modest but permanent running cost, and a benefit that only exists if the team actually ships faster.

When is a monolith cheaper?

A monolith is cheaper when the system is small, the team is small, or the product is still changing fast. With one codebase, one deployment and one set of logs, a small team can move quickly without paying for the machinery that microservices need.

The crossover point is usually about team size. When several teams work on the same codebase and each deployment waits on the others, the monolith starts to cost more in delay than microservices cost in infrastructure. Until then, the monolith is the cheaper choice.

Some teams split too early and pay for it. Serverless and microservices are often compared as alternatives, but the real question is simpler: does your system have enough independent parts, and enough teams, to justify the split? If the answer is no, stay with the monolith.

What are the common mistakes?

The most common microservices cost mistakes are counting only the build, splitting too finely, and forgetting the shared services that no single team owns.

  • Budgeting the build and forgetting the running cost. The monthly bill arrives long after the build budget is spent.
  • Splitting into dozens of tiny services. Each one needs its own pipeline, tests and monitoring.
  • Leaving observability until after launch. Debugging across services without tracing is guesswork.
  • Letting each team pick different tools. Nothing is shared, so every service pays the full price.
  • Estimating per service and forgetting shared costs. Queues, logs and registries belong to nobody and cost real money.
  • Splitting before the product is stable. Boundaries drawn too early get redrawn, and each redraw costs a rebuild.

Key takeaways

  • Microservices cost more than a monolith because each service is built, run and watched separately
  • The bill has five parts: the split, infrastructure, observability, team time, and data and messaging
  • Build cost is one-off and front-loaded; running cost is smaller but permanent
  • Estimate per service, then add the shared costs no single team owns
  • A monolith stays cheaper until several teams block each other on one codebase

Frequently asked questions

How much do microservices cost?

There is no fixed figure, because the cost depends on the number of services, the traffic and the team. As a planning guide, a dozen services typically cost a few thousand dollars a month to run, plus the one-off build cost. Get both numbers from your own estimate before deciding.

Are microservices always more expensive than a monolith?

At first, usually yes, because each service adds infrastructure and upkeep. Over time the answer depends on how the system grows. If services scale independently and teams ship without waiting on each other, the extra cost buys speed. If not, it buys overhead.

What is the biggest hidden cost of microservices?

Observability. Following one request across many services needs logging, tracing and dashboards that a monolith gets almost for free. Teams often budget for the services and forget the tooling that makes them debuggable, which is where the surprise bill comes from.

How many services should a system have?

As few as the product needs. Start from the jobs the system does, such as payments, search and accounts, and make one service per job that changes on its own schedule. Dozens of tiny services usually mean the boundaries were drawn around code, not around the business.

Can a small team afford microservices?

Usually not at first. A team of two or three engineers spends more time keeping services running than building the product. A monolith lets a small team move fast, and the split can wait until the team and the system are big enough to feel the pain of one codebase.

When should a monolith be split?

When teams start blocking each other: deployments wait on other teams, a change in one area breaks another, and releases slow down. If none of that is happening, the monolith is still working. Split when the delay costs more than the infrastructure will.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: software products in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a microservices build and want a realistic budget? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Custom Software Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call