Redis (v)-database

Source: Internet
Author: User

Redis is a dictionary-structured storage server, and in fact a Redis instance provides multiple dictionaries for storing data, which can be stored in a dictionary by the client, similar to how I can create multiple databases in a relational library instance. Therefore, each of these dictionaries can be understood as a separate database.

Each database is named with an incremental number starting at 0, and Redis supports 16 databases by default, which can be modified by configuring the parameter databases. After the client has established a link with Redis, the No. 0 database library is automatically selected, but the database can be better through the Select command, if you want to select Database 1th, the command is as follows:

Redis> SELECT 1

Ok

Redis [1] Get foo

(nil)

Note that the above hint (nil) means that when using command get to get the value of the key name =foo, there is no key value named Foo

Attention:

These digitally named databases differ from our immediate database:

Redis does not support custom database names, each database is named by number, and developers must record which databases use those data;

The Redis database does not support setting different access passwords for each database, so the client is either not connected or all can be linked;

Redis multiple databases are not completely isolated, such as the Flushall command, which empties data from all databases in a Redis instance.

So a Redis database is more like a namespace than a data store for different applications. For example, you can use the No. 0 database to store data in an application production environment, using database 1th to store data in the test environment, but not suitable for using the No. 0 database to store a application data, 1th database storage B application database, different applications should use different Redis instances to store data. Because Redis is very lightweight, an empty Redis instance consumes only about 1MB of memory, so don't worry that multiple Redis instances will take up a lot of memory.

Redis (v)-database

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.