Redis vs memcached vs MONGO
Redis vs memcached:
Redis as a high-performance key-value database has the following characteristics:
1. A variety of data models (String, Hash, List, set, and sorted set)
2. Persistent-bgsave (using RDB snapshots,
Install Redis
Redis is not in the CentOS official source, you need to manually download Epel (Extra Packages for Enterprise Linux) to install.Epel is equivalent to the expansion of the original source, the specific introduction can look at these
# # Swoole+redis Implementation of real-time data push
transfer from the socket => the entire process must be completed within the defined time, otherwise the socket is automatically closed and thrown warning
Ini_set (' Default_socket_timeout ',-1)
Run for a long time the environment unexpectedly can not log in, view the error of the newspaper, and Redis auth relationship, because the session of multiple servers exist Redis, Redis Connection failed to save the user's login sessions.
Five types of data commonly used in Redis
String (Key-value)
String is the most commonly used type of data, and ordinary key/value storage can be classified as such.
A key corresponding to a value,string type is binary safe.
A Redis string can
PHP Operation Redis Detailed explanation of the turn
Phpredis is an extension of Redis PHP, and the efficiency is quite high with the sort function of linked list, to create memory-level module business relationship
Very useful; The following are
First: The introduction between the two
Redis: A standalone running program that needs to be installed separately and manipulated using Jedis in Java. Because it is independent, so if you write a unit test program, put some data in the Redis, and
1. Download and install
wget http://redis.googlecode.com/files/redis-2.2.13.tar.gz
tar-zxf redis-2.2.13.tar.gz
cd redis-2.2.13
make
sudo make install
CP redis.conf/etcWhen install, Redis's orders will be copied under/usr/local/bin.
2, create
Recently in the research of distributed caching, I hope to be able to currently improve the use of the cache in the project. The results of this test may be unexpected.
comparison and analysis of test resultsSingle Read and write access memcached
The common commands of Redis are divided into two main parts, one is the key-value related command, the other is the server-related command
1. Key-Value related commands
Keys * Take out all current key
exists name to see if n has name this key
Del
The Redis rdb file holds binary data, and the structure consists of 5 parts:
REDIS | db_version | Databases | EOF | Check_sum
The db_version length is 4 bytes, and its value is a string representing the integer that records the version number of
As on the configuration, you can do it.
------------------------------------------------------------------------------
Follow the configuration below
p:connectionfactory-ref= "Redisconnectionfactory"p:keyserializer-ref=
Follow the Redis Getting Started Guide to learn
Chapter III 5 Types of data----hash type
3.3 (hash type)
Redis uses several structures to store data in the form of a health-value pair, while the health value of a hash type (hash) is also a
Preface
The memory-based Redis should be the most commonly used Key-value database in various web development businesses, and we often use it to store user login states (session storage) to speed up some of the hot data queries (compared to MySQL,
reprinted from: Http://www.redicecn.com/html/Linux/20131125/468.htmlRedis "Misconf Redis is configured to save RDB snapshots, but was currently not able to persist on disk" solution
Today's second encounter with Redis "Misconf Redis is configured to
Speaking of the caching framework, our most commonly used cache framework is the memcached, Redis two, but there are actually differences between them.The birth of MemcachedIn May 2003, Brad Fitzpatrick released the first version of Memcached, which
Premise: Set up a good redis cluster environment, set up the way to see: HTTPS://WWW.CNBLOGS.COM/XYMBLOG/P/9300574.HTML1. New project, add Redis support in Pom.xml fileorg.springframework.bootspring-boot-starter-data-redis2. Configure
I've written an article http://www.cnblogs.com/axel10/p/8459434.html about C # operations Redis, The case in this article uses Stringincrement to achieve a steady increase in key values in high concurrency, but what if you want to use a lock instead
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.