In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
How many libraries are there in redis? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.
Redis is a dictionary-structured storage server, but in fact an Redis instance provides multiple dictionaries for storing data, and the client can specify which dictionary to store the data in. This is similar to the well-known fact that multiple databases can be created in a relational database instance, so each dictionary can be understood as a separate database.
Each database is externally named with an incremental number starting from 0. Redis supports 16 databases by default (more can be supported through configuration files, no upper limit). You can modify this number by configuring databases. The client automatically selects database 0 after establishing a connection with Redis, but you can use the SELECT command to change the database at any time. To select database 1:
Redis > SELECT 1OKredis [1] > GET foo (nil)
However, these databases named after numbers are different from those we understand. First of all, Redis does not support custom database names, each database is named by a number, and developers must record which databases store which data. In addition, Redis does not support setting a different access password for each database, so a client can either access all databases or do not even have permission to access one database. The most important point is that multiple databases are not completely isolated. For example, the FLUSHALL command can empty the data in all databases in a Redis instance. To sum up, these databases are more like a namespace than suitable for storing data from different applications. For example, database 0 can be used to store data in the production environment of an application, and database 1 can be used to store data in the test environment, but it is not suitable to use database 0 to store data in application An and database B in database 1. Different applications should use different Redis instances to store data. Because Redis is very lightweight, an empty Redis instance takes up only about 1m, so you don't have to worry about multiple Redis instances taking up a lot of extra memory.
Under redis, the database is identified by an integer index, not by a database name. By default, a client connects to database 0. The following parameters in the redis configuration file control the total number of databases:
/ etc/redis/redis.conf
In the file, there is a configuration item databases = 16 / / there are 16 databases by default
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.