Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to persist redis

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

How does redis persist? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.

How to persist redis

1.RDB saves multiple full backups, which has little impact on IO, is suitable for cold backup, and recovers faster after downtime. But generally, the snapshot file generated gap in 5min, once the downtime, the data of 5min will be lost. At the same time, if the snapshot file is too large, the service will be suspended for a few milliseconds or even a second.

2.AOF usually synchronizes once per second and loses at most 1 second of data. Synchronous logs use append-only mode, which is fast to write, and the log files are not easily damaged, and the tail damage is also easy to recover. And the AOF file size does not affect performance. However, the AOF log is generally larger than the RDB file, and the previous AOF Bug has led to the incomplete recovery of the data.

Redis is a key-value storage system. Similar to Memcached, it supports relatively more value types to be stored, including string (string), list (linked list), set (collection), and zset (ordered collection). These data types support push/pop, add/remove, and take intersection union and difference sets, and richer operations, and these operations are atomic. On this basis, redis supports a variety of different sorting methods. Like memcached, data is cached in memory for efficiency. The difference is that redis will periodically write updated data to disk or modify operations to additional record files, and on this basis to achieve master-slave (master-slave) synchronization.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 227

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report