Home >Database >Redis >What are the benefits of redis caching

What are the benefits of redis caching

(*-*)浩
(*-*)浩Original
2019-11-22 13:20:144888browse

What are the benefits of redis caching

redis (full name: Remote Dictionary Server Remote Dictionary Service) is an open source log-type, Key-Value written in ANSI C language, supports the network, and can be memory-based and persistent. database and provides APIs in multiple languages.

Since March 15, 2010, the development of Redis has been hosted by VMware. Since May 2013, the development of Redis has been sponsored by Pivotal.

What are the benefits of using redis?                                                                                                                                       (Recommended learning: Redis video tutorial)

(1) It is fast because the data is stored in the memory, similar to HashMap. The advantage of HashMap is search and operation The time complexity is O(1)

(2) Supports rich data types, supports string, list, set, sorted set, hash

( 3) Support transactions, operations are all atomic. The so-called atomicity means that all changes to the data are either executed or not executed at all

(4) Rich features: can be used for caching, messages, and key settings Expiration time, it will be automatically deleted after expiration

redis can set the expiration strategy through expire, which is more suitable for verification code scenarios.

Redis is a key-value storage system. Similar to Memcached, it supports relatively more stored value types, including string (string), list (linked list), set (set), zset (sorted set - ordered set) and hash (hash type).

These data types support push/pop, add/remove, intersection, union, difference, and richer operations, and these operations are all atomic. On this basis, redis supports various different ways of sorting.

Same as memcached, in order to ensure efficiency, data is cached in memory. The difference is that redis will periodically write updated data to disk or write modification operations to additional record files, and on this basis, master-slave (master-slave) synchronization is achieved.

For more Redis-related technical articles, please visit the Introduction to Using Redis Database Tutorial column to learn!

The above is the detailed content of What are the benefits of redis caching. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn