Part 09 · Distributed Systems

Observability, rollout, security và incident response

Microservices đổi code coupling thành operational coupling; platform và ownership quyết định kiến trúc có vận hành được hay không.

Observability

Metrics theo RED/USE, structured logs với operation/trace/business IDs và distributed tracing có sampling. Trace không thay metric; log không thay durable audit. Đo end-to-end SLO và dependency budget, không chỉ từng service xanh.

Rollout

Backward-compatible API/event/database migration: expand → deploy mixed versions → migrate/backfill → contract. Canary/blue-green cần health theo business signal và rollback plan; rollback code không luôn rollback schema/data.

Security

Service identity, TLS/mTLS theo threat model, least privilege, secret rotation, authn/authz tại đúng trust boundary và audit. Gateway auth không đủ nếu internal network không đáng tin; tránh truyền user token rộng hơn cần thiết.

Incident response

Map critical path, dependency saturation, retries và queue/lag. Giảm load/retry trước khi scale mù; isolate tenant/workload, force breaker khi cần, reconcile unknown outcomes sau recovery. Postmortem tập trung feedback loop và guardrails.

Cost and ownership

Mỗi service cần repo/build/deploy/dashboard/alert/runbook/on-call/data lifecycle. Nếu team không sở hữu trọn vòng đời, số service là liability. Theo dõi cost per request/workflow và platform toil.

Monitoring Distributed Systems · OpenTelemetry Primer · AWS Reliability Pillar