# The Art of Scalable Systems: Designing for Success

Buckle up, intrepid coder! The Art of Scalable Systems is your passport to unraveling the mysteries of services. Explore the hilarious mishaps and ingenious solutions to everyday problems.

📚 NB: This is an attempt at documenting all my system design notes from reading and hands-on experience, starting with explaining the basic components of a service to providing examples of real world systems and discussing tradeoffs of possible solutions.

## Table of contents

#### Basic Concepts

| System components                                               | System concepts                                               |
| --------------------------------------------------------------- | ------------------------------------------------------------- |
| [Load Balancer](/system-design-notes/basics/load-balancer.md)   | [ACID](/system-design-notes/basics/acid.md)                   |
| [API Gateway](/system-design-notes/basics/api-gateway.md)       | [CAP Theorem](/system-design-notes/basics/cap-theorem.md)     |
| [Caching](/system-design-notes/basics/caching.md)               | [PACEL Theorem](/system-design-notes/basics/pacel-theorem.md) |
| [DNS](/system-design-notes/basics/dns.md)                       |                                                               |
| [Message Queues](/system-design-notes/basics/message-queues.md) |                                                               |
| [Proxies](/system-design-notes/basics/proxies.md)               |                                                               |
| [Databases](/system-design-notes/basics/databases.md)           |                                                               |

#### Design Patterns

| Problem                            | Solution                                                                                                                                                                                           |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Check set contains                 | [Bloom Filters](/system-design-notes/system-design-patterns/bloom-filters.md)                                                                                                                      |
| Where to insert data               | [Consistent Hashing](/system-design-notes/system-design-patterns/consistent-hashing.md)                                                                                                            |
| Ensure strong consistency          | [Quorum Consensus](/system-design-notes/system-design-patterns/quorum-consensus.md)                                                                                                                |
| Ensure high availability           | [Leader And Follower](/system-design-notes/system-design-patterns/leader-and-follower.md)                                                                                                          |
| Atomicity in data transfers        | <p><a href="/pages/YFFz5usgWaCnicsBeTZV">Write Ahead Log</a><br><a href="/pages/3hNB6IN9ZB2T2mTu15Qs">Segmented Log</a><br><a href="/pages/UfWasQamX3YJgtf1srSW">High Water Mark</a></p>           |
| Concurrent updates to file         | [Locking Lease](/system-design-notes/system-design-patterns/locking-lease.md)                                                                                                                      |
| Concurrent node writes             | [Vector Clocks](/system-design-notes/system-design-patterns/vector-clocks.md)                                                                                                                      |
| Node liveness                      | <p><a href="/pages/pEst2E7NgdFi2ChK4Pep">Heartbeat</a><br><a href="/pages/qzgTmzII4WDCCdUmHVv8">Gossip Protocol</a><br><a href="/pages/m8Pp3uSFKkkzH4G1ki1S">Phi Accrual Failure Detection</a></p> |
| Deal with dead nodes coming back   | <p><a href="/pages/JUQ1zmFsydT9ZMJkRpw6">Split Brain With Fencing</a><br><a href="/pages/JVqzxPsZbRXT82eTpNOZ">Split Brain With Generation Clock</a></p>                                           |
| Update dead nodes with missed data | [Hinted Handoff](/system-design-notes/system-design-patterns/resyncing-nodes/hinted-handoff.md)                                                                                                    |
| Update stale nodes                 | <p><a href="/pages/QoMmPc4FdSIaGNCsDFHS">Read Repair</a><br><a href="/pages/UYvuFP7oyuwemwdJClYZ">Merkle Trees</a></p>                                                                             |
| Check data inconsistency           | [Checksum](/system-design-notes/system-design-patterns/checksum.md)                                                                                                                                |

#### Data Synchronisation Patterns

| Chapters                                                                                                   |
| ---------------------------------------------------------------------------------------------------------- |
| [CQRS](/system-design-notes/data-synchronisation-patterns/two-phase-commit.md)                             |
| [Two Phase Commit](/system-design-notes/data-synchronisation-patterns/cqrs.md)                             |
| [Transactional Outbox](/system-design-notes/data-synchronisation-patterns/transactional-outbox.md)         |
| [Change Data Capture (CDC)](/system-design-notes/data-synchronisation-patterns/change-data-capture-cdc.md) |

#### Monolith Decomposition Patterns

| Chapters                                                                                                                           |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| [Domain Driven Design](/system-design-notes/monolith-decomposition-patterns/domain-driven-design.md)                               |
| [The Strangler Fig Migration Pattern](/system-design-notes/monolith-decomposition-patterns/the-strangler-fig-migration-pattern.md) |

#### Real World Scenarios

| Chapters                                                                                                      |
| ------------------------------------------------------------------------------------------------------------- |
| [Distributed Message Queue & Event Streaming Platform](/system-design-notes/real-world-scenarios/untitled.md) |

**Infrastructure Bits and Bobs**

| Chapters                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------- |
| [K8S - ClusterIP vs NodePort vs LoadBalancer](/system-design-notes/infrastructure/k8s-clusterip-vs-nodeport-vs-loadbalancer.md) |

#### Payments Domain

| Chapters                                                                                                 |
| -------------------------------------------------------------------------------------------------------- |
| [Parties: Acquirer, Issuer](/system-design-notes/payments-services/parties-acquirer-issuer.md)           |
| [Events: Chargebacks, Reversals](/system-design-notes/payments-services/events-chargebacks-reversals.md) |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dianadarie.gitbook.io/system-design-notes/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
