In modern enterprise modular monoliths, foundational building blocks dictate overall architectural resilience.
The building-blocks/ directory compiles the production-tested building blocks powering BitzOrcas.Modern. Every block enforces “Typed Contracts, Zero Unnecessary Reflection, Multi-Tenant Safety, and Secure Defaults”.
Building Blocks Map
Building Block Directory
1. Core Domain Primitives and Clocks
Entity,AggregateRoot, andTenantAggregateRoothierarchies;- Typed
ResultandErrorflow control; - Deterministic
IAppClockpreventing timezone drift.
2. Unified Aggregate Root and Persistence Kernel
- Eliminate redundant 1:1
*EntityandMapperboilerplate; - Roslyn generators emit EF Core and SqlSugar configurations during compilation;
- Value object flattening and automatic audit interceptors.
3. Standard List Query Kernel and QueryShape
IDeclareQueryShapedeclarative shapes with compile-time execution plans;- Dual-ORM projections pushed down to SQL column levels;
- Normalized paging boundaries (1 to 1000).
4. Event Bus and CAP Outbox
- In-process domain events vs cross-module integration events;
- Transactional Outbox pattern guaranteeing atomic writes and zero message loss;
- Idempotent consumer deduplication.
5. Multi-Level Caching with FusionCache
- In-memory L1 and Redis L2 tiered caching;
- Negative caching and single-flight stampede defense;
- Post-commit tag-based invalidation.
6. Distributed Locking and Deadlock Prevention
IDistributedLocktyped handles withawait usingdisposal;- Redis atomic acquisition and owner-checked Lua releases;
- Lease renewals and fallback degradation policies.
7. Database-Driven Background Jobs (Quartz)
- Scheduler-agnostic
IJobExecutor<T>handlers; - Quartz clustered persistence guaranteeing single-instance execution;
- Operations probes and graceful shutdown.
8. S3 Object Storage and Presigned URLs
IFileStorageunified port (Local / MinIO / S3);- Presigned direct uploads with zero API bandwidth overhead;
- Multi-tenant bucket security and IDOR defense.
9. Tenant Quotas and Rate Limiting
- Token bucket algorithm and burst allowances;
- Host-level RedisTokenBucket rate limiting plus PlatformBilling
QuotaServicequota checks; - Graceful 429 Too Many Requests enforcement.
10. OpenAPI 3.1 and Scalar Modern Documentation
[GenerateEndpoint]compile-time metadata extraction;- Zero reflection under Native AOT;
- Modern, interactive Scalar API console.
Chapter Navigation
- 01/16
Core building block
Current contracts for Entity, AggregateRoot, TenantAggregateRoot, Result, Error, domain events, query value objects, platform limits, and clocks.
- 02/16
Unified Aggregate and Persistence Kernel
A comprehensive architectural deep dive into why BitzOrcas.Modern eliminated the traditional Entity + Mapper + Aggregate boilerplate, and how the compile-time ORM Fluent Configuration Generator achieves zero-reflection dual-ORM parity.
- 03/16
List-query and export-range contract
The W0 list-query envelope, composed paging, range filter value objects, QueryShape scalar expansion, remote options, related snapshots, and export-range validation.
- 04/16
Persistence building block
Unified aggregates, compile-time ORM configuration, Command/ReadModel/Query ports, and production-parallel SqlSugar/EF Core contracts.
- 05/16
Shared Foundation Building Block
Source-verified ownership rules and reference for Result, errors, time, caller, tenancy, and seed infrastructure.
- 06/16
Standard List Query Kernel and QueryShape
A deep architectural dive into the BitzOrcas.Modern standard list query kernel, uncovering compile-time execution plan generation, multi-table alias decoupling, custom basePredicate injection, and dual-ORM projection pushdown.
- 07/16
Multi-Level Caching and Stampede Protection with FusionCache
Explore the BitzOrcas.Modern caching architecture. Learn how FusionCache L1 in-memory and L2 Redis caching, CacheScope isolation, and tag invalidation prevent cache stampedes.
- 08/16
Distributed Locking and Deadlock Prevention: IDistributedLock Deep Dive
Explore the BitzOrcas.Modern distributed locking core. Learn atomic acquisition, owner-checked Lua releases, lease renewals, and fallback strategies.
- 09/16
Eventing Building Block
Reference for CAP, RabbitMQ, SQL Server Outbox, topic contracts, consumer idempotency, and failed-message operations.
- 10/16
Database-Driven Background Jobs and Quartz Execution Safety
Say goodbye to fragile Linux cron scripts! Learn how BitzOrcas.Modern implements scheduler-agnostic IJobExecutor, Quartz clustered persistence, and graceful execution shutdown.
- 11/16
Eventing Abstractions
Distinguish domain events, integration events, and notification ports, including collection, topic resolution, and Null-adapter boundaries.
- 12/16
Object Storage and S3 Integration: IFileStorage Deep Dive
Explore the BitzOrcas.Modern object storage architecture. Learn how IFileStorage, MinIO/S3 adapters, presigned direct uploads, and tenant security eliminate server bandwidth bottlenecks.
- 13/16
Quotas and Rate Limiting: Host Token Bucket & Billing Quota
Tell apart the Host-level Redis token bucket limiter from the PlatformBilling quota check: where 429 belongs, how QuotaService.Check works, usage submission commands, and idempotent usage facts.
- 14/16
Modern API Documentation with OpenAPI 3.1 and Scalar
Say goodbye to heavy Swashbuckle reflection! Learn how BitzOrcas.Modern implements compile-time OpenAPI 3.1 metadata extraction and modern Scalar API references for Native AOT.
- 15/16
Multi-Channel Message Delivery: From Facts to Fanout
Explore the BitzOrcas.Modern message delivery engine. Learn how notification persistence, CAP transactional outbox, and email/SMS/IM connectors decouple external I/O.
- 16/16
Web and API Infrastructure: Minimal API Generation and Middleware Topology
Explore the BitzOrcas.Modern Web API foundation. Learn [GenerateEndpoint] compile-time Minimal API bindings, ASP.NET Core middleware ordering, and RFC 9457 Problem Details.