diff --git a/README.md b/README.md index 95be990d..0f44b0f4 100644 --- a/README.md +++ b/README.md @@ -98,82 +98,82 @@ Review the [Contributing Guidelines](CONTRIBUTING.md).
* [System design topics: start here](#system-design-topics-start-here) - * [Step 1: Review the scalability video lecture](#step-1-review-the-scalability-video-lecture) - * [Step 2: Review the scalability article](#step-2-review-the-scalability-article) - * [Next steps](#next-steps) + * [Step 1: Review the scalability video lecture](#step-1-review-the-scalability-video-lecture) + * [Step 2: Review the scalability article](#step-2-review-the-scalability-article) + * [Next steps](#next-steps) * [Performance vs scalability](#performance-vs-scalability) * [Latency vs throughput](#latency-vs-throughput) * [Availability vs consistency](#availability-vs-consistency) - * [CAP theorem](#cap-theorem) - * [CP - consistency and partition tolerance](#cp---consistency-and-partition-tolerance) - * [AP - availability and partition tolerance](#ap---availability-and-partition-tolerance) + * [CAP theorem](#cap-theorem) + * [CP - consistency and partition tolerance](#cp---consistency-and-partition-tolerance) + * [AP - availability and partition tolerance](#ap---availability-and-partition-tolerance) * [Consistency patterns](#consistency-patterns) - * [Weak consistency](#weak-consistency) - * [Eventual consistency](#eventual-consistency) - * [Strong consistency](#strong-consistency) + * [Weak consistency](#weak-consistency) + * [Eventual consistency](#eventual-consistency) + * [Strong consistency](#strong-consistency) * [Availability patterns](#availability-patterns) - * [Fail-over](#fail-over) - * [Replication](#replication) - * [Availability in numbers](#availability-in-numbers) + * [Fail-over](#fail-over) + * [Replication](#replication) + * [Availability in numbers](#availability-in-numbers) * [Domain name system](#domain-name-system) * [Content delivery network](#content-delivery-network) - * [Push CDNs](#push-cdns) - * [Pull CDNs](#pull-cdns) + * [Push CDNs](#push-cdns) + * [Pull CDNs](#pull-cdns) * [Load balancer](#load-balancer) - * [Active-passive](#active-passive) - * [Active-active](#active-active) - * [Layer 4 load balancing](#layer-4-load-balancing) - * [Layer 7 load balancing](#layer-7-load-balancing) - * [Horizontal scaling](#horizontal-scaling) + * [Active-passive](#active-passive) + * [Active-active](#active-active) + * [Layer 4 load balancing](#layer-4-load-balancing) + * [Layer 7 load balancing](#layer-7-load-balancing) + * [Horizontal scaling](#horizontal-scaling) * [Reverse proxy (web server)](#reverse-proxy-web-server) - * [Load balancer vs reverse proxy](#load-balancer-vs-reverse-proxy) + * [Load balancer vs reverse proxy](#load-balancer-vs-reverse-proxy) * [Application layer](#application-layer) - * [Microservices](#microservices) - * [Service discovery](#service-discovery) + * [Microservices](#microservices) + * [Service discovery](#service-discovery) * [Database](#database) - * [Relational database management system (RDBMS)](#relational-database-management-system-rdbms) - * [Master-slave replication](#master-slave-replication) - * [Master-master replication](#master-master-replication) - * [Federation](#federation) - * [Sharding](#sharding) - * [Denormalization](#denormalization) - * [SQL tuning](#sql-tuning) - * [NoSQL](#nosql) - * [Key-value store](#key-value-store) - * [Document store](#document-store) - * [Wide column store](#wide-column-store) - * [Graph Database](#graph-database) - * [SQL or NoSQL](#sql-or-nosql) + * [Relational database management system (RDBMS)](#relational-database-management-system-rdbms) + * [Master-slave replication](#master-slave-replication) + * [Master-master replication](#master-master-replication) + * [Federation](#federation) + * [Sharding](#sharding) + * [Denormalization](#denormalization) + * [SQL tuning](#sql-tuning) + * [NoSQL](#nosql) + * [Key-value store](#key-value-store) + * [Document store](#document-store) + * [Wide column store](#wide-column-store) + * [Graph Database](#graph-database) + * [SQL or NoSQL](#sql-or-nosql) * [Cache](#cache) - * [Client caching](#client-caching) - * [CDN caching](#cdn-caching) - * [Web server caching](#web-server-caching) - * [Database caching](#database-caching) - * [Application caching](#application-caching) - * [Caching at the database query level](#caching-at-the-database-query-level) - * [Caching at the object level](#caching-at-the-object-level) - * [When to update the cache](#when-to-update-the-cache) - * [Cache-aside](#cache-aside) - * [Write-through](#write-through) - * [Write-behind (write-back)](#write-behind-write-back) - * [Refresh-ahead](#refresh-ahead) + * [Client caching](#client-caching) + * [CDN caching](#cdn-caching) + * [Web server caching](#web-server-caching) + * [Database caching](#database-caching) + * [Application caching](#application-caching) + * [Caching at the database query level](#caching-at-the-database-query-level) + * [Caching at the object level](#caching-at-the-object-level) + * [When to update the cache](#when-to-update-the-cache) + * [Cache-aside](#cache-aside) + * [Write-through](#write-through) + * [Write-behind (write-back)](#write-behind-write-back) + * [Refresh-ahead](#refresh-ahead) * [Asynchronism](#asynchronism) - * [Message queues](#message-queues) - * [Task queues](#task-queues) - * [Back pressure](#back-pressure) + * [Message queues](#message-queues) + * [Task queues](#task-queues) + * [Back pressure](#back-pressure) * [Communication](#communication) - * [Transmission control protocol (TCP)](#transmission-control-protocol-tcp) - * [User datagram protocol (UDP)](#user-datagram-protocol-udp) - * [Remote procedure call (RPC)](#remote-procedure-call-rpc) - * [Representational state transfer (REST)](#representational-state-transfer-rest) + * [Transmission control protocol (TCP)](#transmission-control-protocol-tcp) + * [User datagram protocol (UDP)](#user-datagram-protocol-udp) + * [Remote procedure call (RPC)](#remote-procedure-call-rpc) + * [Representational state transfer (REST)](#representational-state-transfer-rest) * [Security](#security) * [Appendix](#appendix) - * [Powers of two table](#powers-of-two-table) - * [Latency numbers every programmer should know](#latency-numbers-every-programmer-should-know) - * [Additional system design interview questions](#additional-system-design-interview-questions) - * [Real world architectures](#real-world-architectures) - * [Company architectures](#company-architectures) - * [Company engineering blogs](#company-engineering-blogs) + * [Powers of two table](#powers-of-two-table) + * [Latency numbers every programmer should know](#latency-numbers-every-programmer-should-know) + * [Additional system design interview questions](#additional-system-design-interview-questions) + * [Real world architectures](#real-world-architectures) + * [Company architectures](#company-architectures) + * [Company engineering blogs](#company-engineering-blogs) * [Under development](#under-development) * [Credits](#credits) * [Contact info](#contact-info) @@ -248,12 +248,12 @@ Outline a high level design with all important components. Dive into details for each core component. For example, if you were asked to [design a url shortening service](solutions/system_design/pastebin/README.md), discuss: * Generating and storing a hash of the full url - * [MD5](solutions/system_design/pastebin/README.md) and [Base62](solutions/system_design/pastebin/README.md) - * Hash collisions - * SQL or NoSQL - * Database schema + * [MD5](solutions/system_design/pastebin/README.md) and [Base62](solutions/system_design/pastebin/README.md) + * Hash collisions + * SQL or NoSQL + * Database schema * Translating a hashed url to the full url - * Database lookup + * Database lookup * API and object-oriented design ### Step 4: Scale the design @@ -353,9 +353,7 @@ Check out the following links to get a better idea of what to expect: ## Object-oriented design interview questions with solutions > Common object-oriented design interview questions with sample discussions, code, and diagrams. -> > Solutions linked to content in the `solutions/` folder. - >**Note: This section is under development** | Question | | @@ -380,22 +378,22 @@ First, you'll need a basic understanding of common principles, learning about wh [Scalability Lecture at Harvard](https://www.youtube.com/watch?v=-W9F__D3oY4) * Topics covered: - * Vertical scaling - * Horizontal scaling - * Caching - * Load balancing - * Database replication - * Database partitioning + * Vertical scaling + * Horizontal scaling + * Caching + * Load balancing + * Database replication + * Database partitioning ### Step 2: Review the scalability article [Scalability](https://web.archive.org/web/20221030091841/http://www.lecloud.net/tagged/scalability/chrono) * Topics covered: - * [Clones](https://web.archive.org/web/20220530193911/https://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones) - * [Databases](https://web.archive.org/web/20220602114024/https://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database) - * [Caches](https://web.archive.org/web/20230126233752/https://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache) - * [Asynchronism](https://web.archive.org/web/20220926171507/https://www.lecloud.net/post/9699762917/scalability-for-dummies-part-4-asynchronism) + * [Clones](https://web.archive.org/web/20220530193911/https://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones) + * [Databases](https://web.archive.org/web/20220602114024/https://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database) + * [Caches](https://web.archive.org/web/20230126233752/https://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache) + * [Asynchronism](https://web.archive.org/web/20220926171507/https://www.lecloud.net/post/9699762917/scalability-for-dummies-part-4-asynchronism) ### Next steps @@ -558,21 +556,21 @@ Availability is often quantified by uptime (or downtime) as a percentage of time If a service consists of multiple components prone to failure, the service's overall availability depends on whether the components are in sequence or in parallel. -###### In sequence +##### In sequence Overall availability decreases when two components with availability < 100% are in sequence: -``` +```text Availability (Total) = Availability (Foo) * Availability (Bar) ``` If both `Foo` and `Bar` each had 99.9% availability, their total availability in sequence would be 99.8%. -###### In parallel +##### In parallel Overall availability increases when two components with availability < 100% are in parallel: -``` +```text Availability (Total) = 1 - (1 - Availability (Foo)) * (1 - Availability (Bar)) ``` @@ -586,21 +584,21 @@ If both `Foo` and `Bar` each had 99.9% availability, their total availability in Source: DNS security presentation -A Domain Name System (DNS) translates a domain name such as www.example.com to an IP address. +A Domain Name System (DNS) translates a domain name such as