Redis is a key-value storage system, similar to memcached, which supports storing more value types, including string (string), list (linked list), set (set), Zset (ordered collection), GEO (coordinate), and hash ( Hash type). These operations support Push/pop, Add/remove, and intersection-set and difference-set operations, and these operations are atomic in nature. Redis also supports different ways of Pei, like memcached, in order to ensure efficiency, the data is cached in memory, the difference: Redis periodically writes the updated data to disk or writes the modified operation to the appended record file, and implements Master-slave (Master-slave) synchronization.
Redis Master-Slave synchronization: Data can be synchronized from the primary server to any number of slave servers, and the server can be associated with other primary servers from the server. By fully implementing the subscription publishing mechanism, you can subscribe to a channel and accept a complete message release record from the master server when you synchronize the tree from anywhere in the database.
SQL database performance is not high because of the existence of transactions. In the case of large data volume access, the SQL database has its drawbacks.
Note:
Subscription Release mode:
The subscription publishing pattern defines a one-to-many dependency that allows multiple subscriber objects to listen to a Subject object at the same time. When the subject object changes its state, all the subscriber objects are notified so that they can automatically update their state.
One of the bad side effects of splitting a system into a series of collaborative classes is the need to maintain consistency between objects, which can be inconvenient for maintenance, expansion, and reuse. The subscription release pattern is used when an object's change requires changing other objects at the same time, and it does not know how many objects need to be changed.
An abstract model has two facets, one on the other, in which the subscription release pattern can encapsulate the two in separate objects, changing and reusing them independently. The job of subscribing to the publishing model is actually decoupling. Let both sides of the coupling rely on abstraction, rather than relying on specifics, so that their changes will not affect the other side of the change
Introduction to the Redis database