2.3 KiB
2.3 KiB
Phase 5: Infrastructure Adapters
Overview
Implement infrastructure adapters for caching (Redis), event bus (Kafka), background job scheduling (asynq), and multi-tenancy support.
Tasks
5.1 Cache Implementation
- 5.1.1 - Install Redis Client
- 5.1.2 - Create Cache Interface
- 5.1.3 - Implement Redis Cache
- 5.1.4 - Add Redis Config
- 5.1.5 - Register in DI Container
- 5.1.6 - Add Cache Middleware
5.2 Event Bus Implementation
- 5.2.1 - Create Event Bus Interface
- 5.2.2 - Implement In-Process Bus
- 5.2.3 - Implement Kafka Bus
- 5.2.4 - Add Kafka Config
5.3 Background Job Scheduler
- 5.3.1 - Install Asynq
- 5.3.2 - Create Scheduler Interface
- 5.3.3 - Implement Asynq Scheduler
- 5.3.4 - Add Cron Support
5.4 Multi-tenancy Support
- 5.4.1 - Create Tenant Resolver Interface
- 5.4.2 - Implement Tenant Resolver
- 5.4.3 - Add Tenant Middleware
- 5.4.4 - Update Ent Queries
Deliverables Checklist
- Redis cache adapter implemented
- Event bus supports in-process and Kafka
- Background job scheduler with asynq
- Cron job support
- Multi-tenancy resolver and middleware
- Database queries scoped by tenant
Acceptance Criteria
- Cache operations work with Redis fallback
- Events can be published to Kafka
- Background jobs can be scheduled
- Cron jobs run on schedule
- Tenant isolation works for database queries
- Middleware extracts tenant from request