Redis System Learning one, basic knowledge

Source: Internet
Author: User
Tags value store

1. Database Select 1 Select 02, commands, keywords and values Redis is not just a simple keyword-value store, but from its core concept, each of the 5 data structures in REDSI has at least one keyword and one value. Before moving on to other useful information about Redis, we must understand the concepts of keywords and values. The keys are used to identify blocks of data, such as Users:leto, where the colon does not have any special meaning, and for Redis, using delimiters to organize keywords is a very common method value values are associated with the actual value of the keyword, which can be anything. 3, the query key is everything, and the value is no meaning, more commonly, Redis does not allow you to query by value. So Redis doesn't care what the heck the value is. 4, memory and persistence for persistence, by default, Redis will judge based on the number of keywords that have changed, and then create a snapshot of the database on disk. Can be set, by default, if 1000 or more keywords have changed, Redis will store the database every 60 seconds, and if 9 or fewer keywords have changed, Redis will store the database every 15 minutes in addition to creating disk snapshots, Redis can also run in additional mode. At any time, if there is a keyword change, a single attached file will be updated on disk. In some cases, a hardware or software error may occur. In some cases, although hardware or software errors may occur, it is acceptable to use the 60-second valid data store for better performance. In other cases, this loss is unacceptable, and Redis gives you the choice. As for memory, Redis retains all the data in memory. It is obvious that running Redis has a low cost: Because RAM is still the most expensive server hardware part. But the performance test for Redis is to tend to tens of thousands of or hundreds of thousands of operations per second. You can do this by running redis-benchmark(Right in redis-serverAnd redis-cliIn the same folder) to test. (I just had a local test, about 4W times) summary

While we're only touching and fiddling with the tip of the iceberg for Redis, the topic we're talking about is already covered in a wide range of things. If you feel that some things are still not clear (such as query), do not worry about it, in the next chapter we will continue to discuss in depth, I hope your questions can be answered.

Highlights of this chapter include:

    • Keys are a string used to identify a piece of data

    • Values are an arbitrary sequence of bytes, and Redis does not care what they are essentially

    • Redis shows (and implements) 5 specialized data structures

    • The above points make redis fast and easy to use, but know that Redis is not suitable for all scenarios

Redis System Learning one, basic knowledge

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.