Key-value Database: Redis Cache Service

Source: Internet
Author: User

Redis is an open source API that is written in ANSI C, supports the web, can be persisted in memory, key-value databases, and provides multiple languages. It provides a variety of mainstream languages for the client, easy to use, while Redis supports master-slave synchronization.

In addition to regular numeric values or strings, Redis's key values can also be in one of the following forms: Hash,list,set and Zset (sorted set). Redis supports advanced atomic operations such as the intersection of lists, sets, or ordered sets, set, and difference sets, and, if the type of the key value is a normal number, Redis provides self-increment atomic operations.

All structures that can be described using relational database theory can be implemented using the data structure of Redis. With MySQL, when the data size is very large, complex query operations require the use of table affinity technology, which is time consuming. Key-value is stored in Redis, and locating a key requires only O (1) operation.

Redis typically stores data in memory or is configured to use virtual memory. Data persistence can be achieved in two ways:

– Use Snapshots (filesnapshotting) to keep data in-memory written to disk;

– Log each update (APPEND-ONLY) using a log method similar to MySQL.

Redis supports synchronizing data to multiple slave libraries, which is useful for improving read performance, and master-slave replication allows multiple slave servers to have the same database copy as master server. Configuring the slave server is simple, just add the configuration to the configuration file:
slaveof Master Redis service IP Port

Support for C, C + +, C #, Java, Lua, Perl Javascript, Objective-c, PHP, Ruby, Python, go and other languages; C + + official recommended client is:Hiredis. (Example below)

Reference:

? Chinese official website: http://www.redis.cn/

? How to use Redis tools: http://dmouse.iteye.com/blog/811455

? Redis Master-slave configuration: http://www.cnblogs.com/liuling/p/2014-4-19-02.html

Key-value Database: Redis Cache Service

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.