Home > Common Problem > What are the commonly used distributed caches?

What are the commonly used distributed caches?

不言
Release: 2020-09-10 13:21:43
Original
10227 people have browsed it

What are the commonly used distributed caches?

Distributed caching can handle large amounts of dynamic data, so it is more suitable for use in scenarios such as social networking sites in the Web 2.0 era that require user-generated content. After expanding from local cache to distributed cache, the focus has expanded from the difference in data transmission speed between CPU, memory, and cache to the difference in data transmission speed between business systems, databases, and distributed cache.

Commonly used distributed caches include Redis and Memcached.

1. Memcached

Memcached is a high-performance distributed memory object caching system used in dynamic web applications to reduce database load. Memcached increases the speed of dynamic, database-driven websites by caching data and objects in memory to reduce the number of database reads.

Features: Hash storage; full memory operation; simple text protocol for data communication; only character data operations; the cluster is controlled by the application and uses a consistent hash algorithm.

Restrictions: The data is stored in the memory. Once the machine is restarted, all data will be lost; only character data can be operated, and the data type is poor; it runs with root privileges, and Memcached itself does not have any permission management and authentication. Function and security are insufficient; the length of data that can be stored is limited, the maximum key length is 250 characters, and the stored data cannot exceed 1M.

2. Redis

Redis is an open source log-type, Key-Value database written in ANSI C language, supports the network, and can be based on memory or persistence. , and provides APIs in multiple languages.

Features:

The data types supported by Redis include: string, string, hash, set, sortedset, list; the way Redis implements persistence: regularly writes memory snapshots Disk; write log; Redis supports master-slave synchronization.

Restrictions: Single-core operation, performance will be reduced when storing big data; it is not a full-memory operation; master-slave replication is full replication, which imposes a certain burden on actual system operations.

The above is the detailed content of What are the commonly used distributed caches?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template