What is separate from the main copy, read and write, why use

First, what is separate from the main copy, read and write, why use

Master-slave replication: a scheme for data backup.

Briefly, using the same two or more databases, a database as the master database , and as another database from the database. In the primary database when the corresponding operation, from a database operation of all of the primary database record, so that the two identical.

Separate read and write: is a way for a more stable database using a database approach.

Is there from the database using the case when the primary database when additions and deletions to the data that is write operation, the task to a query from the database .

Why use a master-slave and separate read and write it?

Master-slave replication: 1, when the main database problems, you can replace the main database from the database to avoid data loss when.

     2, may be separate read and write

Separate read and write: 1, to avoid the main writes a result of inconsistent data from the database case from the database, because when the data from the primary database is inconsistent, then the primary database from backup task does not make sense. 

        2, to reduce the pressure in the master database. Because the write operation is more time-consuming, so if you do not read and write separation, then the write operation will affect the efficiency of the read operation.

Second, what is the cluster

If the master is copied from their duties, then the cluster is a group of the same individual doing the same thing. In Redis in the case of large number of write operations of data, using only a single server to write the words, efficiency is not high, so if you are using a cluster scheme, using multiple Redis server for write operation, a large number of data, you write, I write a little, we all share a little, then the efficiency would be much higher. Like a small piece of land needs digging, then an excavator is enough, but met a large area of land, although an excavator also able to complete the task, but requires long, long time, then what I now and then find ten digging with an excavator, then the efficiency will be much higher.

Cluster mode of thinking can be used in several places. Anyway, not individual or a very low efficiency scenario, we can use this idea to complete.
As will say to the Sentinel, a sentry to monitor a server cluster is definitely not enough, then we need a sentinel to monitor the cluster.

 

Third, what is the mode Sentinel

A disaster recovery plan.

Sentinel: actually is in a special mode Redis server, which stores the information itself, the information of the main server, the information from the server.

With one or more sentinel to monitor the primary server (that is, a server write operation) is in a normal mission, sentries discovered once the primary server is unavailable, to find a suitable server from becoming the primary server.

 

Fourth, why should Redis database

NOSQL Redis database is a database of one database in order to model key-value store.

So what is NOSQL database? Non-relational database.

What you want to use Nosql? 
1) When the total size of the data amount of a machine fit. 
2) When a machine index memory data fit. 
3) the amount of access (read mixing) an instance when fit.

In today's information explosion, data storage, data query are very frequent and very substantial. Relational database becomes insufficient, poor scalability, simple queries are less efficient condition data and other shortcomings, it is not intended to be fatal. And there is no relationship between the data NOSQL database, a feature that makes the easy scalability, higher read and write performance advantages of NOSQL. So in the face of a large amount of data read and write, compared to non-relational database to a relational database has a huge advantage.

So why do they come to the fore in the Redis database NOSQL in?

I think there are several reasons,

1, Redis supports multiple data types: string (string), hash (hash), list (list), set (collection) and zset (sorted set: an ordered set). It can be used in most scenarios.

2, separated from the main support replication, read and write. Reading and writing efficiency is greatly enhanced.

3, the data stored in memory, can be used for caching. Need persistent data will be stored in its hard disk, no persistent data storage can be short, to improve access speed.

Guess you like

Origin www.cnblogs.com/superfeeling/p/12167941.html