15 DevOps Tips for Building Resilient Systems

15 resilience tips: timeouts, retries with jitter, circuit breakers, bulkheads, zone spread, PodDisruptionBudgets, honest probes and restore tests.

Dec 31, 2025 - 15:09
Nov 5, 2026 - 21:57
 0  72
15 DevOps Tips for Building Resilient Systems

A resilient system keeps serving users, perhaps in a reduced form, when parts of it fail. DevOps teams get there by designing for failure: bounded timeouts, retries with backoff and jitter, circuit breakers, spread across failure domains, honest health checks, graceful shutdown, load shedding, tested backups and regular failure drills. The fifteen tips below are design and configuration habits you can apply to services you run today, with Kubernetes examples where they help.

This guide focuses on how services are built and configured. Release safety (canaries, feature flags and rollbacks) is covered in deployment rollback strategies, and team practices such as SLOs and postmortems in SRE practices for DevOps teams.

Key takeaways

  • Most large outages are cascades: one slow dependency ties up threads, retries multiply load, and healthy services fall over too. Most tips here break that chain.
  • Every network call needs a timeout, and retries need a budget, backoff and jitter.
  • Spread replicas across zones and protect them during maintenance with PodDisruptionBudgets.
  • Liveness probes that check dependencies can turn a database blip into a restart storm. Keep liveness checks shallow.
  • A backup you have never restored is a hope, not a plan. Test restores on a schedule.

The 15 tips at a glance

#TipFailure it addresses
1Map failure domains firstHidden single points of failure
2Set a timeout on every callThreads stuck on a slow dependency
3Retry with backoff, jitter and a budgetRetry storms
4Add circuit breakersCalling a dependency that is already down
5Isolate resources with bulkheadsOne feature starving the rest
6Make writes idempotentDuplicate orders or payments after retries
7Design for graceful degradationWhole page failing for one widget
8Shed load before you collapseOverload taking down every request
9Spread replicas across zonesZone or node loss
10Use PodDisruptionBudgetsMaintenance draining all replicas
11Write honest health probesRestart storms and traffic to unready pods
12Shut down gracefullyDropped requests during deploys
13Set resource requests and limits deliberatelyNoisy neighbours and OOM kills
14Test restores, not just backupsData loss you discover too late
15Run failure drillsUntested assumptions

Design the failure model

1. Map failure domains before you add redundancy

A failure domain is everything that fails together: a node, a rack, an availability zone, a region, a shared database, a DNS provider, a single CI runner that every deploy depends on. List them for one critical user journey (for example, "log in and check out") and mark each dependency as redundant or single. The result shows where a second copy actually helps. Two replicas on the same node, or two services sharing one database, still have one failure domain.

The AWS Well-Architected Reliability Pillar and the Google SRE book both treat this as the starting point. A simple spreadsheet is enough: dependency, failure domain, what happens when it is gone, how long until users notice.

2. Put a timeout on every network call

Many HTTP clients and database drivers default to long or unlimited timeouts. When a dependency hangs, each waiting request holds a thread or connection, and the caller runs out of capacity even though it is healthy. Set connect and request timeouts explicitly, and keep them shorter than the caller's own deadline so there is time to return a fallback.

A useful rule is to start from the dependency's observed latency (for example, its 99.9th percentile) plus some headroom, then adjust from real data. Pass deadlines downstream where your framework supports it, so a backend does not keep working on a request the user has already abandoned.

3. Retry carefully: backoff, jitter and a retry budget

Retries hide brief faults, but immediate retries from many clients multiply load on a struggling service. The Amazon Builders' Library article on timeouts, retries and backoff describes the standard fix: exponential backoff with jitter, so clients spread retries out instead of hitting the service in synchronised waves.

import random, time

def call_with_retries(fn, attempts=4, base=0.2, cap=5.0):
    for attempt in range(attempts):
        try:
            return fn()
        except TransientError:
            if attempt == attempts - 1:
                raise
            # "full jitter": sleep a random time up to the exponential cap
            time.sleep(random.uniform(0, min(cap, base * 2 ** attempt)))

