Midaz Architecture
Midaz employs a robust, modern architecture designed to ensure scalability, flexibility, and maintainability
The system leverages key architectural patterns and best practices that make it adaptable to various use cases while maintaining high performance and clarity in design, as shown in Figure 1.
Modular Design
Midaz is built with a modular design, ensuring that each component of the system is self-contained and easily maintainable. This modularity promotes the ability to scale specific services independently, making it easier to adapt the system as new requirements emerge without disrupting other parts of the architecture.
Microservices Architecture
At its core, Midaz follows a microservices architecture, where each service or component operates independently, but communicates through well-defined, lightweight interfaces such as APIs. This approach:
- Encourages service autonomy: Each microservice can be developed, deployed, and scaled independently.
- Enhances resilience: Failure in one component does not directly affect others, contributing to system robustness.
- Supports technology diversity: Different microservices can use different technologies suited to their specific needs.
This architecture aligns with Midaz's goals of handling complex transactions and integrations efficiently.
CQRS (Command Query Responsibility Segregation)
Midaz uses CQRS (Command Query Responsibility Segregation) to further optimize its architecture, separating the handling of commands (write operations) from queries (read operations). This clear distinction allows the system to optimize each function independently, boosting performance, scalability, and maintainability.
- Commands: Operations that change the system's state, such as creating new records or processing transactions.
- Queries: Operations that retrieve data without altering the system, such as fetching user information or viewing account balances.
CQRS is a design pattern that divides the responsibility for modifying data (commands) from retrieving data (queries). This division brings several advantages:
- Performance optimization: Read and write operations can be scaled and optimized independently.
- Clarity: Simplifies system architecture by separating concerns, making the system easier to reason about and maintain.
- Flexibility: Enables the use of different models for reading and writing, improving efficiency.
In Midaz, CQRS is further reinforced with a port-adapter architecture, enabling seamless integration with internal and external services.
Why CQRS?
The choice of CQRS in Midaz stems from its need to handle complex transactions in a scalable and performant way. By adopting CQRS, Midaz achieves:
- Scalability: Efficient handling of high volumes of transactions and data retrieval operations.
- Separation of concerns: Simplifies the architecture, making the system easier to maintain and enhance over time.
- Optimized data storage: Allows different databases or storage models for reads and writes, improving overall system performance.
- Event-driven capabilities: Enables better management of distributed events, ensuring real-time processing and consistency across the system.
Updated 15 days ago