Prompting guidesInfrastructure
Infrastructure terms for AI prompting
Contents
- How to prompt with these
- 1. Infrastructure as code and state
- 2. Immutable infrastructure and configuration management
- 3. Compute models
- 4. Networking: DNS and addressing
- 5. Load balancing and traffic management
- 6. TLS, CDNs and caching
- 7. Availability, failure domains and disaster recovery
- 8. Timeouts, retries and overload
- 9. Capacity and autoscaling
- 10. Observability: metrics, logs and traces
- 11. SLOs, alerting and toil
- 12. CI/CD and deployment strategies
- 13. Release control and GitOps
- 14. Cost
- 15. Testing and verifying infrastructure
- Sources
Each term below is an established infrastructure name with the document or tool it comes from and a ready prompt line with numbers. Every section opens with the vague ask it replaces. The numbers are starting points. Change them to fit your traffic, budget and risk.
Containers and Kubernetes, databases and security have their own guides: containers and Kubernetes, databases and security. This guide links to them instead of repeating them.
How to prompt with these
Name the term, give it a number, and say how you will check the result. A model that hears “high availability” picks its own definition. A model that hears “3 zones, each at 66% of tested capacity, survive one zone loss” builds what you meant.
- Name the platform and the tool. “Terraform 1.x on AWS” and “a Cloudflare Worker” produce different code for the same idea. Say which one you use.
- Give the budget numbers up front. Write the SLO, the recovery point objective, the recovery time objective and a monthly cost cap in the first lines of the prompt. Every later choice depends on them.
- Plan before apply. Ask for the plan output or a dry run first, and say that nothing is applied or deleted without your review.
- Ask for idempotent, declarative output. A second run of the same code must change nothing. Put that in the acceptance criteria.
- One layer per prompt. Network, then compute, then the deploy pipeline, then monitoring. A single prompt for everything gives shallow work on each layer.
- Name the failure you care about. “Survive the loss of one zone” or “a bad deploy reaches at most 5% of users” tells the model where to spend effort.
- Keep secrets out of the prompt and the code. Ask for references to a secret manager. The security guide covers this.
- End with checks you can run in a few minutes. A command, a URL, a dashboard number or a forced failure that proves the change works.
A template to copy:
Build <component> with <tool and version> on <platform>.
Targets: SLO <value>, RPO <value>, RTO <value>, budget <amount per month>.
Requirements:
- <term>: <value + unit>, <one-line behaviour>
- <term>: <value + unit>, <one-line behaviour>
Show the plan or dry run first. Do not apply or delete anything.
Idempotent: a second run reports no changes.
Acceptance: <2-3 checks I can run, with the expected output>.
Don't change unrelated resources.
1. Infrastructure as code and state
Instead of “set up my servers in code”, name the tool, where state lives, how changes are reviewed and how drift is caught. Terraform’s names are used below because they are the most widely known. OpenTofu uses the same ones, and Pulumi and CloudFormation have direct equivalents.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Infrastructure as code, IaC | Infrastructure is defined in versioned files and created by a tool, never by clicking in a console | Terraform, OpenTofu, Pulumi, CloudFormation | “Define every resource in Terraform under infra/. Nothing is created by hand in the console.” |
| Declarative configuration | The files describe the end state and the tool works out the steps. Imperative scripts list the steps instead | Terraform, Kubernetes | “Use declarative Terraform resources. Use no provisioner or shell script unless no resource type exists, and tell me when you do.” |
| State file | The tool’s record that maps each declared resource to the real object’s ID. It can contain secrets | Terraform state docs | “Store state in a remote backend, encrypted at rest, readable only by the CI role. Never commit terraform.tfstate.” |
| Remote backend | State kept in shared storage so a team and CI read the same copy | Terraform state docs | “Use an S3 backend with bucket versioning on, so any earlier state version can be restored.” |
| State locking | A lock on state during any write, so two runs can’t corrupt it | Terraform state locking docs | “Enable locking in the backend. CI fails the job if it can’t get the lock. Never pass -lock=false.” |
| Force unlock | Manual removal of a stuck lock. Removing someone else’s live lock allows two writers | Terraform state locking docs | “Document force-unlock in the runbook as a last step, for our own stuck lock only.” |
| Plan and apply | Plan shows the diff between code and real infrastructure. Apply executes it | Terraform | “CI runs terraform plan -out=tfplan on every pull request and posts the plan as a comment. After merge, apply runs that saved plan only.” |
| Drift | The real infrastructure was changed outside the code | Terraform drift tutorial | “Run terraform plan -refresh-only nightly. Open an issue with the diff when it shows any change.” |
| Idempotence | Running the same code twice gives the same result, and the second run changes nothing | Ansible glossary, Terraform | “Acceptance: a second apply straight after the first reports 0 to add, 0 to change, 0 to destroy.” |
| Module | A reusable bundle of resources with inputs and outputs | Terraform | “Wrap the network in a module with inputs cidr_block and zone_count. Pin the module version.” |
| Version pinning and lock file | Provider and module versions are fixed, so the same code gives the same plan next month | Terraform dependency lock file | “Pin providers with ~> constraints and commit .terraform.lock.hcl.” |
| State per environment | Dev, staging and prod each have their own state, so a dev change can’t touch prod | Common practice | “Separate state files and separate cloud accounts for dev, staging and prod. Same modules, different variable files.” |
| Import | Brings a resource that was made by hand under code control | Terraform import blocks | “Write import blocks for the existing DNS zone and records. The plan after import must show no changes.” |
| Destroy protection | A setting that makes the tool refuse to delete a resource | Terraform lifecycle prevent_destroy | “Set lifecycle prevent_destroy = true on the database, the state bucket and the DNS zone.” |
| Small state, small blast radius | Splitting state by component, so one apply can only break one component | Common practice | “Split state into network, data and app. A change to the app state must never plan a change to the database.” |
2. Immutable infrastructure and configuration management
Instead of “keep my servers up to date”, decide whether servers are patched in place or replaced, and how a new one gets built.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Snowflake server | A server that was changed by hand so often that nobody can rebuild it | Martin Fowler, 2012 | “No manual SSH changes. Everything a server needs comes from the image or the config repo.” |
| Configuration drift | Packages and files on running servers slowly diverge from what the configuration says | Kief Morris, Immutable Server, 2013 | “Report any package or file on a host that differs from the image manifest.” |
| Immutable server | A server that is never modified after deploy, only replaced by a new one | Kief Morris on martinfowler.com, 2013 | “Changes ship as a new image. Running instances are replaced, never patched in place.” |
| Phoenix server | A server rebuilt from its base image on a schedule, so rebuilding stays routine | Martin Fowler, 2012 | “Replace every instance at least every 14 days, even with no code change.” |
| Golden image | A prebuilt machine image with the OS, patches, agents and app installed | HashiCorp Packer | “Build the image with Packer from a pinned base image and tag it with the git commit SHA.” |
| First-boot configuration | Settings applied when an instance starts, from user data | cloud-init | “cloud-init only fetches secrets and starts the service. Everything else is baked into the image.” |
| Configuration management | A tool that brings servers to a declared state and keeps them there | Ansible, Puppet, Chef | “Use Ansible roles. On a host that is already configured, ansible-playbook —check —diff reports no changes.” |
| Config in the environment | Settings that change per deploy live in environment variables, separate from code | The Twelve-Factor App | “Read every per-environment setting from environment variables. The repo must be safe to make public with no credentials in it.” |
| Dev/prod parity | Development, staging and production differ as little as possible | The Twelve-Factor App | “Staging uses the same image, the same modules and the same managed services as prod, at smaller sizes.” |
| Patch cadence | How often base images are rebuilt with security updates | Common practice | “Rebuild the base image weekly and on any critical CVE in an installed package. Roll it out through the normal canary.” |
3. Compute models
Instead of “host my app somewhere”, pick the compute model, because it decides what you patch, how you scale and what a cold request costs.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| IaaS, PaaS, SaaS | The three cloud service models: you run the OS, you run only the app, or you only use the software | NIST SP 800-145 | “Target PaaS: deploy a container to a managed run service. No VMs to patch.” |
| Rapid elasticity | Capacity can be added and released quickly, often automatically | NIST SP 800-145 | “Scale from 2 to 20 instances without manual steps.” |
| Virtual machine | A full guest OS on shared hardware. You own patching and the boot time | Cloud providers | “One instance type, 2 vCPU and 4 GiB, in an autoscaling group across 3 zones.” |
| Container | A process packaged with its files and isolated from the host. See the containers guide | OCI, Docker | “Package the app as one OCI image that runs as a non-root user and listens on port 8080.” |
| Serverless function | Code that runs per event while the platform manages servers and scaling | AWS Lambda | “Write it as a Lambda handler. Create clients and read config outside the handler so warm invocations reuse them.” |
| Cold start | The first request on a new execution environment waits for code download and setup | AWS Lambda docs: under 1% of invocations, under 100 ms to over 1 s | “Keep init under 1 s: lazy-load heavy SDKs and log Init Duration for every cold start.” |
| Init phase limit | Lambda’s startup step is limited to 10 s, except with provisioned concurrency or SnapStart | AWS Lambda docs | “Nothing in module scope makes a network call that can take more than 2 s.” |
| Provisioned concurrency | Execution environments that are set up ahead of time, so requests skip the cold start | AWS Lambda docs | “Provisioned concurrency of 5 on the checkout function only. Every other function scales from zero.” |
| Edge isolate | Code that runs in a V8 isolate in each data center of a CDN. Cloudflare says an isolate starts about 100 times faster than a Node process in a container | Cloudflare Workers docs | “Write it as a Cloudflare Worker. Keep no mutable state in global scope, because isolates are not long-lived.” |
| Stateless service | No data is kept in the process between requests, so any instance can serve any request | The Twelve-Factor App | “Keep sessions in Redis, not in memory. Killing any one instance loses no user data.” |
| Spot or preemptible capacity | Spare capacity at a discount that the provider can take back. EC2 gives a 2 minute warning | EC2 Spot interruption docs | “Run batch workers on Spot. Poll the instance metadata spot/instance-action every 5 s and drain the worker on a notice.” |
| Scale to zero | No instances run, and nothing is billed for compute, when there is no traffic | Serverless platforms | “Scale to zero after 15 minutes idle. A first request after idle may take up to 2 s, and that is acceptable.” |
4. Networking: DNS and addressing
Instead of “point my domain at the app” or “set up the network”, give the record types, the TTLs and the address plan.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| A, AAAA and CNAME records | A and AAAA map a name to an IPv4 or IPv6 address. A CNAME makes a name an alias of another name | RFC 1034, RFC 1035 | “www is a CNAME to the CDN hostname. The apex uses an A and AAAA record or the provider’s ALIAS record, since a CNAME can’t sit at the apex.” |
| TTL | How many seconds a resolver may cache a DNS answer | RFC 1035 | “Lower the record’s TTL to 60 s at least one old TTL before the migration. Raise it back to 3600 s afterwards.” |
| Negative caching | Resolvers also cache “this name does not exist”, for the lower of the SOA MINIMUM field and the SOA’s own TTL | RFC 2308 | “Set the SOA minimum to 300 s, so a record created after a failed lookup resolves within 5 minutes.” |
| Authoritative and recursive DNS | The authoritative server owns the zone. A recursive resolver looks names up and caches them for clients | RFC 1034 | “Host the zone on the provider’s authoritative DNS. Clients use their normal recursive resolver.” |
| Split-horizon DNS | The same name returns a private address inside the network and a public one outside | Common practice | “api.internal resolves only inside the VPC. Nothing outside can resolve it.” |
| CIDR block | An address range written as prefix and length, such as 10.0.0.0/16 | RFC 4632 | “VPC 10.0.0.0/16. One public /24 and one private /24 per zone. No overlap with the office range 192.168.0.0/16.” |
| Public and private subnet | A public subnet has a route to the internet gateway. A private subnet does not | Cloud provider VPC docs | “Load balancer in public subnets. App and database in private subnets with no public IPs.” |
| NAT gateway | Lets instances in private subnets make outbound connections without accepting inbound ones | Cloud provider VPC docs | “One NAT gateway per zone, so losing one zone doesn’t cut outbound traffic for the other two.” |
| Default deny | All traffic is blocked unless a rule allows it. See the security guide | Common practice | “Default deny inbound. Allow 443 to the app only from the load balancer’s security group.” |
| Anycast | One IP address is announced from many locations, and the network routes each user to the nearest one | Cloudflare learning center | “Serve DNS and the edge from anycast addresses. Clients never hold per-region IPs.” |
| Egress | Traffic leaving a network or region, usually billed per GB | Cloud provider pricing | “Keep app and database in the same zone set and region. Flag every design choice that adds cross-region or internet egress.” |
5. Load balancing and traffic management
Instead of “make it handle more traffic” or “add a load balancer”, say which layer it works at, how it checks health and what happens to requests during a deploy.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Layer 4 load balancer | Balances TCP or UDP connections without reading the request | Cloud provider docs, OSI model | “Layer 4 load balancer for the raw TCP game server on port 7777.” |
| Layer 7 load balancer | Reads HTTP requests and routes by host, path or header | Cloud provider docs | “Route /api/* to the API target group and everything else to the web target group.” |
| Health check | The load balancer probes each target and stops sending traffic to failing ones | Cloud provider docs | “GET /healthz every 10 s, 2 s timeout. Unhealthy after 3 failures, healthy again after 2 successes.” |
| Shallow and deep health check | A shallow check proves the process answers. A deep check also tests dependencies, and can pull every target at once when a shared dependency fails | Common practice | “/healthz checks only the process. Database health goes to a separate metric and alert, not the load balancer check.” |
| Connection draining | A target leaving the pool finishes in-flight requests before it stops. AWS calls it deregistration delay | Cloud provider docs | “Deregistration delay 30 s. On SIGTERM the app stops accepting new requests and exits once in-flight requests finish.” |
| Least outstanding requests | Send each request to the target with the fewest requests in progress | Cloud provider docs | “Use least outstanding requests, because request times vary by 10x between endpoints.” |
| Consistent hashing | Maps keys to targets so adding or removing one target moves only a small share of keys | Karger et al., 1997 | “Route by consistent hash of the user ID, so a cache node change remaps about 1/N of users.” |
| Sticky sessions | The load balancer sends one client to the same target every time | Cloud provider docs | “No sticky sessions. Session state lives in the shared store.” |
| DNS failover | DNS answers switch to a standby endpoint when health checks on the primary fail | Route 53, Cloudflare load balancing | “Failover routing: primary region with a health check, secondary takes traffic after 3 failed checks 30 s apart.” |
| Latency-based routing | DNS sends each user to the region with the lowest measured latency | Route 53 | “Latency-based records for us-east and eu-west. Each region also has a health check.” |
| Rate limiting | Caps the requests a client may make in a time window | Common practice | “Limit each client IP to 100 requests per minute on /login. Return 429 with a Retry-After header.” |
6. TLS, CDNs and caching
Instead of “make it secure and fast”, say where TLS terminates, how certificates renew, and what the CDN may cache and for how long.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| TLS termination | The point where encrypted traffic is decrypted, such as the CDN, the load balancer or the app | Common practice | “Terminate TLS at the load balancer and re-encrypt to the targets. No plain HTTP inside the VPC.” |
| TLS 1.3 | The current TLS version. A full handshake takes one round trip. RFC 9846, July 2026, obsoletes RFC 8446 and keeps the same version | RFC 8446, RFC 9846 | “Minimum TLS 1.2, prefer 1.3. Report the cipher suites the endpoint accepts.” |
| 0-RTT early data | A returning client sends data in its first flight. That data has no replay protection between connections | RFC 8446 section 2.3 | “Disable 0-RTT on every endpoint that changes state. Allow it only on cacheable GETs.” |
| ACME | The protocol that lets a server prove domain control and get certificates automatically | RFC 8555, Let’s Encrypt | “Issue and renew certificates with ACME. No certificate step is done by hand.” |
| Certificate lifetime | The maximum validity of public TLS certificates drops from 398 days to 47 days between March 2026 and March 2029 | CA/Browser Forum ballot SC-081 | “Alert when any certificate has under 14 days left, and test renewal in staging every month.” |
| HSTS | A response header that tells browsers to use HTTPS only for a set time | RFC 6797 | “Send Strict-Transport-Security: max-age=31536000; includeSubDomains, after confirming every subdomain serves HTTPS.” |
| CDN and origin | The CDN caches content at edge locations. The origin is the server it fetches from on a miss | CDN providers | “Static assets come from the CDN. The origin gets only cache misses and API calls.” |
| Cache hit ratio | The share of requests the CDN answers without asking the origin | CDN providers | “Report cache hit ratio for /assets. Target above 95%.” |
| Cache-Control max-age | How many seconds a response stays fresh. s-maxage sets it for shared caches only | RFC 9111 | “Hashed asset files: Cache-Control: public, max-age=31536000, immutable. HTML: Cache-Control: no-cache.” |
| stale-while-revalidate | A cache may serve a stale response for a set time while it fetches a fresh one in the background | RFC 5861 | “Product pages: max-age=60, stale-while-revalidate=30.” |
| stale-if-error | A cache may serve a stale response when the origin returns 500, 502, 503 or 504 | RFC 5861 | “Add stale-if-error=86400 to product pages, so an origin outage shows yesterday’s page instead of an error.” |
| Cache key | The parts of a request that decide whether two requests share a cached response | CDN providers | “Cache key is the path plus the lang query parameter. Strip utm_* parameters before caching.” |
| Purge | Removing cached objects before they expire | CDN providers | “Deploys purge only the changed HTML paths. Hashed assets are never purged.” |
| Origin shield | One CDN tier that collects misses from all edges, so the origin sees one request per object. Also called tiered caching | CDN providers | “Turn on tiered caching so a cold object causes one origin fetch, not one per edge location.” |
7. Availability, failure domains and disaster recovery
Instead of “make it highly available”, name the failure domain you must survive, how much capacity stays after it fails, and how much data you may lose.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Failure domain | A set of things that fail together: a host, a rack, a zone, a region | Common practice | “List every failure domain in this design and what happens to traffic when each one fails.” |
| Availability zone | One or more data centers in a region with separate power and networking | Cloud providers | “Spread instances across 3 zones. No zone runs more than 40% of instances.” |
| Single point of failure | One component whose failure stops the whole service | Common practice | “Find every single point of failure in this diagram, including DNS, NAT and the CI runner.” |
| N+1 redundancy | Enough capacity to lose one unit and still carry full load | Common practice | “Size for N+1 at the zone level: peak load fits on 2 of the 3 zones.” |
| Static stability | The system keeps working when a dependency is impaired, without needing to make changes. AWS overprovisions 50% across 3 zones, so each runs at 66% | Amazon Builders’ Library | “Run 3 zones at 66% of tested capacity each, so a zone loss needs no new instances.” |
| Bimodal behavior | The system behaves differently in normal and failure modes, such as launching new instances only during a failure | AWS Well-Architected REL11-BP05 | “Failover must not depend on launching instances or calling the control plane.” |
| Control plane and data plane | The control plane makes changes, such as create or resize. The data plane serves the actual traffic | Amazon Builders’ Library | “Recovery uses data plane actions only. Note every control plane API the failover path calls.” |
| Cell-based architecture | Many isolated copies of the workload, called cells, each with its own data, behind a thin router | AWS cell-based architecture whitepaper | “Split customers across 10 cells. A failed cell affects about 10% of customers.” |
| Shuffle sharding | Each customer gets a random combination of workers, so one bad customer rarely shares all its workers with another | Amazon Builders’ Library | “8 workers, each customer gets 2 at random. That gives 28 combinations, so a poison customer affects about 1 in 28 others.” |
| Blast radius | How much of the system one failure or one bad change can affect | Principles of Chaos Engineering, AWS | “State the blast radius of each change in the plan summary.” |
| Availability nines | Availability as a percentage. 99.9% allows 43.2 minutes of downtime a month, 99.99% allows 4.32 | Google SRE book, appendix A | “Target 99.9% monthly. Show the downtime that allows next to each design choice.” |
| Recovery point objective, RPO | How much data, in time, you may lose in a disaster | AWS disaster recovery whitepaper | “RPO 15 minutes: continuous backups or replication with at most 15 minutes of lag.” |
| Recovery time objective, RTO | How long the service may be down before it is restored | AWS disaster recovery whitepaper | “RTO 1 hour, proven by a timed restore drill every quarter.” |
| Backup and restore | The cheapest disaster recovery strategy. You rebuild from backups and code after a disaster | AWS disaster recovery whitepaper | “Daily snapshots copied to a second region and a second account. Restore is scripted end to end.” |
| Pilot light | Data is replicated to a second region, but the app there is off until a disaster | AWS disaster recovery whitepaper | “Pilot light in us-west: replicated database, zero app instances, IaC ready to scale it up.” |
| Warm standby | A smaller, running copy of the whole stack in a second region that can take traffic at once | AWS disaster recovery whitepaper | “Warm standby at 20% capacity. Scale it to 100% as part of failover.” |
| Multi-site active/active | Two or more regions serve live traffic at the same time | AWS disaster recovery whitepaper | “Active/active in two regions. Writes go to one primary region. Document the conflict rule if that changes.” |
| Restore test | Restoring a backup to prove it works and to measure real RTO | Common practice | “Monthly job restores last night’s backup to a scratch account, runs row count checks and records how long it took.” |
8. Timeouts, retries and overload
Instead of “make it more resilient”, say how long each call may take, who retries and how often, and what the service does when it has more work than it can serve. The Google SRE book chapters on overload and cascading failures, and the Amazon Builders’ Library article on retries, are the sources for most of this section.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Timeout from a latency percentile | Set the timeout from the downstream latency at the false-timeout rate you accept. AWS’s example accepts 0.1% and uses p99.9 | Amazon Builders’ Library | “Set each client timeout to the dependency’s p99.9 latency plus 20%. Never leave a library’s default infinite timeout.” |
| Exponential backoff with jitter | Each retry waits longer than the last, with a random part, so clients don’t retry in sync | Amazon Builders’ Library, Google SRE book | “Retry at most 3 times, base delay 100 ms, doubling, full jitter, capped at 2 s.” |
| Retry amplification | Retries at every layer multiply. Three retries at each of five layers gives 243 times the load on the bottom layer | Amazon Builders’ Library | “Retry at one layer only, the one closest to the user. Inner services fail fast.” |
| Retry budget | A cap on retries as a share of all requests. Google’s example retries only while retries are under 10% of requests | Google SRE book, Handling Overload | “Per client, allow retries only while they are under 10% of requests in the last minute.” |
| Idempotency key | A client-supplied ID that lets the server recognize a repeated request and return the first result | Amazon Builders’ Library | “POST /payments requires an Idempotency-Key header. Repeats within 24 h return the stored response.” |
| Deadline propagation | Each call passes the remaining time budget downstream, so no service works on a request the caller has given up on | Google SRE book, Addressing Cascading Failures | “Pass the remaining deadline in a header. Each hop subtracts its elapsed time and rejects work when under 50 ms remain.” |
| Cascading failure | A failure that grows through positive feedback, such as overload on one server pushing more load onto the rest | Google SRE book | “Describe how this design behaves when one of the 3 zones fails at peak load.” |
| Load shedding | Rejecting some requests early so the rest are served well | Google SRE book | “Return 503 when more than 200 requests are in flight per instance, before doing any work.” |
| Graceful degradation | Serving a cheaper or partial answer under load instead of an error | Google SRE book | “Under load, show cached recommendations instead of computing fresh ones. Test this path weekly.” |
| Request criticality | Each request carries a priority so the least important work is shed first | Google SRE book, Handling Overload | “Tag requests critical or sheddable. Background sync is sheddable and is dropped first.” |
| Adaptive client throttling | Clients start rejecting their own requests locally when the backend accepts far fewer than they send. Google’s default multiplier is 2 | Google SRE book, Handling Overload | “Client tracks requests and accepts over 2 minutes and drops locally once requests exceed 2 times accepts.” |
| Circuit breaker | A wrapper that stops calling a failing dependency for a while, then lets a test request through | Michael Nygard, Release It! | “Open the circuit after 50% errors over 20 calls. Stay open 30 s, then allow 1 trial call.” |
| Bulkhead | Separate resource pools per dependency, so one slow dependency can’t use all threads or connections | Michael Nygard, Release It!, AWS Well-Architected REL10-BP04 | “Separate connection pools for the payment API and the search API, 20 connections each.” |
| Bounded queue | A queue with a size limit, so waiting work can’t grow without limit. LIFO or CoDel drops requests that have waited too long | Google SRE book | “Request queue holds at most 50% of the worker pool size. Drop requests that waited more than 1 s.” |
9. Capacity and autoscaling
Instead of “make it scale”, say what metric drives scaling, the target value, the limits and how long a new instance takes to be useful.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Headroom | Capacity kept free above current load for spikes and failures | Common practice | “Keep 30% headroom at peak, on top of the N+1 zone reserve.” |
| Target tracking scaling | You pick a metric and a target value, and the autoscaler adds or removes capacity to hold it. It scales in more gradually than out | EC2 Auto Scaling docs | “Target tracking on average CPU at 50%. A second policy on requests per target at 800.” |
| Step scaling | Adds capacity in steps sized by how far a metric is past its alarm threshold | EC2 Auto Scaling docs | “Step scaling on queue depth: +2 instances above 1,000 messages, +5 above 5,000.” |
| Scheduled scaling | Capacity changes at set times | EC2 Auto Scaling docs | “Scale minimum to 6 at 08:30 on weekdays and back to 2 at 20:00 America/New_York.” |
| Predictive scaling | Forecasts load from up to 14 days of history, 48 hours ahead, updated every 6 hours. It scales out on the forecast and never scales in | EC2 Auto Scaling docs | “Predictive scaling in forecast-only mode for 2 weeks. Compare the forecast with actual load before turning on scaling.” |
| Instance warmup | Seconds after launch before a new instance’s metrics count toward scaling decisions | EC2 Auto Scaling docs | “Instance warmup 120 s, matching measured boot plus app start time.” |
| Cooldown | A wait after a simple scaling action before the next one | EC2 Auto Scaling docs | “Use target tracking, not simple scaling, so no cooldown tuning is needed.” |
| Minimum and maximum capacity | Hard limits on group size. The maximum also caps cost | EC2 Auto Scaling docs | “Minimum 3, one per zone. Maximum 30. Alert when the group is at maximum for 10 minutes.” |
| Little’s Law | Items in a system equal arrival rate times time in the system, L = λW | John Little, 1961 | “At 400 requests per second and 250 ms latency, about 100 requests are in flight. Size worker pools from that.” |
| Load test | Driving synthetic traffic to find the point where latency or errors break the SLO | Common practice | “k6 test ramping to 3 times current peak over 20 minutes. Report the request rate where p99 passes 500 ms.” |
| Backlog-based scaling | Scaling workers on queue backlog per worker instead of CPU | Common practice | “Scale workers so backlog per worker stays under 100 messages. Never fewer than 1 worker.” |
| Thundering herd | Many clients act at the same moment, such as all caches expiring at once or all clients reconnecting after an outage | Common practice | “Add ±10% random jitter to every cache TTL and to client reconnect delays.” |
10. Observability: metrics, logs and traces
Instead of “add monitoring”, say which signals to collect per service and per resource, how to label them and how a request is followed across services.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Four golden signals | Latency, traffic, errors and saturation for every user-facing service | Google SRE book, Monitoring Distributed Systems | “Dashboard per service with the four golden signals. Latency of failed requests is a separate line.” |
| RED method | Rate, errors and duration of requests, for every service | Tom Wilkie, Grafana Labs | “Export RED metrics per endpoint: requests per second, errors per second, duration histogram.” |
| USE method | Utilization, saturation and errors, for every resource such as CPU, disk or a connection pool | Brendan Gregg | “For each host and pool, graph utilization, saturation such as queue length, and errors.” |
| Percentiles, not averages | Averages hide the slow tail. Report p50, p95 and p99 from histograms | Google SRE book | “Record request duration as a histogram with buckets from 5 ms to 10 s. Alert on p99, never on the mean.” |
| Saturation signal | How full a resource is. A rising p99 over a short window is an early sign | Google SRE book | “Graph p99 latency over 1 minute windows next to CPU and pool usage.” |
| Black-box and white-box monitoring | Black-box checks what users see from outside. White-box reads the system’s own metrics | Google SRE book | “One external probe hits the login page every 60 s from 3 regions. White-box metrics come from the app.” |
| Structured logging | Logs as key-value records, usually JSON, so they can be filtered by field | Common practice | “JSON logs with timestamp, level, service, trace_id and request_id on every line. No multi-line logs.” |
| Cardinality | The number of unique label combinations in a metric. Labels like user ID create one series per user | Prometheus naming practices | “Metric labels: service, route template, status class. Never user ID, raw URL or request ID.” |
| Distributed trace | The full path of one request through every service it touched | OpenTelemetry | “Instrument with the OpenTelemetry SDK. Every inbound request starts or continues a trace.” |
| Span | One unit of work in a trace, with a start time, duration, attributes and parent span. The root span has no parent | OpenTelemetry | “Create spans for each database query and outbound HTTP call, with db.system and http.route attributes.” |
| Span kind | Server, client, internal, producer or consumer | OpenTelemetry | “Message publishes are producer spans. Queue handlers are consumer spans linked to them.” |
| Context propagation | Passing trace and span IDs across process boundaries so spans join one trace | OpenTelemetry, W3C Trace Context | “Propagate the W3C traceparent header on all HTTP calls and in message attributes.” |
| Trace sampling | Keeping only a share of traces to control cost | OpenTelemetry | “Keep 10% of normal traces and 100% of traces with an error or with latency over 1 s.” |
11. SLOs, alerting and toil
Instead of “alert me when something’s wrong”, define what good looks like as a number, how much failure is allowed, and when a person gets paged.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Service level indicator, SLI | A measured number about the service, such as the share of requests served in under 300 ms | Google SRE book | “SLI: share of HTTP requests with status under 500 and latency under 300 ms, measured at the load balancer.” |
| Service level objective, SLO | The target for an SLI over a time window | Google SRE book | “SLO: 99.9% of requests good over a rolling 30 days.” |
| Service level agreement, SLA | A contract with users that states consequences when SLOs are missed | Google SRE book | “No external SLA yet. Internal SLO only.” |
| Error budget | The failure the SLO allows. At 99.9% over 30 days that is 0.1% of requests | Google SRE book, Embracing Risk | “Show remaining error budget on the dashboard. When it is spent, only fixes and rollbacks deploy.” |
| Burn rate | How fast the error budget is used, relative to the SLO. A burn rate of 1 uses exactly the budget in the window | Google SRE workbook, Alerting on SLOs | “Graph burn rate over 1 hour and 6 hours.” |
| Multiwindow, multi-burn-rate alert | Alert when both a long and a short window burn fast. The short window lets the alert clear soon after errors stop | Google SRE workbook | “Page at burn rate 14.4 over 1 h and 5 m, and at 6 over 6 h and 30 m. Ticket at 1 over 3 days and 6 h.” |
| Symptom-based alerting | Page on what users feel, such as errors and latency, not on causes such as high CPU | Google SRE book | “No pages on CPU or memory. Those go to dashboards and tickets.” |
| Actionable page | Every page needs a human action now. Anything else is a ticket | Google SRE book | “Each alert links a runbook and states the first action. Alerts without one are tickets.” |
| Runbook | Written steps for a known alert or task | Common practice | “Write runbooks/ |
| Toil | Manual, repetitive, automatable work with no lasting value that grows with the service. Google caps it at 50% of an SRE’s time | Google SRE book, Eliminating Toil | “List the manual steps in our deploy and rotation work, how often each happens, and which to automate first.” |
| Blameless postmortem | A written review of an incident focused on causes and fixes, not on who made the mistake | Google SRE book | “Postmortem template: summary, impact, timeline in UTC, root causes, what went well, action items with owners.” |
12. CI/CD and deployment strategies
Instead of “set up deploys”, say how an artifact is built and promoted, how traffic moves to a new version and what triggers a rollback.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Continuous integration | Every change is merged often and verified by an automated build and tests | Common practice | “On every pull request: build, unit tests, lint and terraform plan. Merge is blocked until all pass.” |
| Continuous delivery and deployment | Delivery keeps every change ready to release. Deployment releases every passing change automatically | Common practice | “Continuous deployment to staging. Production deploys after one approval in the pipeline.” |
| Build once, promote | One artifact is built per commit and the same artifact moves through every environment | Common practice | “Build the image once, tagged with the commit SHA. Staging and prod deploy that exact digest.” |
| Pipeline as code | The CI/CD pipeline is defined in a file in the repo | GitHub Actions, GitLab CI | “Define the pipeline in .github/workflows/deploy.yml. No settings that live only in the CI web UI.” |
| Rolling deployment | Instances are replaced with the new version a batch at a time | Common practice | “Replace 25% of instances at a time. Wait for health checks to pass before the next batch.” |
| Blue-green deployment | Two production environments. Deploy to the idle one, test it, switch the router, and switch back to roll back | Martin Fowler, 2010 | “Blue-green: deploy to green, run smoke tests, switch the load balancer, keep blue running 1 hour for instant rollback.” |
| Canary release | A new version gets a small share of traffic first and is compared with the old version | Danilo Sato on martinfowler.com, Google SRE workbook | “Canary at 5% for 30 minutes. Compare error rate and p99 with the current version, not with yesterday.” |
| Canary metrics | The few numbers that decide whether a canary passes. Google suggests no more than about a dozen | Google SRE workbook, Canarying Releases | “Canary passes only if error rate, p99 latency and CPU per request are within 10% of the control group.” |
| One canary at a time | Running one canary at a time keeps the cause of a regression clear | Google SRE workbook | “The pipeline blocks a second canary while one is running.” |
| Automated rollback | The pipeline reverts on its own when a health or SLO check fails | Common practice | “If the canary fails, route 100% back to the old version and fail the pipeline. No human step.” |
| Expand and contract | Schema changes ship in steps that work with both old and new code. See the databases guide | Martin Fowler, ParallelChange | “Add the new column first, deploy code that writes both, backfill, switch reads, then drop the old column in a later release.” |
| Smoke test | A short check right after deploy that the main paths work | Common practice | “After deploy, curl /healthz and run a login and checkout script. Roll back on any failure.” |
| DORA metrics | Five delivery metrics. Throughput: change lead time, deployment frequency, failed deployment recovery time. Instability: change fail rate, deployment rework rate | DORA | “Report the five DORA metrics weekly from pipeline and incident data.” |
13. Release control and GitOps
Instead of “let me turn features on safely” or “keep the cluster in sync with git”, say which kind of flag, who flips it and what reconciles the running system.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Feature flag | Code paths switched at runtime without a deploy | Pete Hodgson on martinfowler.com | “Wrap the new checkout behind the flag checkout_v2, default off.” |
| Release toggle | Hides unfinished work in production. Should live a week or two | Pete Hodgson on martinfowler.com | “Release toggles carry an expiry date. CI fails when a toggle is past its date.” |
| Ops toggle or kill switch | Lets operators turn off a costly or risky feature quickly. A few kill switches live long | Pete Hodgson on martinfowler.com | “Add a kill switch that turns off recommendations within 30 s, without a deploy.” |
| Experiment toggle | Splits users into groups for A/B testing | Pete Hodgson on martinfowler.com | “Assign users to the experiment by hash of user ID, 50/50, stable across sessions.” |
| Permission toggle | Turns features on per user or plan. Can live for years | Pete Hodgson on martinfowler.com | “Beta features check a per-account permission, not a global flag.” |
| Toggle debt | Old flags pile up and make code harder to change. Treat them as inventory with a carrying cost | Pete Hodgson on martinfowler.com | “List every flag with its owner and age. Open removal tickets for release toggles older than 30 days.” |
| GitOps | Desired state is declarative, versioned and immutable, pulled automatically by agents and continuously reconciled | OpenGitOps principles 1.0 | “Use GitOps: the cluster pulls from the deploy repo. CI never pushes to the cluster.” |
| Reconciliation loop | An agent compares actual state with desired state and corrects the difference, again and again | OpenGitOps, Kubernetes controllers | “Sync every 3 minutes. Report any manual change it reverts.” |
| Pull-based deployment | An agent inside the environment pulls changes. Push-based means CI holds credentials to the environment | OpenGitOps | “Pull-based deploys, so CI holds no production credentials.” |
| Policy as code | Rules checked automatically against plans and manifests | Open Policy Agent | “Check the Terraform plan JSON with OPA in CI: no public buckets, no 0.0.0.0/0 on port 22, every resource tagged owner.” |
14. Cost
Instead of “keep the bill low”, give the unit you measure cost against, the tags that assign spend to owners and the commitments you accept.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Unit economics | Cost per unit of business value, such as per request, per active user or per order | FinOps Foundation | “Report cost per 1,000 requests and per active user each month, next to total spend.” |
| Usage optimization | Using fewer resources for an acceptable result | FinOps Foundation | “Find instances under 20% average CPU for 14 days and propose a smaller size.” |
| Rate optimization | Paying less for the resources you do need, such as commitment discounts | FinOps Foundation | “Model a 1-year compute commitment covering 60% of the steady baseline. Show break-even.” |
| Cost allocation tags | Labels on resources that assign spend to a team, service or environment | FinOps Foundation, cloud providers | “Every resource has owner, service and env tags. CI policy blocks untagged resources.” |
| Showback and chargeback | Showback reports each team’s spend. Chargeback bills it to their budget | FinOps Foundation | “Monthly showback report per team from the owner tag.” |
| Budget alert | A notice when actual or forecast spend passes a threshold | Cloud providers | “Budget $300 a month. Alert at 50%, 80% and 100% of actual, and at 100% of forecast.” |
| Cost anomaly | Spend that jumps outside its normal pattern | Cloud providers | “Daily anomaly check on spend per service. Alert on a 30% jump over the 7-day average.” |
| Right-sizing | Matching instance size to measured use | FinOps Foundation | “Right-size from 14 days of p95 CPU and memory, never from peak alone.” |
| Idle resources | Resources that cost money and serve nothing, such as unattached volumes or old snapshots | Common practice | “Weekly report of unattached volumes, idle load balancers and snapshots older than 90 days.” |
| Data transfer cost | Charges for traffic between zones, regions and out to the internet | Cloud provider pricing | “Estimate monthly transfer cost per data flow in this design. Flag cross-zone chatty paths.” |
15. Testing and verifying infrastructure
Instead of “make sure it works”, say how failures are rehearsed and how changes are checked before they reach production.
| Term | What it means | Where it comes from | Prompt line |
|---|---|---|---|
| Chaos engineering | Experiments on a system to build confidence that it withstands turbulent conditions in production | Principles of Chaos Engineering | “Write a chaos experiment that stops one zone’s instances in staging and checks the SLO holds.” |
| Steady-state hypothesis | A measurable normal behavior that the experiment expects to stay the same | Principles of Chaos Engineering | “Steady state: checkout success rate above 99.5% and p99 under 400 ms during the experiment.” |
| Minimize blast radius | Start experiments small and stop them automatically | Principles of Chaos Engineering | “Run the experiment on 5% of traffic with an automatic abort when error rate passes 1%.” |
| Game day | A planned session where the team rehearses a failure and the response to it | Common practice | “Plan a 2-hour game day: fail the primary database over, time detection, response and recovery.” |
| Failover drill | A real switch to the standby region or replica to prove RTO | Common practice | “Quarterly failover drill to the warm standby. Record the time from decision to full traffic.” |
| Policy check in CI | Automated rules run against infrastructure code before merge | Open Policy Agent | “Run conftest on the plan in CI. A violation fails the pull request with the rule name.” |
| Plan review | A person reads the planned changes before apply | Terraform | “Highlight every replace and destroy in the plan summary in bold at the top.” |
| Ephemeral environment | A full short-lived copy of the stack per pull request | Common practice | “Each pull request gets its own stack named pr- |
Sources
Pages opened for this guide. Prompt values not attributed to a source are suggested starting points, meant to be changed.
- Monitoring Distributed Systems, Google SRE book, chapter 6
- Service Level Objectives, Google SRE book, chapter 4
- Embracing Risk, Google SRE book, chapter 3
- Availability Table, Google SRE book, appendix A
- Eliminating Toil, Google SRE book, chapter 5
- Handling Overload, Google SRE book, chapter 21
- Addressing Cascading Failures, Google SRE book, chapter 22
- Alerting on SLOs, Google SRE workbook, chapter 5
- Canarying Releases, Google SRE workbook, chapter 16
- Timeouts, retries and backoff with jitter, Amazon Builders’ Library
- Static stability using Availability Zones, Amazon Builders’ Library
- Workload isolation using shuffle-sharding, Amazon Builders’ Library
- Disaster recovery options in the cloud, AWS whitepaper
- What is a cell-based architecture?, AWS whitepaper
- REL11-BP05 Use static stability to prevent bimodal behavior, AWS Well-Architected
- Dynamic scaling and Target tracking scaling policies, EC2 Auto Scaling
- How predictive scaling works, EC2 Auto Scaling
- Spot Instance interruption notices, Amazon EC2
- Lambda execution environment lifecycle, AWS Lambda
- How Workers works, Cloudflare
- What is anycast?, Cloudflare learning center
- State and State locking, Terraform
- OpenGitOps principles, CNCF OpenGitOps
- DORA’s software delivery performance metrics, DORA
- Immutable Server, Kief Morris
- Phoenix Server and Snowflake Server, Martin Fowler
- Blue Green Deployment, Martin Fowler
- Canary Release, Danilo Sato
- Feature Toggles, Pete Hodgson
- The NIST Definition of Cloud Computing, NIST SP 800-145
- Store config in the environment, The Twelve-Factor App
- RFC 2308: Negative Caching of DNS Queries
- RFC 8446: TLS 1.3 and RFC 9846, which obsoletes it
- RFC 5861: HTTP Cache-Control Extensions for Stale Content
- Ballot SC-081v3, CA/Browser Forum
- The RED Method, Tom Wilkie, Grafana Labs
- The USE Method, Brendan Gregg
- Traces and specification overview, OpenTelemetry
- FinOps phases and FinOps principles, FinOps Foundation
- Principles of Chaos Engineering
Standards and books named in the tables but not opened for this guide: RFC 1034, RFC 1035, RFC 4632, RFC 9111, RFC 6797, RFC 8555, Michael Nygard’s Release It!, and Karger et al. on consistent hashing.