Transform all documentation from modular monolith to true microservices
architecture where core services are independently deployable.
Key Changes:
- Core Kernel: Infrastructure only (no business logic)
- Core Services: Auth, Identity, Authz, Audit as separate microservices
- Each service has own entry point (cmd/{service}/)
- Each service has own gRPC server and database schema
- Services register with Consul for service discovery
- API Gateway: Moved from Epic 8 to Epic 1 as core infrastructure
- Single entry point for all external traffic
- Handles routing, JWT validation, rate limiting, CORS
- Service Discovery: Consul as primary mechanism (ADR-0033)
- Database Pattern: Per-service connections with schema isolation
Documentation Updates:
- Updated all 9 architecture documents
- Updated 4 ADRs and created 2 new ADRs (API Gateway, Service Discovery)
- Rewrote Epic 1: Core Kernel & Infrastructure (infrastructure only)
- Rewrote Epic 2: Core Services (Auth, Identity, Authz, Audit as services)
- Updated Epic 3-8 stories for service architecture
- Updated plan.md, playbook.md, requirements.md, index.md
- Updated all epic READMEs and story files
New ADRs:
- ADR-0032: API Gateway Strategy
- ADR-0033: Service Discovery Implementation (Consul)
New Stories:
- Epic 1.7: Service Client Interfaces
- Epic 1.8: API Gateway Implementation
65 lines
3.2 KiB
Markdown
65 lines
3.2 KiB
Markdown
# Epic 5: Infrastructure Adapters
|
|
|
|
## Overview
|
|
Implement infrastructure adapters (cache, queue, blob storage, email) that services use. These adapters are shared infrastructure components that all services can use. Make adapters swappable via interfaces, add scheduler/background jobs system, and implement event bus (in-process and Kafka).
|
|
|
|
**Note:** gRPC service definitions and clients are already implemented in Epic 1 (Story 1.7) and Epic 2 (each service implements its own gRPC server). Story 5.7 focuses on advanced gRPC features and enhancements.
|
|
|
|
## Stories
|
|
|
|
### 5.1 Cache System (Redis)
|
|
- [Story: 5.1 - Cache System](./5.1-cache-system.md)
|
|
- **Goal:** Implement a complete Redis-based caching system with a clean interface.
|
|
- **Deliverables:** Cache interface, Redis implementation, configuration, DI integration
|
|
|
|
### 5.2 Event Bus System
|
|
- [Story: 5.2 - Event Bus](./5.2-event-bus.md)
|
|
- **Goal:** Implement a complete event bus system supporting both in-process and Kafka.
|
|
- **Deliverables:** Event bus interface, in-process bus, Kafka bus, core events
|
|
|
|
### 5.3 Blob Storage System
|
|
- [Story: 5.3 - Blob Storage](./5.3-blob-storage.md)
|
|
- **Goal:** Implement a complete blob storage system using S3.
|
|
- **Deliverables:** Blob storage interface, S3 implementation, file upload API
|
|
|
|
### 5.4 Email Notification System
|
|
- [Story: 5.4 - Email Notification](./5.4-email-notification.md)
|
|
- **Goal:** Implement a complete email notification system with SMTP support.
|
|
- **Deliverables:** Notification interface, SMTP implementation, email templates, identity integration
|
|
|
|
### 5.5 Scheduler and Background Jobs System
|
|
- [Story: 5.5 - Scheduler & Jobs](./5.5-scheduler-jobs.md)
|
|
- **Goal:** Implement a complete scheduler and background job system.
|
|
- **Deliverables:** Scheduler interface, Asynq implementation, job registry, example jobs
|
|
|
|
### 5.6 Secret Store Integration
|
|
- [Story: 5.6 - Secret Store](./5.6-secret-store.md)
|
|
- **Goal:** Implement secret store integration supporting Vault and AWS Secrets Manager.
|
|
- **Deliverables:** Secret store interface, Vault implementation, AWS implementation, config integration
|
|
|
|
### 5.7 Advanced gRPC Features
|
|
- [Story: 5.7 - Advanced gRPC Features](./5.7-grpc-services.md)
|
|
- **Goal:** Enhance gRPC implementation with advanced features (streaming, advanced error handling, gRPC-Gateway).
|
|
- **Deliverables:** Streaming RPCs, gRPC-Gateway integration, advanced error handling, gRPC middleware
|
|
|
|
**Note:** Basic gRPC service definitions and clients are already implemented in Epic 1 (Story 1.7) and Epic 2 (each service implements its own gRPC server).
|
|
|
|
## Deliverables Checklist
|
|
- [ ] Cache adapter (Redis) working
|
|
- [ ] Event bus (in-process and Kafka) functional
|
|
- [ ] Blob storage (S3) adapter
|
|
- [ ] Email notification system
|
|
- [ ] Scheduler and background jobs
|
|
- [ ] Secret store integration (optional)
|
|
- [ ] Advanced gRPC features (streaming, gRPC-Gateway)
|
|
|
|
## Acceptance Criteria
|
|
- Cache stores and retrieves data correctly
|
|
- Events are published and consumed
|
|
- Files can be uploaded and downloaded
|
|
- Email notifications are sent
|
|
- Background jobs run on schedule
|
|
- gRPC streaming works
|
|
- gRPC-Gateway provides HTTP access to gRPC services
|
|
- Integration test: full infrastructure stack works
|