Should the existing data disappear after redis is restarted?

Source: Internet
Author: User
After redis is restarted, should the existing data disappear? after redis is restarted, should the existing data disappear?

Reply content:

Should the existing data disappear after redis is restarted?

RDB persistence is enabled by default in Redis.
There is another persistence AOF, which can be enabled at the same time.
Even if persistence is enabled, it does not mean that your data must be consistent with that before restart after restart. Because Redis may not write a hard disk every time it writes memory (if so, the performance will be poor), according to the rules in your configuration file, RDB can be triggered to write to the hard disk, the part before writing (before triggering the write) will be lost.
For more information, please refer to Redis official documentation: http://redis.io/topics/persistence

Of course, the data in the memory will be lost, but the data can be saved to the file

If persistence is not enabled, data in redis will be lost. The two persistence methods may also be lost. we recommend that you use the cluster mode and use rdb and aof for persistence and high availability.

By default, snapshots are enabled for redis. when you exit redis, all data is saved to the disk.

Similar to the sleep function of the operating system, the system writes data in the memory to a file on the hard disk during sleep, and then reads data from the file and puts it back into the memory.
This is also true for redis, but data may be lost in some unpredictable situations.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.