
The Control Code project aims to propose an advanced approach to software architecture that offers many benefits and is fairly easy to implement. It also provides an application framework with a fast-start application template, a set of modules with standard features, an extensible design, and flexible user configuration capabilities.
The framework is based on the most reliable software development patterns: Transaction Script and Domain-Driven Design (DDD). It uses an extensible layered application design and facilitates further application evolution.
A growing set of packages implementing common subdomains allows you to quickly extend application functionality with minimal code.
Benefits of this Advanced Architecture Approach
- Evolving with requirements: The architecture adapts easily to changing business needs.
- Scalability and performance: Designed to handle growth and high loads efficiently.
- Consistency and reliability: Ensures data integrity and dependable system operation.
- Low processing latencies: Optimized for quick response times.
- Easy refactoring: The structure supports code improvements without breaking functionality.
- Cloud-friendly: Native support for cloud environments and deployment strategies.
- Traceability and monitoring: Built-in mechanisms to track system behavior and health.
How It Works
Gateway: Accepts commands and events from external systems, filters and preprocesses them, and places them in the event store. It supports scalability and provides high availability using multiple instances.
Event Sourcing: Commands and events stored by the gateway in the event store can be processed asynchronously by processing units. Processing units may be implemented as stateless or stateful microservices. To increase throughput, processing units may scale using data partitioning.
CQRS: The Command Query Responsibility Segregation pattern provides separation of concerns and allows read scaling independent of processing.
Reporting Database: Allows you to serve complex queries, primarily using data normalization.
Event Choreography: Provides overall processing synchronization and communication between different parts of the domain model.
A key element of this approach is storing the results of processing (domain model state changes and domain events) in the event store in a single atomic operation. This ensures consistency while maintaining low latency, unlike the outbox pattern.
Creating a New System
Creating a new system using this approach is straightforward. Follow these simple steps:
- Define your domain and users.
- Divide the domain into subdomains (use bounded contexts) for implementation as microservices.
- Use the WebApi host template.
- Define generic subdomains and use ready-made solutions for them.
- Implement the first version of the core domain as microservices using a simple transaction script.
- If needed, incorporate the domain model in specific microservices.
- Make the most of existing packages for implementing infrastructure.
- Use the Reporting Database pattern to handle complex reports and queries separate from your model’s state store.
- Add event streams and workers if you need to handle high loads or heavy processing.
- That’s it!