Monolithic architectures
It is common to distinguish between monolithic and microservice architectures in modern architecture. However, this is a very rough generalization, as there are many implementations of both monolithic and microservice architectures.
There are many perspectives on what constitutes a monolith. Most commonly, monoliths are defined from a deployment standpoint, meaning applications that must be deployed in a single cycle and can only function when all deployment stages are completed. A monolith is also often considered to be a system with tightly coupled modules or components.
Important! A monolith is not inherently bad, but it has its own nuances.
Monoliths can be categorized as:
- Single process monolith
- Modular monolith
- Distributed monolith
Key challenges:
- Vertical scaling only
- Inability to maintain dynamic forward progress
- Team conflicts
- Bottleneck orientation (deployment can't proceed until all participants have finished their work)
- A quick start doesn’t guarantee success
- Onboarding new people is problematic
- Tight coupling and cohesion
Coupling and Cohesion
- Code coupling
- Implementation coupling
- Temporal coupling (synchronization)
- Deployment coupling
It’s difficult to understand the architecture or spot monolithic tendencies at the code level. Therefore, analyzing the architecture should start with application diagrams (diagrams can be based on the C4 model). The minimum requirement is class diagrams.
To grasp the concept of a monolithic structure, it's useful to explore different abstractions. A good analogy is the anatomy of the human body.
The general idea is to first transition to a modular monolith and then to a service-based or microservice architecture, with the following options:
- Monolith duplication (load balancing)
- Growing a new architecture alongside the old one
- Premature transition to modularity
Monolithic tendencies can be maintained within a service architecture, but you can avoid issues related to development and scaling (service-oriented approach).
- Contracts
- Independence
With the correct system granularity, a monolithic architecture can be operated within a service architecture framework.
A microservice, in essence, is a "micro-monolith," and flexibility is achieved through the interaction of many small monoliths.
Key elements to consider in microservice architecture:
- API
- Load balancing
- Orchestration and choreography
- Failure resilience
- Gateway
- Monitoring
- Configuration system
- Microservice discovery
Comments
Post a Comment