Non-relational database Redis learning (1)

Source: Internet
Author: User
Tags redis redis server

NoSQL refers to non-relational database

Features: 1. Handling ultra-large amounts of data

2. Run on a cheap PC server cluster

3. Shatter the bottleneck of performance

Redis is a high-performance Key-value database that stores value types including string strings, list lists, set (collections), Zset (ordered collections). The data is cached in memory, or it can periodically write updated data to disk, or write the modified operation to an appended record file

Redis Use Cases

1. Redis Application

2. Application direct access to Redis, only access to MySQL if Redis access fails

Redis Specific usage scenarios

1. Take the latest n data

2. Leaderboard application, go to TOPN operation

3. Applications that need to set the expiration time accurately

4. Counter Application

5.unique operation gets all row weight values for a certain period of time

6. Real-time system, anti-spam system

7.pub/sub build unique publish and subscribe for real-time messaging systems

8. Build a queue system

9. Caching

The default connection port for Redis server is 6379

The default connection port for MySQL server is 3306

String type

Set setting key corresponds to a value of type string

Setnx NX is the meaning of not exit. Returns 0 if key already exists

Setex sets the value of the key to be of type string, and specifies the validity period for this key value

SetRange Setting the substring of the value of the specified key SetRange name 6 126.com replace [email protected] with [email protected]

Mset setting the value of multiple keys at once successfully returns OK failure returns 0 indicates that any value is not set

Get gets the string value corresponding to key

Getset sets the value of key and returns the old value

Non-relational database Redis learning (1)

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.