Hredis provides asynchronous interfaces, and can be used in conjunction with Libevent, Libev and other message frameworks;
Sample code (combined with libevent use, libevent Reference):
Test_asyn.c
#include #include #include #include # include
1.memcached vs. RedisMemcahced has only one string data structure, and Redis has 5 kinds of data data storage, Memcahced has the method of Redis basic all have, and Redis code is more concise, more readable, more maintenance, performance is
Using the shell to write a quick install Redis service#!/bin/bashyum Install CPP binutils glibc-kernheaders glibc-common glibc-devel gcc make wget #安装依赖库wget http://download . redis.io/releases/redis-4.0.1.tar.gzif [-f/root/redis-4.0.1.tar.gz];then
SOURCE structureJeesz-Driven Project constructionBuilt-in efficient and reliable code generatorSupport a variety of data models, based on database tables to generate regular repetitive code, so that research and development engineers focus on the
Https://github.com/alroy233/PowerPMS/issues/171, open the local redise:\powerpms\powerpms\redis2.8Redis-Server redis.windows.conf2, attribute heapdir: Temporary file path maxmemory: Temp file size Save: Write to disk temp file3, Command Redis-CLI:
After learning Redis as a message queue, we studied the functions of Redis chat.In fact, with a relational database can also realize the message function, I have been using MySQL to write a simple message function. The RDB idea is as follows:* * In
Make cleanThe Redis compilation failure may be:1. gcc,gcc-c++ not installedYum Install GCCYum Install gcc-c++2. Tcl not installedYum Install Tcl[email protected] src]$ make testyou need TCL 8.5 or newer on order to run the Redis testmake: ***[test]
Workflow for RDB:1. Executing the bgsave command, the Redis parent process determines whether a child process is currently executing, such as a rdb/aof child process, if there is a bgsave command to return directly.2. The parent process performs the
Collection ObjectThe encoding of a collection object can be either Intset or Hashtable,intset-encoded collection objects using an integer collection as the underlying implementation, and all the elements contained in the collection object are stored
Link command1. Do not specify a port link: redis-cli-h IP (default 6379 port)2. Specify port Link: redis-cli-h ip-p 26379 (Redis server is open to port 26379)3. Specify the port and password: redis-cli-h ip-p 26379-a xxxxxxxxxxxxx (the Redis server
Redis's key and value size restrictions today I studied how to serialize Java Beans to redis for storage. Suddenly my head is shining, will the object size exceed the redis limit? No matter what it is, it is better to clarify it, so I went to ask
Redis persistence
Although redis is a memory-based storage system, it supports the persistence of memory data and provides two main persistence policies: RDB snapshot and aof log.
Redis RDB Snapshot
Redis supports the persistence mechanism of saving
MongoDB:
1) Document Database
MongoDB adopts bson for documentation. For example, you can design blog articles and comments as follows:
{'Id': 1, 'author': 'ningoo ', 'title': 'vernacular MongoDB (1)', 'content': 'according to the official
Cluster Management Tool redis-trib.rb has been abandoned, so do not need to install Ruby what, at that time the redis-trib.rb function, now has been integrated into redis-CLI, can pass. /redis-cli -- cluster help to view the usage.
Environment
#
I had tested the following key-value store for set () and get ()
Memcachedb, use memcached client protocol.
Tokyo tyrant (TokyoCabinet), use memcached client Protocol
Redis, use jredis JavaClient
1. Test environment1.1 Hardware/OS
2 Linux boxes
Source: http://blog.nosqlfan.com/html/2235.html
There is no doubt that redis has created a new way of data storage. Using redis, we don't have to focus on how to put elephants in the refrigerator in the face of monotonous databases, instead,
Note: After Reading redis source code analysis-protocol, I found that the author skipped some simple points, but these simple points are exactly what I didn't understand, so I made some supplements, take notes.
Version: 2.04.
1. Requests format
*
In the aeprocessevents function of the AE. c file, the following code is provided for handling the returned network events:
int rfired = 0; /* note the fe->mask & mask & ... code: maybe an already processed * event removed an element that fired
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service