System design patterns for scalability, reliability, and performance. Use when: (1) designing distributed systems, (2) planning for scale, (3) making architecture decisions, (4) evaluating trade-offs.
This Claude skill provides a comprehensive framework for implementing system design patterns focused on scalability, reliability, and performance. It assists developers and architects in making informed decisions regarding distributed systems, database scaling, caching strategies, and fault-tolerant patterns like circuit breakers to ensure robust infrastructure.
Use Cases
Architecting Distributed Systems: Evaluate trade-offs between consistency and availability using the CAP theorem and ACID vs BASE principles for new service designs.
Scaling Database Infrastructure: Plan and implement database sharding or read replicas to handle high-volume traffic and massive data growth.
Implementing Fault Tolerance: Apply reliability patterns such as Circuit Breaker, Retry with Exponential Backoff, and Bulkhead to prevent cascading failures in microservices.
Optimizing System Performance: Select the most effective load balancing and caching strategies (like Cache-Aside or Write-Through) to minimize latency and maximize throughput.
Infrastructure Planning: Use the system design checklist to audit existing architectures for security, monitoring, and failure mode readiness.
name
system-design-patterns
description
"System design patterns for scalability, reliability, and performance. Use when: (1) designing distributed systems, (2) planning for scale, (3) making architecture decisions, (4) evaluating trade-offs."
// Isolate failures to prevent cascade
var bulkhead = Policy.BulkheadAsync(
maxParallelization: 10, // Max concurrent executions
maxQueuingActions: 20, // Max queued requests
onBulkheadRejectedAsync: context =>
{
Log.Warning("Bulkhead rejected request");
return Task.CompletedTask;
}
);
Event-Driven Architecture
Message Queue Pattern
┌─────────┐ ┌─────────────┐ ┌─────────────┐
│ Service │───►│ Message │───►│ Consumer │
│ A │ │ Queue │ │ Service B │
└─────────┘ │ │ └─────────────┘
│ (RabbitMQ, │
│ Kafka, │ ┌─────────────┐
│ Azure SB) │───►│ Consumer │
└─────────────┘ │ Service C │
└─────────────┘
Event Sourcing
// Store events, not state
public class PatientAggregate
{
private readonly List<IDomainEvent> _events = new();
public Guid Id { get; private set; }
public string Name { get; private set; }
public PatientStatus Status { get; private set; }
public void Apply(PatientCreated @event)
{
Id = @event.PatientId;
Name = @event.Name;
Status = PatientStatus.Active;
_events.Add(@event);
}
public void Apply(PatientNameChanged @event)
{
Name = @event.NewName;
_events.Add(@event);
}
// Rebuild state from events
public static PatientAggregate FromEvents(IEnumerable<IDomainEvent> events)
{
var patient = new PatientAggregate();
foreach (var @event in events)
{
patient.Apply((dynamic)@event);
}
return patient;
}
}