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

What are the ways to persist redis

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

Share

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

What are the ways to persist redis? I believe there are many people do not understand, today, in order to let you know more about the way redis persistence, so for you to sum up the following content, let's look down.

Redis is an advanced key-value database. It is similar to memcached, except that data can be persisted and supports a wide range of data types. There are strings, linked lists, sets and ordered collections. Support in the server-side calculation of the collection union, intersection and complement set (difference), etc., but also supports a variety of sorting functions. So Redis can also be seen as a data structure server.

What is redis persistence?

All data in Redis is stored in memory, and if the redis crashes, it will be lost. Redis persistence is saving data to disk (a storage device that can be permanently saved) for data recovery.

Redis provides two ways for persistence, one is RDB persistence (the principle is to dump the database records of Reids in memory regularly to RDB persistence on disk), and the other is AOF (append only file) persistence (the principle is to write the operation log of Reids to a file in an appended way).

RDB persistence means that the snapshot of the dataset in memory is written to disk within a specified time interval. The actual operation is a child process of fork, which first writes the dataset to a temporary file, and then replaces the previous file and stores it with binary compression.

AOF persistence records every write and delete operation processed by the server in the form of log, query operation is not recorded, it is recorded in the form of text, and you can open the file to see the detailed operation record.

The implementation of persistence

● snapshot mode

A complete backup of data at some point at a time. Redis RDB,MySQL Dump, for example, works this way.

● logging method

Any updates to the data are recorded in the log, and at some point when the data is to be recovered, go through the complete process of the log. For example, MySQL's Binlog,HBase 's HLog and Redis's AOF, this is the way.

What is the way of redis persistence to share here, I hope that the above content can have a certain reference value for you, you can learn to apply. If you like this article, you might as well share it for more people to see.

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: 0

*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