Redis is an open source log-type Key-Value database written in ANSI C language, supports network, can be memory-based and persistent, and provides APIs in multiple languages.
Redis is a very fast open source non-relational, Key-Value database, often called a data structure server; it stores keys for five different types of values mapping. Used as a database, cache and message broker.
One of the main differences between Redis and other key-value databases is Redis's ability to store and manipulate advanced data types. These data types are the basic data structures that most developers are familiar with (lists, maps, sets, and sorted sets). Redis' superior performance, simplicity, and atomic operations on data structures help solve problems that are difficult to implement or perform poorly using traditional relational database implementations.
Redis Storage
Redis uses two file formats: full data and incremental requests.
The full data format is to write the data in the memory to the disk to facilitate the next reading of the file for loading;
The incremental request file is to serialize the data in the memory into an operation request , used to read files and replay to obtain data. Serialization operations include SET, RPUSH, SADD, and ZADD.
The storage of redis is divided into three parts: memory storage, disk storage and log file. There are three parameters in the configuration file to configure it.
save seconds updates, save configuration, indicates how long and how many update operations there are, and then synchronize the data to the data file. This can be combined with multiple conditions. For example, the settings in the default configuration file set three conditions.
appendonly yes/no, appendonly configuration, indicates whether to log after each update operation. If not enabled, data may be lost for a period of time during a power outage. Because redis's own synchronized data files are synchronized 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 means waiting for the operating system to synchronize the data cache to the disk, always means manually calling fsync() to write the data to the disk after each update operation, everysec means every second Sync once.
The above is the detailed content of What does redis mean?. For more information, please follow other related articles on the PHP Chinese website!