stack-profile:cqrs-read-model
CQRS Read Model (TypeScript, Elasticsearch, Kafka, PostgreSQL, NestJS, Docker) overview
A CQRS (Command Query Responsibility Segregation) implementation where the write side persists events and aggregates in PostgreSQL through NestJS command handlers, while a separate read side projects denormalized views into Elasticsearch for fast, flexible querying. Kafka transports domain events from the write side to read-model projectors, which build optimized search indices and materialized views. TypeScript ensures type safety across both sides of the CQRS boundary. Docker Compose orchestrates PostgreSQL, Kafka, Elasticsearch, and the application services for local development. The tradeoff is eventual consistency between write and read models and the operational burden of running Kafka and Elasticsearch, but the pattern unlocks independent scaling and optimization of reads and writes.
Attributes
Outgoing edges
- domain:backend·DomainBackend
- domain:software-engineering·DomainSoftware Engineering
- language:typescript·LanguageTypeScript
- framework:nestjs·FrameworkNestJS
- tool:elasticsearch·ToolElasticsearch
- library:prisma·LibraryPrisma
- library:ioredis·Libraryioredis
- library:bullmq·LibraryBullMQ
- tool:docker·ToolDocker
- tool:docker-compose·ToolDocker Compose
- workflow:event-driven-architecture-review·WorkflowEvent-Driven Architecture Review
- workflow:event-storming-session·WorkflowEvent Storming Session
- skill-area:cqrs·SkillAreaCQRS
- skill-area:event-sourcing·SkillAreaEvent Sourcing
- skill-area:search-indexing·SkillAreaSearch and Indexing
- skill-area:kafka-stream-processing·SkillAreaKafka Stream Processing
- skill-area:streaming-realtime-processing·SkillAreaStreaming and Real-time Processing
- role:backend-engineer·RoleBackend Engineer
- role:architect·RoleArchitect
- role:data-engineer·RoleData Engineer