An advanced approach to software architecture

An advanced approach to software architecture diagram

Control Code project aims to propose an advanced approach to software architecture that offers many benefits and is fairly easy to implement, as well as an application framework that provides a fast start application template and set of modules with standard features, extensible design, and flexible user configuration abilities.

Framework based on most reliable software development patterns: transaction script and Domain Driven Design. It uses extensible layered application design and facilitates further application evolution.

A growing set of packages that implement common subdomains allow one to quickly extend application functionality with minimal code.

Advanced architecture approach benefits

  • Evolving with requirements
  • Scalability and performance
  • Consistency and reliability
  • Low processing latencies
  • Easy refactoring
  • Cloud friendly
  • Traceability and monitoring

How it works

  • Gateway — accepts commands and events from external systems, filters and preprocesses them, and puts them in the event store in some order. Supports scalability and provides high availability using multiple instances.
  • Event sourcing — commands and events stored by the gateway part in the event store can be processed asynchronously by processing units.  Processing units may be implemented as stateless or stateful microservices. In order to increase throughput processing units may scale using data partitioning.
  • CQRS — command query segregation pattern provides separation of concerns and reads 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.

One of the important elements of this approach is to store the results of processing (domain model state changes and domain events) first of all in the event store in one atomic operation, which ensures consistency, but with low latency, unlike the outbox pattern.

Creating a new system using this approach is not so hard

Just a few simple steps:

  • Define your domain and users
  • Divide the domain into subdomains (use bounded contexts) for implementation as microservices
  • Use 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, use the domain model in some microservices
  • Make the most of existing packages for implementing infrastructure
  • Use reporting database pattern to handle complex reports and queries separate from your model’s state store
  • Add event streams and workers if you need some high load or heavy processing
  • That’s it