mirror of
				https://github.com/donnemartin/system-design-primer.git
				synced 2025-11-04 02:02:31 +03:00 
			
		
		
		
	Remove Imgur dependency by storing images locally (#168)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							828014aaac
						
					
				
				
					commit
					7d39c44293
				
			
							
								
								
									
										76
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										76
									
								
								README.md
									
									
									
									
									
								
							@@ -5,7 +5,7 @@
 | 
			
		||||
# The System Design Primer
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/jj3A5N8.png"/>
 | 
			
		||||
  <img src="images/jj3A5N8.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
@@ -46,7 +46,7 @@ Additional topics for interview prep:
 | 
			
		||||
## Anki flashcards
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/zdCAkB3.png"/>
 | 
			
		||||
  <img src="images/zdCAkB3.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
@@ -63,7 +63,7 @@ Great for use while on-the-go.
 | 
			
		||||
Looking for resources to help you prep for the [**Coding Interview**](https://github.com/donnemartin/interactive-coding-challenges)?
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/b4YtAEN.png"/>
 | 
			
		||||
  <img src="images/b4YtAEN.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
@@ -93,7 +93,7 @@ Review the [Contributing Guidelines](CONTRIBUTING.md).
 | 
			
		||||
> Each section contains links to more in-depth resources.
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/jrUBAF7.png"/>
 | 
			
		||||
  <img src="images/jrUBAF7.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
@@ -183,7 +183,7 @@ Review the [Contributing Guidelines](CONTRIBUTING.md).
 | 
			
		||||
 | 
			
		||||
> Suggested topics to review based on your interview timeline (short, medium, long).
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
**Q: For interviews, do I need to know everything here?**
 | 
			
		||||
 | 
			
		||||
@@ -306,49 +306,49 @@ Check out the following links to get a better idea of what to expect:
 | 
			
		||||
 | 
			
		||||
[View exercise and solution](solutions/system_design/pastebin/README.md)
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
### Design the Twitter timeline and search (or Facebook feed and search)
 | 
			
		||||
 | 
			
		||||
[View exercise and solution](solutions/system_design/twitter/README.md)
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
### Design a web crawler
 | 
			
		||||
 | 
			
		||||
[View exercise and solution](solutions/system_design/web_crawler/README.md)
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
### Design Mint.com
 | 
			
		||||
 | 
			
		||||
[View exercise and solution](solutions/system_design/mint/README.md)
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
### Design the data structures for a social network
 | 
			
		||||
 | 
			
		||||
[View exercise and solution](solutions/system_design/social_graph/README.md)
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
### Design a key-value store for a search engine
 | 
			
		||||
 | 
			
		||||
[View exercise and solution](solutions/system_design/query_cache/README.md)
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
### Design Amazon's sales ranking by category feature
 | 
			
		||||
 | 
			
		||||
[View exercise and solution](solutions/system_design/sales_rank/README.md)
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
### Design a system that scales to millions of users on AWS
 | 
			
		||||
 | 
			
		||||
[View exercise and solution](solutions/system_design/scaling_aws/README.md)
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
## Object-oriented design interview questions with solutions
 | 
			
		||||
 | 
			
		||||
@@ -440,7 +440,7 @@ Generally, you should aim for **maximal throughput** with **acceptable latency**
 | 
			
		||||
### CAP theorem
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/bgLMI2u.png"/>
 | 
			
		||||
  <img src="images/bgLMI2u.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://robertgreiner.com/2014/08/cap-theorem-revisited>Source: CAP theorem revisited</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -581,7 +581,7 @@ If both `Foo` and `Bar` each had 99.9% availability, their total availability in
 | 
			
		||||
## Domain name system
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/IOyLj4i.jpg"/>
 | 
			
		||||
  <img src="images/IOyLj4i.jpg">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.slideshare.net/srikrupa5/dns-security-presentation-issa>Source: DNS security presentation</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -619,7 +619,7 @@ Services such as [CloudFlare](https://www.cloudflare.com/dns/) and [Route 53](ht
 | 
			
		||||
## Content delivery network
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/h9TAuGI.jpg"/>
 | 
			
		||||
  <img src="images/h9TAuGI.jpg">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=https://www.creative-artworks.eu/why-use-a-content-delivery-network-cdn/>Source: Why use a CDN</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -660,7 +660,7 @@ Sites with heavy traffic work well with pull CDNs, as traffic is spread out more
 | 
			
		||||
## Load balancer
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/h81n9iK.png"/>
 | 
			
		||||
  <img src="images/h81n9iK.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://horicky.blogspot.com/2010/10/scalable-system-design-patterns.html>Source: Scalable system design patterns</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -730,7 +730,7 @@ Load balancers can also help with horizontal scaling, improving performance and
 | 
			
		||||
## Reverse proxy (web server)
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/n41Azff.png"/>
 | 
			
		||||
  <img src="images/n41Azff.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=https://upload.wikimedia.org/wikipedia/commons/6/67/Reverse_proxy_h2g2bob.svg>Source: Wikipedia</a></i>
 | 
			
		||||
  <br/>
 | 
			
		||||
@@ -773,7 +773,7 @@ Additional benefits include:
 | 
			
		||||
## Application layer
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/yB5SYwm.png"/>
 | 
			
		||||
  <img src="images/yB5SYwm.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://lethain.com/introduction-to-architecting-systems-for-scale/#platform_layer>Source: Intro to architecting systems for scale</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -808,7 +808,7 @@ Systems such as [Consul](https://www.consul.io/docs/index.html), [Etcd](https://
 | 
			
		||||
## Database
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/Xkm5CXz.png"/>
 | 
			
		||||
  <img src="images/Xkm5CXz.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=https://www.youtube.com/watch?v=kKjm4ehYiMs>Source: Scaling up to your first 10 million users</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -831,7 +831,7 @@ There are many techniques to scale a relational database: **master-slave replica
 | 
			
		||||
The master serves reads and writes, replicating writes to one or more slaves, which serve only reads.  Slaves can also replicate to additional slaves in a tree-like fashion.  If the master goes offline, the system can continue to operate in read-only mode until a slave is promoted to a master or a new master is provisioned.
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/C9ioGtn.png"/>
 | 
			
		||||
  <img src="images/C9ioGtn.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.slideshare.net/jboner/scalability-availability-stability-patterns/>Source: Scalability, availability, stability, patterns</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -846,7 +846,7 @@ The master serves reads and writes, replicating writes to one or more slaves, wh
 | 
			
		||||
Both masters serve reads and writes and coordinate with each other on writes.  If either master goes down, the system can continue to operate with both reads and writes.
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/krAHLGg.png"/>
 | 
			
		||||
  <img src="images/krAHLGg.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.slideshare.net/jboner/scalability-availability-stability-patterns/>Source: Scalability, availability, stability, patterns</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -874,7 +874,7 @@ Both masters serve reads and writes and coordinate with each other on writes.  I
 | 
			
		||||
#### Federation
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/U3qV33e.png"/>
 | 
			
		||||
  <img src="images/U3qV33e.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=https://www.youtube.com/watch?v=kKjm4ehYiMs>Source: Scaling up to your first 10 million users</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -895,7 +895,7 @@ Federation (or functional partitioning) splits up databases by function.  For ex
 | 
			
		||||
#### Sharding
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/wU8x5Id.png"/>
 | 
			
		||||
  <img src="images/wU8x5Id.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.slideshare.net/jboner/scalability-availability-stability-patterns/>Source: Scalability, availability, stability, patterns</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1039,7 +1039,7 @@ Document stores provide high flexibility and are often used for working with occ
 | 
			
		||||
#### Wide column store
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/n16iOGk.png"/>
 | 
			
		||||
  <img src="images/n16iOGk.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://blog.grio.com/2015/11/sql-nosql-a-brief-history.html>Source: SQL & NoSQL, a brief history</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1062,7 +1062,7 @@ Wide column stores offer high availability and high scalability.  They are often
 | 
			
		||||
#### Graph database
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/fNcl65g.png"/>
 | 
			
		||||
  <img src="images/fNcl65g.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=https://en.wikipedia.org/wiki/File:GraphDatabase_PropertyGraph.png>Source: Graph database</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1090,7 +1090,7 @@ Graphs databases offer high performance for data models with complex relationshi
 | 
			
		||||
### SQL or NoSQL
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/wXGqG5f.png"/>
 | 
			
		||||
  <img src="images/wXGqG5f.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=https://www.infoq.com/articles/Transition-RDBMS-NoSQL/>Source: Transitioning from RDBMS to NoSQL</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1132,7 +1132,7 @@ Sample data well-suited for NoSQL:
 | 
			
		||||
## Cache
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/Q6z24La.png"/>
 | 
			
		||||
  <img src="images/Q6z24La.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://horicky.blogspot.com/2010/10/scalable-system-design-patterns.html>Source: Scalable system design patterns</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1203,7 +1203,7 @@ Since you can only store a limited amount of data in cache, you'll need to deter
 | 
			
		||||
#### Cache-aside
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/ONjORqk.png"/>
 | 
			
		||||
  <img src="images/ONjORqk.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.slideshare.net/tmatyashovsky/from-cache-to-in-memory-data-grid-introduction-to-hazelcast>Source: From cache to in-memory data grid</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1239,7 +1239,7 @@ Subsequent reads of data added to cache are fast.  Cache-aside is also referred
 | 
			
		||||
#### Write-through
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/0vBc0hN.png"/>
 | 
			
		||||
  <img src="images/0vBc0hN.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.slideshare.net/jboner/scalability-availability-stability-patterns/>Source: Scalability, availability, stability, patterns</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1274,7 +1274,7 @@ Write-through is a slow overall operation due to the write operation, but subseq
 | 
			
		||||
#### Write-behind (write-back)
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/rgSrvjG.png"/>
 | 
			
		||||
  <img src="images/rgSrvjG.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.slideshare.net/jboner/scalability-availability-stability-patterns/>Source: Scalability, availability, stability, patterns</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1292,7 +1292,7 @@ In write-behind, the application does the following:
 | 
			
		||||
#### Refresh-ahead
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/kxtjqgE.png"/>
 | 
			
		||||
  <img src="images/kxtjqgE.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.slideshare.net/tmatyashovsky/from-cache-to-in-memory-data-grid-introduction-to-hazelcast>Source: From cache to in-memory data grid</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1324,7 +1324,7 @@ Refresh-ahead can result in reduced latency vs read-through if the cache can acc
 | 
			
		||||
## Asynchronism
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/54GYsSx.png"/>
 | 
			
		||||
  <img src="images/54GYsSx.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://lethain.com/introduction-to-architecting-systems-for-scale/#platform_layer>Source: Intro to architecting systems for scale</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1370,7 +1370,7 @@ If queues start to grow significantly, the queue size can become larger than mem
 | 
			
		||||
## Communication
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/5KeocQs.jpg"/>
 | 
			
		||||
  <img src="images/5KeocQs.jpg">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.escotal.com/osilayer.html>Source: OSI 7 layer model</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1402,7 +1402,7 @@ HTTP is an application layer protocol relying on lower-level protocols such as *
 | 
			
		||||
### Transmission control protocol (TCP)
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/JdAsdvG.jpg"/>
 | 
			
		||||
  <img src="images/JdAsdvG.jpg">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.wildbunny.co.uk/blog/2012/10/09/how-to-make-a-multi-player-game-part-1/>Source: How to make a multiplayer game</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1426,7 +1426,7 @@ Use TCP over UDP when:
 | 
			
		||||
### User datagram protocol (UDP)
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/yzDrJtA.jpg"/>
 | 
			
		||||
  <img src="images/yzDrJtA.jpg">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.wildbunny.co.uk/blog/2012/10/09/how-to-make-a-multi-player-game-part-1/>Source: How to make a multiplayer game</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1455,7 +1455,7 @@ Use UDP over TCP when:
 | 
			
		||||
### Remote procedure call (RPC)
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/iF4Mkb5.png"/>
 | 
			
		||||
  <img src="images/iF4Mkb5.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview>Source: Crack the system design interview</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
@@ -1681,7 +1681,7 @@ Handy metrics based on numbers above:
 | 
			
		||||
> Articles on how real world systems are designed.
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="http://i.imgur.com/TcUo2fw.png"/>
 | 
			
		||||
  <img src="images/TcUo2fw.png">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=https://www.infoq.com/presentations/Twitter-Timeline-Scalability>Source: Twitter timelines at scale</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user