Redis as a cache summary

Source: Internet
Author: User
Tags redis

Redis Cache Server Notes
Redis is a high-performance key-value storage system that can serve as a caching framework and queue
But since he is a memory memory system, the data is stored in the database

As a caching framework:
create/updae/delete-at the same time to Redis and database
query– first from the Redis, no records to check from the database, and the results from the database also put a copy to Redis
As a cache queue:
2, the object is stored in the Redis, how to save. Memcache Access objects are serialized and deserialized
Use common serialization, deserialization (frequently consuming CPU, using Google Protocol Buffer to make objects into two
Feed stream)
or use JSON storage (Alibaba's Fast-json)
3, Java Use Redis client is generally: Jedis
Jedis native interfaces support only basic data types and string, byte[]
4, my understanding of the Redis queue:
Important data: First save to database, then save to Redis
Requires high response data: Write cache first, then write to the database via Message Queuing
Because the value of Redis supports string, list, set, Zset
Then you can use the Redis list as a queue.
Team: Lpush mylist ' Hello1 '
Out team: Lpop mylist

5, it provides AOF (Append operation record file) and dump (regular data backup) Two kinds of persistent way

6, VM (virtual memory mechanism): if there are 10,000 data saved in memory, then I will configure to store so much data memory
Then these 10,000 data have 9,000 not active data, that is wasted, you can do so, when the data capacity exceeds memory,
Store part value in a file
The memcached is to store the data completely in memory, while Redis is the majority, because he supports the custom VM
At the same time Redis support master-slave copying mechanism

Reproduced from: http://doushini.iteye.com/blog/1879616

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.