@
@
@Twitt2018-03-15 11:39:20
MySQL
@Twitt, 2018-03-15 11:39:20

Why is replication needed and on what projects is it needed?

At the moment, I recently got a job in a company with a large project, there is a "replica" that lags behind the main database for a short time, and you can always view up-to-date data from it and make a select.
I often hear about slave-master replication, the project also has it, but I just can’t understand why it is needed? There is little information in Google, and what is there is a little incomprehensible. Actually questions:

  • Why do we need replication in principle?
  • What is called master and what is slave?
  • differences between master-slave and master-master?
  • What projects demand such concept as replication?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2018-03-15
_

Why do we need replication in principle?

First, fault tolerance. If you have several replicas and one server is dead, the application will not crash, but will work with the rest.
Second, performance. Or one server will process 1000 requests per second or 3 to 330 - there is a difference.
As follows from the above, those for which stability is important and in which the load is high enough that one server began to choke.
In master-slave replication mode, there is one master server that processes data change requests, and several slave servers that process read requests. If the master fails, one of the slaves becomes the master.
In master-master mode, all servers are equal and can handle any request. But it is more complicated and if one of the servers dies, you can get data corruption.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question