As an outstanding representative of the NoSQL database, Redis has been widely watched, and its lightweight agile architecture has always been known as the Swiss Army knife in storage. An article recommended below that explains the entire Redis workflow from a source point of view is an excellent article to understand the Redis process. In English, it's going to take some time to figure it out.
Original link: Redis:under the hood
Directory:
- Startup
- Beginning Global Server State initialization
- Setting Up Command table
- Loading config file
- Initserver ()
- Shared objects
- Event Loop
- Databases
- TCP sockets
- Server Cron
- Registering connection handler with event loop
- Opening the AOF
- Back up to Main ()
- Restoring data
- Event Loop Setup
- Entering the event loop
- Processing a request & returning a response
- Handling a new connection
- Reading a command from a client
- Executing the command and responding
- Summary
- Next time-tracing a SET and GET
Redis Startup Flowchart:
Redis Command processing Flowchart:
In-depth Redis internal-redis source Explanation (GO)