This project demonstrates a Domain-Driven Design (DDD) architecture combined with an Event-Driven communication model.
It leverages RabbitMQ for asynchronous messaging, Redis Cache for read optimization, and FluentValidation for strong input validation.
- Contains core business logic.
- Implements Aggregates, Entities, Value Objects, Domain Events.
- Free of infrastructure concerns.
- Implements use cases (CQRS: Commands & Queries).
- Uses FluentValidation for input validation.
- Publishes Domain Events β dispatched to RabbitMQ.
- Handles persistence (SQL / MongoDB).
- Integrates with RabbitMQ for event publishing/consuming.
- Implements Redis Cache pipeline for high-performance reads.
- Exposes REST / gRPC endpoints.
- Flow: Request β Validation β Application Layer β Domain β Response (with optional caching).
- Example:
UserFollowedEvent
raised in domain. - Converted to Domain Event β published to RabbitMQ.
- Used for read-side CQRS optimization.
- Common use cases:
- Caching user profiles.
- Caching follower/following counts.
- Storing frequently queried read models.
- Integrated as pipeline behavior β check cache before hitting database.
- All commands/queries validated before domain execution.
- Supports both sync & async validation.
- Prevents invalid commands from polluting domain logic.
- Clean separation of concerns with DDD.
- Loose coupling via Event-Driven architecture.
- Performance boost with Redis cache.
- Strong validation with FluentValidation.
- Scalable and maintainable solution.