Architecture - quandis/qbo3-Documentation GitHub Wiki
QBO enables a hybrid of architectural approaches, enabling basic patterns like CRUD and REST mixed with CQRS and GraphQL-like retrieval of data.
REST
Most RESTful platforms expect routes to be defined in compiled code. QBO support this, but goes a step further by enabling configuration-driven routes as well. The CustomRoute
configuration sections enables mapping to new or existing endpoints dynamically, without the need for new code deployments.
For example, assume you wish to update your inventory whenever Fedex sends you a webhook notification of a particular product delivery.
Traditional Steps | Time | QBO Steps | Time |
---|---|---|---|
- Create a stored procedure to update inventory | 10 min | - Create a stored procedure to update inventory | 10 min |
- Extend a class with a method to call the stored procedure | 10 min | - Configure a Service entry to call the stored procedure | 1 min |
- Restrict access to the method with a permissions attribute. | 3 min | - Configure a Custom Route entry to the stored procedure | 3 min |
- Deploy to a test environment and, er, test. | 30 min | - Test in, er, test environment | 3 min |
- Promote to production | 1 day | - Promote to production. | 1 min |
Command and Query Responsibility Segregation (CQRS)
Simple object relational models like Entity Framework typically used in MVC-style architectures are easy to develop, understand, and maintain, but they are not easy to fine-tune for enterprise-level performance. QBO's statement pattern enables scaffolding of code for CRUD operations where appropriate, and streaming bulk operations where preferable.