Retry only errors that are likely to be temporary (timeouts, 503s, connection resets), never validation errors. Retry at one layer of the stack, not at every layer, or three layers of three retries become 27 calls. A retry budget (for example, retries may add at most 10 percent to normal traffic) stops retries from becoming the outage.

4. Add circuit breakers

A circuit breaker tracks failures to a dependency. After too many, it "opens" and fails calls immediately for a cooling-off period, then lets a few test requests through. This protects both sides: the caller stops wasting threads, and the struggling dependency gets room to recover. Libraries such as Resilience4j (Java) and Polly (.NET) implement the pattern in code; service meshes such as Istio can apply outlier detection and connection limits at the proxy layer.

5. Isolate resources with bulkheads

Ships have bulkheads so one flooded compartment does not sink the vessel. In software, give each dependency or feature its own connection pool, thread pool or queue, so a slow recommendation service cannot exhaust the pool that checkout also uses. In Kubernetes, separate critical and batch workloads with namespaces, resource quotas and, where needed, dedicated node pools.

6. Make writes idempotent

Once you retry, some requests will arrive twice. If "create order" runs twice, you get two orders. Accept an idempotency key from the client (a unique ID per logical operation), store it with the result, and return the stored result when the same key arrives again. Message consumers need the same care, because most queues deliver at least once.

Keep serving under stress

7. Design for graceful degradation

Decide in advance which features are optional. A product page can show without reviews, personalised recommendations can fall back to a cached "popular items" list, and search can return slightly stale results from a cache. Wrap optional calls so their failure returns a default instead of an error page. Write the degraded behaviour down and test it, so on-call engineers know it is expected.

8. Shed load before you collapse

A server pushed past capacity often slows for everyone until it fails for everyone. Load shedding rejects some requests early (for example, with HTTP 429 or 503) so the rest still succeed. Rate limits at the gateway, concurrency limits per instance and queue length caps are common tools. The Google SRE book chapter on addressing cascading failures covers this in depth, including prioritising important traffic over background work.

Platform-level tips for Kubernetes

9. Spread replicas across zones and nodes

Three replicas help only if they land in different places. Topology spread constraints tell the scheduler to balance pods across zones and nodes.

spec:
  replicas: 3
  template:
    spec:
      topologySpreadConstraints:
        - maxSkew: 1
          topologyKey: topology.kubernetes.io/zone
          whenUnsatisfiable: DoNotSchedule
          labelSelector:
            matchLabels:
              app: checkout

Check that stateful dependencies follow the same rule. A multi-zone application in front of a single-zone database still loses service when that zone goes. For a refresher on how the scheduler and control plane fit together, see Kubernetes architecture components.

10. Protect availability during maintenance with PodDisruptionBudgets

Node upgrades and cluster autoscaler scale-downs evict pods voluntarily. A PodDisruptionBudget limits how many pods of an application can be down at once from those voluntary disruptions.

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: checkout-pdb
spec:
  minAvailable: 2
  selector:
    matchLabels:
      app: checkout

A PDB does not protect against involuntary failures such as a node crash, and a PDB that allows zero disruptions can block node drains entirely. Set it so maintenance can still proceed one pod at a time.

11. Write honest health probes

Kubernetes has three probe types. A startup probe gives slow-starting containers time before other probes begin. A readiness probe decides whether a pod receives traffic. A liveness probe decides whether the container is restarted.

ProbeQuestion it answersShould it check dependencies?
startupProbeHas the app finished starting?No
readinessProbeCan this pod serve requests right now?Sometimes, with care
livenessProbeIs the process stuck and in need of a restart?No

The classic mistake is a liveness probe that calls the database. When the database has a brief problem, every pod fails liveness, every pod restarts, and the service is down long after the database recovers. Keep liveness to "is this process responsive" and handle dependency trouble with timeouts, breakers and readiness.

