Chapter XVIII - Publish and Subscribe
Write data
Command: Release
Format: publish channel data
function: to write data channel
Read Data
There are two modes
1 to subscribe to a channel
2. The pattern matching a plurality of channels
Role: read data from the channel
Chapter XXII - the number of bits set
Format: set the value of the index is to set an element array index value is 1 or 0
XXIII - slow query log
background
MySQL also slow query log, Redis also have to go.
Slow query log
Redis command record slow query operation logs
User monitoring and optimization of the command log command
Logs used to do? It is to give the user to monitor, identify problems, and optimization.
XXIV - Monitor
effect
Command information / logs sent to the monitor - the client. And real-time print log - command execution.
Process
Step
1. The client sends commands to monitor connections to the server
2. The server sends the client the client is added to the list listener inside
3. The process usually when the command processing is over, put forwards the command to the client implementation can
Note: The presentation of the book is that the server before processing commands, put forward command to monitor the client.
Just because a monitor which monitors the command currently being executed, rather than need to know all of the command execution.
In either case, if you want to know the information on the first small forward, much more aware of it after forwarding, it does not matter.
Sequence
What
is the general relationship between the database also has sorting functions, in essence, is to sort the data. For example, redis is the sort of key or value.
how to use?
sort key / value ASC / DESC
take
What
a lightweight scripting language, similar to the python this, but more lightweight.
Scenario
most of the game.
There are embedded as a scripting language to other software, such as redis.
Affairs
That meets the four ACID properties database. redis basically satisfied.
how to use?
Step
1.begin command
starts a transaction
plurality of command 2.
plurality atoms command submitted
3.end command
that is submitted to the transaction
The principle?
How to achieve multiple commands atomic commit, it is to put a set of multiple commands (queue) inside.
to sum up
Data structure of
linked list data structure such Redis is almost everywhere ah, there is an array, an array of various types of data, of course, the mapping. These are very common data structure.
reference
Huang Jianhong
Reproduced in: https: //juejin.im/post/5cf1059bf265da1b725be942