Operations and reliability¶
Build systems that are observable, resilient to failure and cheap to operate.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
- 10 AWS Well-Architected Framework: the review framework for AWS workloads. See also specific/aws.
- 10 Azure Well-Architected Framework: the review framework for Azure workloads.
- 10 Google Cloud Well-Architected Framework: the review framework for Google Cloud workloads.
- 9 The Twelve-Factor App: baseline rules for building deployable, scalable services.
- 9 Google SRE books (free online): service level objectives, monitoring, incident response and postmortems.
- 9 AWS Builders' Library: how Amazon builds and operates resilient distributed systems.
- 9 Azure cloud design patterns: resilience patterns such as Retry, Circuit Breaker, Bulkhead and Queue-Based Load Leveling.
- 9 OpenTelemetry documentation: the vendor-neutral standard for traces, metrics and logs.
Key rules¶
Reliability targets¶
- 8
OPS-2Monitor the four golden signals for every user-facing service: latency, traffic, errors and saturation. (Google SRE book, Monitoring Distributed Systems) - 7
OPS-1Define SLOs from user-facing SLIs, and use the error budget to balance reliability against release speed. (Google SRE book, Service Level Objectives, Embracing Risk, SRE workbook, Implementing SLOs)
Resilience¶
- 9
OPS-3Put a timeout on every remote call, and retry only with capped exponential backoff and jitter. (AWS Builders' Library, Timeouts, retries and backoff with jitter, Azure, Retry pattern) - 8
OPS-4Design to prevent cascading failures, for example with load shedding and by avoiding retry storms. (Google SRE book, Addressing Cascading Failures, AWS Builders' Library, Using load shedding to avoid overload) - 8
OPS-13Run production across at least two independent failure domains, such as availability zones, with enough spare capacity to lose one without scaling up. Platform examples:AWS-3,AZURE-9,GCP-10andK8S-4. (AWS Builders' Library, Static stability using Availability Zones, Azure Well-Architected, Redundancy) - 7
OPS-5Stop calling a failing dependency with a circuit breaker, and isolate resources with bulkheads. (Fowler, Circuit Breaker, Azure, Bulkhead pattern) - 6
OPS-6Avoid fallback paths that are rarely exercised. Prefer designs that keep working the same way during failure (static stability). (AWS Builders' Library, Avoiding fallback in distributed systems, Static stability using Availability Zones) - 5
OPS-7Buffer bursts of load with queues between producers and consumers. (Azure, Queue-Based Load Leveling pattern) - 4
OPS-8Verify resilience with controlled chaos experiments. (Principles of Chaos Engineering)
Operability¶
- 8
OPS-9Keep config in the environment, treat backing services as attached resources, and run stateless processes. For secrets, prefer files that the platform mounts, or reading them from a secrets manager at run time (SEC-2): OWASP advises against plain environment variables for secrets unless nothing else is possible. (OWASP Secrets Management Cheat Sheet, Twelve-Factor App, III Config, IV Backing services, VI Processes) - 8
OPS-14Define infrastructure and platform configuration as code in version control, and change it only through a reviewed pipeline, not by hand in a console or dashboard. Manual changes drift and can't be reproduced. Platform examples:AWS-4,AZURE-10,GCP-11,TF-11,K8S-13andHOST-10. (Fowler, Infrastructure as Code, Azure Well-Architected, Infrastructure as code design) - 7
OPS-10Expose health endpoints that load balancers and orchestrators can probe. (Azure, Health Endpoint Monitoring pattern) - 7
OPS-11Instrument with OpenTelemetry and follow its semantic conventions, so telemetry is portable and correlated. (OpenTelemetry, Observability primer, Semantic conventions) - 7
OPS-12Run blameless postmortems and track their action items. (Google SRE book, Postmortem Culture) - 7
OPS-15Make processes disposable: onSIGTERM, stop taking new work, finish or hand back the work in flight, and exit within the platform's grace period. Platform examples:K8S-3,NODE-9andDOCKER-6. (Twelve-Factor App, IX Disposability) - 7
OPS-16Write structured logs that carry the trace context, to stdout or through a log appender, and ship them to a central store with the retention you need. Platform examples:NODE-10,OTEL-5,AZURE-12,GCP-12andHOST-13. (Twelve-Factor App, XI Logs, OpenTelemetry, Logs, OWASP Logging Cheat Sheet) - 7
OPS-17Set a spending limit on every cloud account, project and paid third-party service, and where the provider offers no hard limit, billing alerts that reach the owners, so that an attack can't run up unlimited charges. Platform examples:AZURE-13,GCP-13,FIREBASE-15andSUPABASE-14. (OWASP API Security Top 10, API4:2023 Unrestricted Resource Consumption)
Tutorials and further reading¶
- 8 Site Reliability Engineering, table of contents: the full SRE book, free online.