Rules for designing, building and operating microservices systems
Целевые файлы
Файл
Формат
.cursorrules
plaintext
CLAUDE.md
markdown
Содержимое
Each service must own its own database; never share a database between two services.
Define service boundaries around business domains (Bounded Contexts), not technical layers.
Communicate synchronously via HTTP/gRPC only when a real-time response is required.
Use asynchronous messaging (events/queues) for operations that can tolerate latency.
Publish versioned event schemas; never make breaking changes to an existing event version.
Each service must expose a /health endpoint returning current status and dependencies.
Use circuit breakers for all synchronous calls to downstream services.
Propagate trace IDs (W3C Trace Context) across all service boundaries for observability.
Store service configuration in environment variables; use a secrets manager for credentials.
Deploy each service independently; avoid deployment coupling between services.
Write service-level integration tests that use real dependencies, not mocks.
Define and document the SLA for each service (latency p99, availability target).
Implement idempotent consumers for all message queue handlers to handle redelivery.
Use an API gateway for all external traffic; never expose individual services directly.