DB Replication
Master Slave concept
-
Master db generally supports only write operations such as INSERT DELETE UPDATE .
-
Slave db gets copies of the data from the master database and only supports read operations.
-
Most apps have high ratio of reads to writes hence no. of slaves > no of master dbs generally.
-
Advantages of DB replication:
-
Better Performance :
- In master-slave model,Since all write updates happen at master & and read operations are distributed across slave nodes.
- This improves performance since it allows more queries to be processed in parallel.
-
Reliability :
- If one of the dbs is offline or destroyed,data is still preserved. Dont need to worry about data loss because data is replicated across multiple locations.
-
High availability:
- By replicating data across different locations ,your app remains online even if a db is offline as data can be accessed by another db server.
-