Skip to content

Instantly share code, notes, and snippets.

@ashrocket
Created January 28, 2025 06:31
Show Gist options
  • Save ashrocket/02c7f46d8d45b6855e9b6fe4ac13cf2d to your computer and use it in GitHub Desktop.
Save ashrocket/02c7f46d8d45b6855e9b6fe4ac13cf2d to your computer and use it in GitHub Desktop.
ScaleSmart.md

System Design Resiliency Cards


Card 1: Scalability

  • Design for horizontal scaling to handle increased load.
  • Implement load balancing to evenly distribute traffic across servers.
  • Use sharding or partitioning to manage large datasets.

Card 2: Consistency

  • Consider eventual consistency for systems that need to scale easily.
  • Eventual consistency often requires consensus algorithms (e.g., Paxos, Raft).
  • Explore sharding and data read/write separation as easier-to-implement alternatives.
  • Use double entry, order insertion ledgers to ensure accurate tracking of transactions and changes.

Card 3: Availability

  • Ensure high availability with active-active, autoscaling, or predicted scaling.
  • Use Caching, and Backoff Retries to avoid cascading
  • Maintain multiple copies of critical data.

Card 4: Latency

  • Optimize response times with in mem caching (e.g., Redis, Memcached).
  • Use indexing and efficient algorithms to enhance database query speed.
  • Chill with the lambdas

Card 5: Error Resilience

  • Incorporate fault tolerance mechanisms such as circuit breakers and backedpff retries
  • Use dead letter queues to handle failed tasks with automatic retries.
  • Implement redundancy to eliminate single points of failure.

Card 6: State Management

  • Use external session stores (e.g., Redis) to manage session data across servers.
  • Move state to transactions wherever possible

Card 7: Monitoring and Observability

  • Cannot have too much

Card 8: Asynchronous Processing

  • Use message queues (e.g., Kafka, RabbitMQ) for decoupling services.
  • Implement background jobs for tasks that do not require immediate user feedback.
  • Avoid the Reporting Batch Hell if you can

Card 9: Resource Efficiency

  • Use elastic scaling to optimize resource usage based on demand.
  • PreLeased Instances often favor larger machines versus horizontal scaling cattle
  • Optimize cloud resources to reduce costs without sacrificing performance.
  • Use CDN for cost-effective content delivery and reduced server load push compute to the edge

Card 10: Trust and Security

  • Implement authentication and authorization to secure access.
  • Encrypt sensitive data in transit and at rest.
  • Use rate limiting and throttling to protect against abuse and overuse.

Mnemonic: SCALE SMART

  • S: Scalability (horizontal scaling, load balancing).
  • C: Consistency (eventual consistency, sharding, ledgers).
  • A: Availability (redundancy, failover).
  • L: Latency and performance (caching, indexing).
  • E: Error resilience (circuit breakers, retries).
  • S: State management (session stores, state machines).
  • M: Monitoring and observability (logging, alerting).
  • A: Asynchronous processing (queues, event-driven).
  • R: Resource efficiency (elastic scaling, cost control).
  • T: Trust and security (encryption, authentication).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment