mirror of
				https://github.com/donnemartin/system-design-primer.git
				synced 2025-11-04 10:12:32 +03:00 
			
		
		
		
	Add Master-slave replication section
This commit is contained in:
		
							
								
								
									
										15
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								README.md
									
									
									
									
									
								
							@@ -903,3 +903,18 @@ A relational database like SQL is a collection of data items organized in tables
 | 
			
		||||
* **Durability** - Once a transaction has been committed, it will remain so
 | 
			
		||||
 | 
			
		||||
There are many techniques to scale a relational database: **master-slave replication**, **master-master replication**, **federation**, **sharding**, **denormalization**, and **SQL tuning**.
 | 
			
		||||
 | 
			
		||||
#### Master-slave replication
 | 
			
		||||
 | 
			
		||||
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">
 | 
			
		||||
  <br/>
 | 
			
		||||
  <i><a href=http://www.slideshare.net/jboner/scalability-availability-stability-patterns/>Source: Scalability, availability, stability, patterns</a></i>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
##### Disadvantage(s): master-slave replication
 | 
			
		||||
 | 
			
		||||
* Additional logic is needed to promote a slave to a master.
 | 
			
		||||
* See [Disadvantage(s): replication](#disadvantages-replication) for points related to **both** master-slave and master-master.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user