Most companies that migrate to microservices do it too early. A monolith that works is better than microservices that are half-built. Before migrating, ask: what specific problem will microservices solve that you cannot fix in your current architecture?
Valid reasons to migrate: different parts of your system need to scale independently, multiple teams are blocked by merge conflicts and deployment dependencies, or you need different technology stacks for different components. Invalid reasons: "everyone is doing it," "it will make us more agile," or "our architecture is getting complex." Microservices add operational complexity. Make sure the benefits outweigh the costs.
Do not rewrite your monolith from scratch. That approach has a failure rate above 70% in our experience. Use the strangler fig pattern instead: gradually replace parts of the monolith with new services, one piece at a time.
The process:
The hardest part of microservices is deciding where to draw the boundaries. Do it wrong and you end up with services that are too chatty (making dozens of API calls to each other for a single user action) or too large (defeating the purpose of splitting).
Use domain-driven design (DDD) bounded contexts as a starting point. A bounded context is a part of your system where a particular domain model applies. "Users" might mean different things in your billing system vs your product: billing cares about payment methods and subscription status, while the product cares about preferences and activity.
A practical test: if two pieces of functionality need to share the same database table, they probably belong in the same service. If they can operate with eventual consistency between them (updates can take a few seconds to propagate), they can be separate services.
Before migrating, make sure your team can operate microservices:
If you do not have these capabilities today, build them before migrating. Microservices without observability is flying blind in a thunderstorm.
12-24 months for a typical medium-sized monolith. The first service takes 2-3 months because you are also building infrastructure. Subsequent services take 4-8 weeks each. Do not try to rush it.
One per bounded domain context, which typically means 5-15 for a mid-size B2B application. Having 100+ services for a 50-person engineering team is a red flag. A common rule of thumb: one team should own 2-3 services.
Data consistency. When you split a database, you lose transactional guarantees between the parts. Design for eventual consistency from the start and identify the few operations that truly need strong consistency.
Trabajamos con empresas en toda Europa en proyectos de software development projects. Cuéntanos en qué estás trabajando.
Contáctanos