Introduction to the Redis cache system

Source: Internet
Author: User
Tags memcached

About Redis

Redis is based on memory, or can be based on disk persistence NoSQL database, using C language development.

Data storage structure: Key-value

Installation Environment Preparation

Redis is developed using the C language and needs to be compiled using the GCC compiler.

1) Installing GCC

A) Install from disk mirroring: (reboot the Linux server requires a re-mount disk image)

b) Download the local URL directly from the Mine.repo file using the Yum command

c) Mount command: mount/dev/cdrom/mnt

d) installation command: yum-y install GCC

2) Install upload file plugin

A) tool upload file: (only the root directory can be uploaded)

b) Alt+p upload file can only upload root directory by default

c) Install the plugin: (Can upload files to any directory)

Rz (LRZSZ)

Install command: Yum–y install Lrzsz (directly installed in disk image)

Redis Cache System

Redis is one of the industry's leading key-value NoSQL databases. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered collection), and hash (hash type). These data types support Push/pop, Add/remove, and intersection-set and difference sets, and richer operations, and these operations are atomic. Based on this, Redis supports sorting in a variety of different ways. As with memcached, data is cached in memory to ensure efficiency. The difference is that Redis periodically writes the updated data to disk or writes the modified operation to the appended record file, and Master-slave (Master-Slave) synchronization is implemented on this basis.

Operating mode

1 Import paramiko,redis2 3 R=redis. Redis (host= ' 127.0.0.1 ', port=6379) #连接redis4 r.set (' foo ', ' Bar ') 5 print (R.get (' foo ')) 6 for item in R.hscan_iter (' Info_ 1 '): 7print (Item,type (item))
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.