18 DevOps Architecture Patterns for Cloud Apps
18 cloud architecture patterns for DevOps teams: Strangler Fig, Sidecar, Circuit Breaker, Bulkhead, CQRS, Saga, Deployment Stamps, with trade-offs.
DevOps architecture patterns are reusable designs that keep cloud applications deployable, observable and resilient when parts fail. The 18 covered here, from Strangler Fig and Sidecar to Circuit Breaker, Saga and Deployment Stamps, come from published catalogs such as the Azure Architecture Center, and each one solves a specific failure or scaling problem.
Each pattern below lists the problem it solves, how it works, what it costs you, and where it shows up in a DevOps toolchain. Pattern names and definitions follow the Microsoft Azure cloud design patterns catalog and the AWS Prescriptive Guidance cloud design patterns. Both are technology neutral, so the ideas apply on any cloud or on premises.
Key takeaways
- Pick a pattern for the problem you have (a slow dependency, a monolith you cannot rewrite, read load you cannot serve), not for the tool you want to try.
- Resilience patterns work in pairs: Retry with Circuit Breaker, Queue-Based Load Leveling with Competing Consumers, Saga with compensating transactions.
- Every pattern adds moving parts. Sidecars cost memory, queues add latency, CQRS and Event Sourcing add eventual consistency.
- Deployment patterns such as blue-green and canary are a separate topic; this post covers how the application is built, which decides how safely you can deploy it.
- Health endpoints and external configuration are the cheapest patterns to adopt and help almost every other one.
Why architecture patterns matter for DevOps
DevOps teams own the path from commit to production and the on-call pager after it. Architecture decides how hard both jobs are. A service with no health endpoint cannot be load balanced safely. A monolith that shares one database cannot be deployed in pieces. A call chain with no timeouts turns one slow dependency into a full outage.
The Azure catalog frames this through the fallacies of distributed computing: the network is not reliable, latency is not zero, topology changes. Patterns are known answers to those facts. If you are new to the practice itself, start with our guide to what DevOps is, then come back here.
The 18 patterns at a glance
| # | Pattern | Problem it solves | Main trade-off |
|---|---|---|---|
| 1 | Strangler Fig | Replacing a legacy system without a big-bang rewrite | Two systems run side by side for a long time |
| 2 | Anti-Corruption Layer | Legacy data models leaking into new services | Extra hop and code to maintain |
| 3 | Sidecar | Cross-cutting concerns repeated in every service | More containers, more resources |
| 4 | Gateway (routing, offloading, aggregation) | Clients calling many services directly | Gateway can become a bottleneck |
| 5 | Backends for Frontends | One API serving web, mobile and partners badly | Duplicate logic across backends |
| 6 | Retry | Transient network and service faults | Can amplify load if unbounded |
| 7 | Circuit Breaker | Calls to a dependency that keeps failing | Tuning thresholds takes data |
| 8 | Bulkhead | One noisy component starving others | Lower utilisation of each pool |
| 9 | Health Endpoint Monitoring | Load balancers and orchestrators routing to broken instances | Deep checks can cause cascading failure |
| 10 | Queue-Based Load Leveling | Traffic spikes overloading a service | Asynchronous, higher latency |
| 11 | Competing Consumers | Backlogs a single worker cannot clear | Ordering and duplicate handling |
| 12 | Publisher-Subscriber | Tight coupling between event producers and consumers | Harder to trace end to end |
| 13 | CQRS | Read and write workloads with different shapes | Eventual consistency |
| 14 | Event Sourcing | Losing history and audit trail on updates | Event schema versioning |
| 15 | Saga | Transactions that span several services | Compensation logic is complex |
| 16 | Cache-Aside | Repeated reads hammering a data store | Stale data and invalidation |
| 17 | External Configuration Store | Config baked into images and redeploys for every change | Config store becomes critical |
| 18 | Deployment Stamps | Scaling past one deployment's limits, tenant isolation | Fleet management overhead |
Migration patterns
1. Strangler Fig
Strangler Fig replaces a legacy system one function at a time. A routing layer (often an API gateway or reverse proxy) sends requests for migrated features to the new service and everything else to the old system. Over time the old system handles less traffic until it can be switched off.
For DevOps this means you can deploy and roll back each migrated slice on its own. The cost is running two systems, two sets of monitoring and possibly data sync between them for months. Microsoft's Strangler Fig page notes that the facade must not become a single point of failure. Our post on DevOps strategies for legacy modernization covers how this fits a full modernization plan.
2. Anti-Corruption Layer
An Anti-Corruption Layer is a translation layer between a new service and a legacy system. The new service talks in its own clean model; the layer converts calls and data into whatever the old system expects. Without it, odd field names, status codes and assumptions from the legacy side spread into every new service.
Run the layer as its own deployable component with its own tests. Once the legacy system is gone, delete the layer. Plan for the extra latency of one more hop.
Structural and edge patterns
3. Sidecar
A sidecar is a helper process or container deployed next to the main application and sharing its lifecycle. In Kubernetes it runs in the same pod. Typical sidecars handle log shipping, TLS, proxying, configuration reload or secrets fetching, so the application code does not have to.
Service meshes such as Istio and Linkerd made the pattern widely known by injecting a proxy sidecar into each pod. Kubernetes 1.29 added native sidecar support through init containers with restartPolicy: Always, which fixes start-up and shutdown ordering. See the Kubernetes sidecar containers documentation.
apiVersion: v1
kind: Pod
metadata:
name: web
spec:
initContainers:
- name: log-shipper
image: fluent/fluent-bit:3.0
restartPolicy: Always # runs as a native sidecar
containers:
- name: app
image: registry.example.com/web:1.4.2
The trade-off is resource use: every replica now carries the sidecar's CPU and memory.
4. Gateway routing, offloading and aggregation
The Azure catalog splits the gateway into three patterns. Gateway Routing sends requests from one endpoint to many services. Gateway Offloading moves shared work such as TLS termination, authentication and rate limiting into the gateway. Gateway Aggregation combines several backend calls into one response for the client.
Most teams use all three in one product: a managed cloud gateway, an ingress controller or a Kubernetes Gateway API implementation. Keep the gateway thin. Business logic in the gateway is hard to test and deploys on a different cadence from the services. Our comparison of Kubernetes gateways for API traffic lists the main options.
5. Backends for Frontends
Backends for Frontends (BFF) gives each client type its own backend. The mobile app gets an API shaped for small payloads and few round trips; the web app gets one shaped for its pages. Each frontend team can change its backend without negotiating with every other client.
The cost is duplicated logic across BFFs. Keep shared business rules in downstream services and keep the BFF focused on shaping responses.
Resilience patterns
6. Retry
Retry repeats an operation that failed for a reason likely to be temporary, such as a dropped connection or an HTTP 503. Good retries use exponential backoff with jitter, a cap on attempts, and only retry operations that are safe to repeat (idempotent).
Bad retries cause outages. If every client retries three times instantly, a struggling service receives four times its normal load. AWS describes this risk in its retry with backoff pattern.
7. Circuit Breaker
A circuit breaker stops calling a dependency after failures pass a threshold. It has three states: closed (calls flow), open (calls fail fast without reaching the dependency) and half-open (a few trial calls test recovery). This protects your service's threads and the failing dependency, which gets room to recover.
Pair it with Retry: retry handles short blips, the breaker handles longer failures. Libraries such as Resilience4j (Java) and Polly (.NET) implement it in code, and service meshes offer outlier detection at the proxy level. Expose breaker state as a metric so on-call engineers can see when it trips.
8. Bulkhead
Bulkhead isolates resources into separate pools so a failure in one does not sink the rest, like compartments in a ship's hull. Examples: separate thread or connection pools per downstream dependency, separate node pools for batch and web workloads, or Kubernetes resource requests and limits per container.
You give up some efficiency, because idle capacity in one pool cannot help another. In return a runaway report job cannot take down checkout.
9. Health Endpoint Monitoring
Health Endpoint Monitoring exposes endpoints that tools can call to check whether an instance works. Kubernetes uses them through liveness, readiness and startup probes; load balancers use them to pull bad instances out of rotation.
readinessProbe:
httpGet:
path: /ready
port: 8080
periodSeconds: 5
livenessProbe:
httpGet:
path: /healthz
port: 8080
periodSeconds: 10
failureThreshold: 3
Keep liveness checks shallow. If a liveness probe checks the database and the database slows down, Kubernetes restarts every pod at once and makes the outage worse. Put dependency checks in readiness instead. The Kubernetes probe documentation covers the settings. Health endpoints are also what self-healing systems rely on.
Messaging and data patterns
10. Queue-Based Load Leveling
A queue between a producer and a service absorbs spikes. The producer writes messages as fast as it likes; the service reads them at the rate it can handle. Amazon SQS, Azure Service Bus, Google Cloud Pub/Sub, RabbitMQ and Kafka are common choices.
This only works where the caller does not need an immediate answer. Monitor queue depth and age of the oldest message; both are better scaling signals than CPU.
11. Competing Consumers
Competing Consumers runs several workers reading from the same queue so the backlog clears in parallel. Combined with load leveling, it lets you scale workers on queue depth, for example with KEDA in Kubernetes.
Two things to design for: messages may be delivered more than once, so processing must be idempotent, and strict ordering is lost unless you partition by key.
12. Publisher-Subscriber
Pub/sub lets a service announce an event once while any number of subscribers react to it. An order service publishes "order placed"; billing, shipping and analytics each subscribe. The publisher does not need to know who listens.
Loose coupling makes debugging harder, because one request now fans out into several asynchronous flows. Distributed tracing with OpenTelemetry context propagation through message headers keeps those flows visible.
13. CQRS
Command Query Responsibility Segregation separates the write model from the read model. Writes go to a store designed for consistency; reads come from one or more views shaped for queries, often denormalised and sometimes in a different database.
Use it where read and write loads differ a lot or where queries need shapes the write model cannot serve well. Do not use it for simple CRUD: the read side lags behind the write side, and users can see stale data.
14. Event Sourcing
Event Sourcing stores every change as an append-only sequence of events instead of overwriting the current state. Current state is rebuilt by replaying events, usually with snapshots for speed. You get a full audit trail and can rebuild new read models from history.
The hard parts are operational: event schemas must be versioned forever, replays can be slow, and correcting a bad event means writing a new compensating event. It is often paired with CQRS.
15. Saga
A saga manages a business transaction that spans several services, each with its own database. Each step is a local transaction; if a later step fails, the saga runs compensating transactions to undo earlier steps (refund the payment, release the stock).
Sagas are coordinated by choreography (services react to each other's events) or orchestration (a central coordinator tells each service what to do). Workflow engines and services such as AWS Step Functions or Temporal are common orchestrators. Test failure paths as carefully as the happy path. See the Saga pattern reference.
16. Cache-Aside
With Cache-Aside, the application checks the cache first, reads from the database on a miss, and writes the result into the cache with an expiry. Redis, Valkey and Memcached are typical caches. On writes, the application updates the database and invalidates the cache entry.
Choose expiry times based on how stale the data may be, and plan for a cold cache after a restart, when every request hits the database at once.
Operational patterns
17. External Configuration Store
This pattern moves configuration out of the deployment package into a central store, such as Kubernetes ConfigMaps and Secrets, AWS Systems Manager Parameter Store, Azure App Configuration or HashiCorp Vault for secrets. The same image then runs in every environment with different settings.
It supports the build-once, deploy-many rule in CI/CD and lets you change a setting without a rebuild. Treat configuration changes like code changes: version them, review them and be able to roll them back, since a bad config push can break production as easily as a bad release.
18. Deployment Stamps
Deployment Stamps (also called scale units or cells) deploy many independent copies of the whole application stack, each serving a subset of tenants or regions. When one stamp is full you add another instead of scaling one giant deployment.
Stamps limit blast radius: a bad release or a failure affects only the stamps it reaches, which makes progressive rollouts stamp by stamp natural. The price is managing a fleet, so infrastructure as code and automated pipelines are a requirement, not a nice extra. Our list of infrastructure as code tools covers the options for stamping out identical environments.
How to choose patterns for your application
| Symptom you see | Patterns to look at first |
|---|---|
| One slow dependency causes a full outage | Circuit Breaker, Bulkhead, Retry with backoff |
| Traffic spikes overload a backend | Queue-Based Load Leveling, Competing Consumers, Cache-Aside |
| Monolith is too risky to deploy | Strangler Fig, Anti-Corruption Layer |
| Every service re-implements logging and TLS | Sidecar, Gateway Offloading |
| Orders end up half processed across services | Saga, Publisher-Subscriber with idempotent consumers |
| One customer or region's failure hits everyone | Deployment Stamps, Bulkhead |
| Config change needs a full rebuild | External Configuration Store |
Start small. Health endpoints, timeouts with bounded retries and external configuration help almost every service and cost little. Add CQRS, Event Sourcing or stamps only when a measured problem calls for them.
How patterns connect to deployment and observability
Architecture patterns decide how safely you can ship. Services that are independently deployable, expose health endpoints and degrade gracefully behind circuit breakers are the ones where canary and blue-green releases work well. Our post on Kubernetes deployment strategies covers the release side.
Every pattern also needs signals. Circuit breaker state, queue depth, cache hit ratio, saga failures and per-stamp error rates should all be on a dashboard with alerts. The observability tools guide covers the stacks teams use for this.
If you want to practise these designs on real clusters and pipelines, the DevOps training in Pune covers containers, Kubernetes, CI/CD and monitoring, in the Kharadi classroom or live online. For AWS-specific architecture, see the AWS Solutions Architect Associate course.
Official references
- Microsoft Learn: Cloud design patterns
- AWS Prescriptive Guidance: Cloud design patterns, architectures and implementations
- Kubernetes: Sidecar containers
- Kubernetes: Configure liveness, readiness and startup probes
- Microsoft Learn: Saga pattern
Frequently asked questions
What is a DevOps architecture pattern?
It is a reusable design for a recurring problem in cloud applications, such as failing dependencies, traffic spikes or legacy migration. DevOps teams care about them because architecture decides how easily a system can be deployed, monitored and recovered.
What is the difference between Retry and Circuit Breaker?
Retry repeats a failed call because the fault is probably temporary. Circuit Breaker stops calling a dependency once failures pass a threshold, because the fault is probably not temporary. Use both: retries for brief blips, the breaker to stop retries from piling onto a dependency that is down.
When should I use the Strangler Fig pattern?
Use it when a legacy system is too large or risky to rewrite in one go. A routing layer sends migrated features to new services and everything else to the old system, so each slice can be deployed and rolled back on its own.
Is CQRS always used with Event Sourcing?
No. They are often combined, but CQRS works with an ordinary database on the write side, and Event Sourcing can be used without separate read models. Use each only where its trade-offs, mainly eventual consistency and extra complexity, are worth it.
Does Kubernetes support the sidecar pattern natively?
Yes. Kubernetes 1.29 introduced native sidecars as init containers with restartPolicy set to Always. They start before the main containers and keep running alongside them, which fixes ordering problems of the older approach.
What is a Deployment Stamp?
A Deployment Stamp is a complete, independent copy of an application stack that serves a subset of users, tenants or regions. You scale by adding stamps, and failures or bad releases stay inside the stamps they reach.
Are deployment strategies like blue-green architecture patterns?
They are release patterns rather than application design patterns. Blue-green and canary describe how a new version reaches users. The patterns in this post describe how the application is built, which decides how safely those releases can run.
Which patterns should a small team adopt first?
Health endpoints, timeouts with bounded retries, and external configuration. They are cheap, they prevent common outages, and most other patterns depend on them.
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0