Monolith to Microservices: A Step-by-Step Migration Strategy

Most microservices migrations fail for the same few reasons: wrong boundaries, a big-bang rewrite, and a data layer nobody planned. Here is a sequenced playbook that ships value every few weeks and lets you stop whenever the math stops working.

4 min read7 sectionsJune 22, 2026

Written by

Kostadin Stamboliev

Founder and Imaginator

Founder and Imaginator at Pineido. Practitioner across IT consulting, app and web development, technical SEO, and AI / automation. Ships production code in 30-day sprints with fixed scope and clear ownership.

LinkedIn

First, decide if you should migrate at all

The honest answer for many teams is: not yet. The CNCF 2025 survey found roughly 42% of organizations that adopted microservices are pulling some services back into larger units because the operational cost outran the benefit. A common practitioner threshold: under about 30 developers or a monolith under 100K lines, microservices usually add cost with little payoff. Migrate when multiple teams are blocked editing the same codebase, when one feature has genuinely different scaling needs than the rest, or when a capability needs its own dedicated team and release cadence. If the driver is just 'monoliths feel old,' fix the modularity inside the monolith first (a modular monolith) and skip the distributed-systems tax.

Use the strangler fig pattern, not a big-bang rewrite

Full rewrites are the most reliable way to fail: long timelines, tripled cloud bills, and production failures nobody can isolate because everything changed at once. The strangler fig pattern, named by Martin Fowler back in 2004, grows the new system around the old one and retires the monolith piece by piece. You introduce a facade (usually your API gateway or a routing layer like Istio or an Envoy-based proxy) that intercepts every request. At first it routes nearly everything to the monolith. As you extract each feature, you flip its route to the new service. Users never see a flag day. And at every step the old code path is still there, which is your instant rollback if the new service misbehaves.

Draw boundaries by business domain, not technical layer

The number-one cause of failed migrations is splitting by technical layer: a UI service, a logic service, a database service. That produces a distributed monolith, all the network overhead with none of the independence. Split by business capability instead: Orders, Inventory, Payments, Notifications. The fastest way to find those lines is an Event Storming workshop (Alberto Brandolini's technique): get domain experts and engineers in a room, map what happens in the system as a timeline of events, then group them. Bounded contexts emerge where the language changes. 'Product' in a catalog context (name, images, SEO) is a different thing than 'Product' in inventory (SKU, warehouse, reorder threshold). Size them around behavior, not entities, or you end up with anemic services that do nothing on their own.

Start at the edges, then work inward

The instinct is to extract the 'easy' core first: auth, user management, the central domain model. Resist it. Those are exactly the pieces everything else depends on, so breaking them breaks the whole system. Start at the edges, the leaf features with few inbound dependencies and clear API boundaries. A reporting endpoint, a notifications worker, a PDF or export job, a public read-only API. These give you a real production win, prove the pipeline (gateway routing, deploy, observability), and build the executive buy-in you need to finish. Picking a low-risk first slice is also what keeps a migration from stalling into a permanent half-and-half Frankenstein, the most common way these projects quietly die.

Split the data with CDC, not dual writes

Data is the hardest part of every migration, and dual writes (have the app write to both the old and new database) are a trap: concurrent writes silently lose data and you have no transaction guarantee across two stores. Use log-based change data capture instead. Debezium (2.x and newer, with PostgreSQL, MySQL, MongoDB, SQL Server, and Oracle connectors) reads the database transaction log and emits an event for every committed change, so the new service can build and stay in sync with its own datastore without touching the monolith's write path. Recent versions added lock-free incremental snapshots and better exactly-once semantics. For new services that need to publish their own events reliably, pair CDC with the outbox pattern: write the business row and the event row in one local transaction, and let CDC propagate it. And accept the real tradeoff up front: cross-service ACID transactions are gone. Where you used to wrap everything in one transaction, you now design for eventual consistency with sagas.

Cut over one feature at a time and verify in parallel

Per feature, the loop is: extract the service, point a small slice of traffic at it through the gateway, and run the old and new paths side by side while you compare results. Traffic-splitting tooling (Istio, Linkerd, or an Envoy gateway) lets you shift 1%, then 10%, then 100%, and roll back in seconds by reverting the route. Stand up observability before extraction, not after the first incident: structured logs, distributed tracing (OpenTelemetry), and per-service metrics in Prometheus or your APM of choice. The reason teams regret microservices is usually operational, replacing one app with fifty means roughly fifty times the deploys, logs, and dashboards, so the platform has to be ready before the services arrive. Once a feature has run cleanly at full traffic, delete the dead code path in the monolith. Only when the last feature is out do you decommission the monolith. The goal is a clear endgame, not two systems you babysit forever.

Set realistic timelines and a stop condition

Independent analyses of enterprise migrations put the typical end-to-end timeline at roughly 18-36 months for a large system, with a handful of risk factors (boundaries, data, operational maturity) responsible for most failures. Budget for the platform work, not just the services: CI/CD, container orchestration, tracing, and on-call all have to mature in parallel. Just as important, define a stop condition in advance. Because the strangler approach delivers working software every few weeks, you are allowed to pause once the painful parts are out and the rest of the monolith is fine where it is. Partial migration is a legitimate, often optimal outcome. The failure is not stopping early; it is grinding through services that never needed to move.

Get operations insights weekly

Join service-business operators who get one actionable insight on ops, automation, and growth every week.

Checking that you're human. You can send in a moment.

No spam. Unsubscribe anytime.

You’re subscribed! Look for our next issue in your inbox.

Frequently asked questions

What is the strangler fig pattern in a migration?

It is an incremental approach where you grow new services around the existing monolith and retire it piece by piece. A routing layer (usually your API gateway) sits in front, sends most traffic to the monolith, and you flip each feature's route to a new service once it is ready and verified. There is no flag day, and the old code path is your rollback at every step.

How long does a monolith to microservices migration take?

For a large enterprise system, independent analyses put the typical timeline at roughly 18-36 months end to end, including the platform work (CI/CD, orchestration, observability) the services depend on. Because the strangler approach ships value every few weeks, you get benefits long before the full migration is done, and you can stop once the high-value services are out.

How do you split a shared database across services?

Avoid dual writes, which lose data under concurrency. Use log-based change data capture (for example Debezium reading the transaction log) so a new service can build and sync its own datastore without touching the monolith's writes. Pair it with the outbox pattern for reliable event publishing, and design for eventual consistency with sagas instead of cross-service transactions.

Which service should I extract first?

Start at the edges, not the core. Pick a leaf feature with few inbound dependencies and a clean boundary, like reporting, notifications, or an export job. Extracting auth or the central domain model first is risky because everything depends on it. An early, low-risk win proves the pipeline and keeps the migration from stalling.

Should I migrate to microservices at all?

Only if you have a real problem microservices solve: multiple teams blocked on one codebase, a feature with genuinely different scaling needs, or a capability that needs its own team and cadence. Around 42% of adopters (CNCF 2025) are consolidating services back. If your team is small or the monolith is modest, a modular monolith usually delivers most of the benefit with none of the distributed-systems overhead.

Why do most microservices migrations fail?

Three recurring causes: splitting by technical layer instead of business domain (creating a distributed monolith), attempting a big-bang rewrite where no failure can be isolated, and underestimating data and operational complexity. Wrong boundaries are the most common. Use Event Storming to find domain boundaries, the strangler pattern to migrate incrementally, and stand up observability before you extract anything.

Ready to ship?

Tell us where you are stuck. We will review it and send a focused recommendation within one business day.