repowiseredis/redis

Architecture of redis/redis

redis/redis is 1,497 source files holding 24,089 symbols across 8 modules, written mainly in C, C++, Shell. The largest module is deps, with 610 files, and 5 files are entry points into the dependency graph.

How redis fits together

Client requests enter through the server, and src/entry.c and src/server.c are the entry points where startup and command handling begin. src/server.c coordinates server startup and periodic background work, and it connects networking, clustering, replication and modules through shared headers in src. The modules directory holds the modules API and bundled modules, which extend redis with additional commands, including the vector-sets example at modules/vector-sets/examples/cli-tool/cli.py. deps/hiredis supplies the client core with synchronous and asynchronous interfaces, and deps/lua supplies the Lua runtime that other parts call into. Replies are returned to the client once the core engine has executed the command.

Largest modules

  • deps: 610 files and 105,144 lines of code
  • src: 223 files and 142,640 lines of code
  • modules: 55 files and 8,577 lines of code
  • tests: 49 files and 11,506 lines of code
  • utils: 24 files and 2,099 lines of code
  • scripts: 13 files and 1,233 lines of code
  • root: 1 file and 154 lines of code
  • tools: 1 file and 391 lines of code

Languages

By file count: C 476 files, C++ 320 files, Shell 84 files, Python 50 files, Luau 20 files, Makefile 16 files.

Documentation

Repowise documents redis in 2,475 pages generated from the source, 23 of them written explanations of the repository and its modules. Module guides include:

  • tools: Array Benchmark Script
  • deps/fpconv: FP Conversion and Hashing
  • deps/hiredis/adapters: Hiredis Event Adapters
  • deps/hiredis: Hiredis Overview

More on redis: summary and FAQ, codebase overview, code health.