In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how redis stores data. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Redis is a key-value storage system. Similar to Memcached, it supports relatively more value types, including string (string), list (linked list), set (collection), zset (sorted set-ordered collection), and hash (hash type).
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.
Redis (full name: Remote Dictionary Server remote Dictionary Service) is an open source API that is written in ANSI C language, supports the network, can be memory-based and persistent, and provides multi-language API.
Storage
Redis uses two file formats: full data and incremental requests.
The full data format is to write the data in memory to disk, so that the file can be read and loaded next time.
The incremental request file serializes the data in memory into operation request, which is used to read the file and replay to get the data. The serialization operations include SET, RPUSH, SADD and ZADD.
The storage of redis is divided into three parts: memory storage, disk storage and log file, and there are three parameters in the configuration file to configure it.
Save seconds updates,save configuration, which indicates how many updates are performed within a period of time, and then synchronizes the data to the data file. This can be matched by multiple conditions, such as the settings in the default configuration file, which set three conditions.
Appendonly yes/no, appendonly configuration, indicating whether to log after each update operation. If it is not enabled, it may result in data loss for a period of time in the event of a power outage. Because redis itself synchronizes data files according to the above save conditions, some data will only exist in memory for a period of time.
Appendfsync no/always/everysec, appendfsync configuration, no and other operating systems synchronize the data cache to disk. Always means to manually call fsync () to write data to disk after each update operation, and everysec means to synchronize once a second.
So much for sharing about how redis stores data. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.