Http://www.searchtb.com/2011/05/redis-storage.html1 redis memory storage structure
This article is based on the Redis-v2.2.4 version for analysis.
1.1 overall redis memory storage structure
Redis supports multiple key-value databases (tables) and uses redisdb to represent a key-value database (table ). redisserver has a redisdb * dB; member variable. During redisserver initialization, A redisdb array is created based on the number of DB in the configuration file. after the client connects, select a reidsdb using the SELECT command. If this parameter is not specified, the default value is redisdb. after a client selects redisdb, subsequent operations are performed on this redisdb. the memory structure of redisdb is described in detail below.
Redis memory storage structure
Redisdb definition:
12345678910111213141516171819 |
Typedef Struct Redisdb { Dict * dict; /* The keyspace for this dB */ |