What are the drawbacks of a monolithic architecture with a distributed SQL database like InnoDB or Citus as opposed to microservices?

Viewed 44

A Microservices architecture has its ups and downs. It can ease the workflow at scale, especially with large projects where each team is assigned a service to work with, but it also comes with additional complexity, network latency and compromises when it comes to referential integrity. With the current rise of horizontally scalable managed SQL databases like Citus Data (for Postgres) and InnoDB (for MySQL), what are exactly the drawbacks of a monolithic architecture with multiple servers that all route their request to the same database master node?

As i see things, both the application and the database can scale horizontally (while maintaining a stateless monolithic architecture for the webserver, and thus avoiding extensive messaging between services). The load balancer would route incoming traffic based on the computing/networking capacity (using health checks) of the instances. Each and every webserver would be fully capable of managing incoming requests without requiring any compromise on the referential integrity of the data, without requiring communications with an external service, without requiring any hacks to notify or request data from another service.

As for the maintainability side of things, it is true that a microservices architecture makes working in large teams more efficient than a conventional backend but if DDD is properly applied, the domain layer (and arguably the application layer too) can be modularized and designed to reflect the team or project structure. Having multiple domain projects based on the same logic as a set of services would make the workflow just as easy (i guess). Each team would work on it's own module, which can then be pushed as a package throughout all the instances of the API.

What are the problems inherent to this architecture and why would you advise against it?

PS: I am a novice developer still trying to figure things out. I especially struggles to understand the benefits or added value provided by a microservices architecture in 2022.

Thank you in advance for your input.

1 Answers

It really depends on the problems you want to solve with this architecture, but in theory, by choosing ACID compliant databases (as opposed to BASE) you are trading High Availability for Strong Consistency.

Regarding Monolith vs Microservices architectural style, there are lots of other aspects (like constraints and nonfunctional requirements) that might/should influence your choice.

Related