12. Shut down gracefully

During a rolling update, Kubernetes sends SIGTERM and waits for the termination grace period (30 seconds by default) before forcing the container to stop. The application should stop accepting new work, finish in-flight requests and close connections cleanly within that window. Because endpoint removal and SIGTERM happen in parallel, many teams add a short preStop sleep so load balancers stop sending traffic before the app stops listening.

spec:
  terminationGracePeriodSeconds: 45
  containers:
    - name: app
      lifecycle:
        preStop:
          exec:
            command: ["sh", "-c", "sleep 10"]

13. Set resource requests and limits deliberately

Requests tell the scheduler how much CPU and memory a pod needs; limits cap what it may use. Without requests, pods get packed onto nodes that cannot sustain them. Memory limits that are too low cause OOM kills under normal peaks. Base both on observed usage, review them after major releases, and alert on OOM kills and CPU throttling so you see the problem before users do.

Prove it works

14. Test restores, not just backups

Backup jobs that report success can still produce unusable data: missing tables, unencrypted keys stored elsewhere, or a restore process nobody remembers. Schedule restore tests into a separate environment, measure how long they take, and compare the result with your recovery time and recovery point objectives (RTO and RPO). Keep at least one copy outside the main account or region so a single compromised credential cannot delete everything.

15. Run failure drills and chaos experiments

The Principles of Chaos Engineering describe experiments that start from a steady-state hypothesis ("checkout success rate stays above our SLO"), introduce a real-world failure, and look for a difference. Start small and in a test environment: kill one pod, add latency to one dependency, block one zone. Game days, where the team practises an incident with runbooks in hand, test the people side as well. Each drill should end with fixes, not just a report.

Drills only help if you can see what happened. Make sure dashboards and alerts cover error rates, latency and saturation for every critical path; the observability tools guide and incident alert automation tools cover the tooling.

Where to start

If you can only do three things this quarter, do these: add explicit timeouts and capped retries to your most critical service, spread its replicas across zones with a PodDisruptionBudget, and run one restore test. Those three remove the most common causes of long outages. Then work through the rest by failure domain. For how resilience fits into wider system design, see DevOps architecture patterns for cloud apps and the role of SREs in DevOps teams.

The Kubernetes configuration in tips 9 to 13 is practised hands-on in the CKA course, and the wider design habits in the DevOps course, both offered in Kharadi, Pune and live online.

FAQs

What makes a system resilient?

A resilient system keeps serving users when parts of it fail, sometimes in a reduced form, and recovers quickly. It gets there through redundancy across failure domains, bounded timeouts and retries, isolation between components, and regular testing of failure and recovery.

What is the difference between resilience and high availability?

High availability is a measured outcome, usually a percentage of uptime. Resilience is the set of design properties that produce it, including how the system behaves during partial failure and how quickly it recovers.

Why add jitter to retries?

Without jitter, many clients retry at the same moments and hit the recovering service in waves. Random jitter spreads the retries out so the service can recover.

Should a liveness probe check the database?

Usually not. If the database has a brief problem, every pod fails liveness and restarts together, which extends the outage. Keep liveness shallow and handle dependency issues with timeouts, circuit breakers and readiness.

What does a PodDisruptionBudget protect against?

It limits voluntary disruptions such as node drains during upgrades or autoscaler scale-downs. It does not stop involuntary failures like a node crash.

How often should we test backups?

Often enough that the restore process is familiar and its timing is known. Many teams test critical data stores monthly or quarterly, and after any major change to the backup setup.

Is chaos engineering safe to run in production?

Start in test environments with small, reversible experiments and clear abort conditions. Move to production only when monitoring is good, the blast radius is limited and the team has practised the response.

What is load shedding?

Load shedding means rejecting some requests early when a service is near capacity, so the remaining requests still succeed instead of every request slowing down and failing.

References

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.