How does EasyNTS cluster mode use Redis to store cluster information to persist data?

I have introduced a lot of video cloud networking EasyNTS to you. You should know a little bit about it. To put it bluntly, it is a product born to solve network penetration.

NTS2.png

When we developed the EasyNTS cloud networking, the cluster mode was enabled by using Redis to store cluster information, because Redis can persist data and reduce database operations.

Redis data is all stored in memory. If there is a sudden downtime, all data will be lost. Therefore, there must be a mechanism to ensure that Redis data will not be lost due to failure. So in this article we will introduce two persistence methods:

Method 1: Snapshot

Redis snapshot is the simplest Redis persistence mode. When certain conditions are met, it will generate a point-in-time snapshot of the data set, for example, if the previous snapshot was created 2 minutes ago and there have been at least 100 new writes now, a new snapshot will be created. This condition can be controlled by the user configuring the Redis instance, or it can be modified at runtime without restarting the server. The snapshot is generated as a single .rdb file that contains the entire data set.

Method 2: AOF

AOF (Append Only File-Append Only File) It works very simple: every time a write operation that modifies the data set in the memory is performed, the operation is recorded. Assuming that the AOF log records all the modified instruction sequences since the creation of the Redis instance, you can restore the memory data structure of the current Redis instance by executing all the instructions sequentially on an empty Redis instance, that is, "replaying" status.

NTS2.png

Guess you like

Origin blog.csdn.net/EasyNTS/article/details/106540005