RedisDesign and Implementation
Basic Information
Huang jianhong
Series name: Database Technology series
Press: Machinery Industry Press
ISBN: 9787111464747
Mounting time:
Published on: February 1, June 2014
Start: 16
Page number: 1
Version: 1-1
Category: Computer> database theory> comprehensive
More about"《RedisDesign and Implementation
Introduction
Books
Computer books
Redis design and implementation comprehensively and completely explains the internal mechanism and implementation method of redis, and introduces most of the single-host functions of redis and the implementation principles of all multi-host functions, the core data structure and key algorithm ideas of these functions are displayed. The diagrams are rich, the descriptions are clear, and a large amount of reference information is provided. By reading this book, you can quickly and effectively understand the internal structure and operation mechanism of redis to better and more efficiently use redis.
Redis design and implementation consists of four main parts. The first section "data structure and object" describes various objects in redis and their data structures, and describes how these data structures affect the functions and performance of objects. The second part introduces how to implement a single-host database in redis, including database, RDB persistence, aof persistence, and events. The third part introduces the Sentinel, replication, and cluster functions of apsaradb for redis. The fourth part introduces the independent function modules in redis, it involves publishing and subscription, transactions, Lua scripts, sorting, binary array, slow query logs, and monitors. The author of this book maintains the website www.redisbook.com and provides the redis source code with detailed comments, as well as the updates related to this book.
Directory
Redis Design and Implementation
Preface
Thank you
Chapter 1 Introduction 1
1.1 redis version 1
1.2 chapter orchestration 1
1.3 Recommended reading method 4
1.4 writing rules 4
1.5 supporting websites 5
Part 1 data structure and Object
Chapter 2 simple dynamic string 8
2.1 SDS Definition 9
2.2 differences between SDS and C strings 10
2.3 sds api 17
2.4 important review 18
2.5 References 18
Chapter 19 linked list 19
3.1 Implementation of linked list and linked list node 20
3.2 linked list and linked list node API 21
3.3 key review 22
Chapter 2 dictionary 23
4.1 dictionary implementation 24
4.2 hash algorithm 27
4.3 resolve key conflicts 28
4.4 rehash 29th
4.5 progressive rehash 32
4.6 dictionary API 36
4.7 key review 37
Chapter 3 jump table 38
5.1 skip Table Implementation 39
5.2 skip table API 44
5.3 important Review 45
Chapter 4 Integer Set 46
6.1 Integer Set implementation 46
6.2 upgrade 48
6.3 benefits of upgrade 50
6.4 downgrade 51
6.5 integer collection API 51
6.6 important review 51
Chapter 52 compression list 52
7.1 compression list composition 52
7.2 compression list node composition 54
7.3 chain update 57
7.4 compressed list API 59
7.5 key review 59
Chapter 1 object 60
8.1 object type and encoding 60
8.2 String object 64
8.3 list object 68
8.4 hash object 71
8.5 collection object 75
8.6 ordered set object 77
8.7 type check and command polymorphism 81
8.8 memory recycling 84
8.9 object sharing 85
8.10 idling duration of the object 87
8.11 important review 88
Part 2 Implementation of standalone Databases
Chapter 1 Database 90
9.1 database 90 on the server
9.2 switch database 91
9.3 database key space 93
9.4 set the key survival time or expiration time 99
9.5 expiration key deletion policy 107
9.6 redis expiration key deletion policy 108
9.7 aof, RDB, and replication functions process expired keys 111
9.8 database notification 113
9.9 important Review 117
Chapter 2 RDB persistence 10th
10.1 RDB File Creation and loading 119
10.2 automatic interval saving 121
10.3 RDB file structure 125
10.4 analyze RDB files 133
10.5 important review 137
10.6 references 137
Chapter 2 aof persistence 11th
11.1 aof persistence implementation 139
11.2 aof file loading and data restoration 142
11.3 aof rewrite 143
11.4 important review 150
Chapter 1 events 12th
12.1 file event 151
12.2 time event 156
12.3 event scheduling and execution 159
12.4 important review 161
12.5 references 161
Chapter 4 client 13th
13.1 client properties 163
13.2 create and disable a client 172
13.3 important review 174
Chapter 2 server 14th
14.1 command request execution process 176
14.2 servercron function 184
14.3 initialize server 192
14.4 important review 196
Part 3 Implementation of multi-machine Databases
Chapter 2 Copy 15th
15.1 Implementation of the old version copy function 199
15.2 defects of the old version copy function 201
15.3 Implementation of the new copy function 203
Part 1 Implementation of re-synchronization 15.4
15.5 psync command implementation 209
15.6 replication implementation 211
15.7 heartbeat detection 216
15.8 important review 218
Chapter 2 sentinel 16th
16.1 start and initialize sentinel 220
16.2 obtain master server information 227
16.3 obtain slave server information 229
16.4 send messages to the master server and slave server 230
16.5 channel information received from autonomous servers and slave servers 231
16.6 check subjective deprecation status 234
16.7 check objective deprecation status 236
16.8 election leader sentinel 238
16.9 failover 240
16.10 important review 243
16.11 references 244
Chapter 2 cluster 17th
17.1 nodes 245
17.2 slot assignment 251
17.3 Execute Command 258 in Cluster
17.4 repartition 265
17.5 ask error 267
17.6 replication and Failover 273
17.7 message 281
17.8 important review 288
Part 4 Implementation of independent functions
Chapter 4 publishing and subscription 18th
Subscription and Unsubscription of channel 18.1 292
18.2 subscription and unsubscribe 295
18.3 send message 298
18.4 view subscription information 300
18.5 important review 303
18.6 references 304
Chapter 4 Transactions 19th
19.1 transaction implementation 306
19.2 watch command implementation 310
19.3 ACID properties of transactions 314
19.4 important review 319
19.5 references 320
Chapter 2 Lua script 20th
20.1 create and modify a Lua environment 322
20.2 Lua environment collaboration component 327
20.3 eval command implementation 329
20.4 evalsha command implementation 332
20.5 Implementation of script management commands 333
20.6 script replication 336
20.7 important review 342
20.8 references 343
Chapter 1 sorting 21st
21.1 sort [Key] command implementation 345
21.2 Alpha option implementation 347
21.3 Implementation of ASC options and desc options 348
21.4 by option 350
21.5 implement the by option with the Alpha option 352
21.6 Implementation of the limit option 353
21.7 get option implementation 355
21.8 store option implementation 358
21.9 execution sequence of multiple options: 359
21.10 important review 361
Chapter 2 binary array 22nd
The value of the 22.1-bit array is 363.
22.2 Implementation of the getbit command 365
22.3 setbit command implementation 366
22.4 bitcount command implementation 369
22.5 bitop command implementation 376
22.6 important review 377
22.7 references 377
Chapter 4 slow query log 23rd
23.1 saving slow query records 380
23.2 reading and deleting slow query logs 382
23.3 add new log 383
23.4 important review 385
Chapter 4 monitor 24th
24.1 become a monitor 387
24.2 send command information to monitor 387
24.3 important review 388
Source of this book information:Interactive publishing network