Should the data that exists inside the Redis reboot be gone?
Reply content:
Should the data that exists inside the Redis reboot be gone?
The Redis default setting turns on RDB persistence.
There is another persistent AOF, both of which can be turned on at the same time.
Even if persistence is turned on, it does not mean that your data will be consistent after a reboot and before it restarts. Because Redis is not likely to write the hard drive every time it writes memory (if so, the performance will be poor), depending on the rules inside your profile, the RDB can be triggered to write to the hard disk, and the part that is not written before (triggering the write) is lost.
For more information, see the official Redis Documentation: Http://redis.io/topics/persistence
The data in memory will of course be discarded, but you can save the data to a file
If persistence is not enabled, the data in Redis will be lost. Two persistence methods can also be lost, it is recommended to use the cluster mode, respectively, using RDB and aof for persistence and high availability
Redis opens the snapshot by default, and all data is saved to disk when you exit Redis.
This kind of operating system hibernation function, in hibernation, the system will write the data in the memory to a file in the hard disk, and so on recovery from the file read data back into memory.
The same is true for Redis, but it may be possible to lose data in some unforeseen circumstances.