Design Patterns Directory

Explore proven design patterns for software architecture and code migration. Learn when to use each pattern and see related implementations.

architecturalmigration

Strangler Fig Pattern

Incrementally migrate a legacy system by gradually replacing pieces of functionality with new applications

When to Use:
large-legacy-systemsincremental-migration+1
2 related patterns2 examples
architecturalintegration

Anti-Corruption Layer

Create a translation layer between new and legacy systems to prevent legacy concepts from leaking into new code

When to Use:
legacy-integrationbounded-context+1
2 related patterns2 examples
operationaldeployment

Blue-Green Deployment

Run two identical production environments, switching traffic between them for zero-downtime deployments

When to Use:
zero-downtimequick-rollback+1
2 related patterns2 examples
operationaldeployment

Canary Deployment

Gradually roll out changes to a small subset of users before rolling out to the entire infrastructure

When to Use:
risk-reductiona-b-testing+1
2 related patterns2 examples
architecturaldata

Database per Service

Each microservice owns and manages its own database, enabling loose coupling and independent deployability

When to Use:
microservicesteam-autonomy+1
2 related patterns2 examples
architecturaldata

Saga Pattern

Manage data consistency across microservices using a sequence of local transactions with compensating actions

When to Use:
distributed-transactionseventual-consistency+1
2 related patterns2 examples
architecturaldata

Event Sourcing

Store state changes as a sequence of events rather than just the current state

When to Use:
audit-trailtemporal-queries+1
2 related patterns2 examples
architecturalapi-design

Backend for Frontend (BFF)

Create separate backend services tailored to each frontend's needs

When to Use:
multiple-clientsmobile-web+1
2 related patterns2 examples
operationalinfrastructure

Sidecar Pattern

Deploy auxiliary components alongside primary services for cross-cutting concerns

When to Use:
service-meshobservability+1
2 related patterns2 examples
operationaldeployment

Feature Flags

Toggle functionality on or off without deploying new code

When to Use:
trunk-based-developmenta-b-testing+1
2 related patterns2 examples