# System map — redis/redis

> Canonical page: https://codevetter.com/unpack/redis/system-map

# System map — redis/redis

Scanned commit c3215f019a4c11c35d438f241114e94730fe39e5 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The runtime is one `redis-server` binary whose `main()` in `src/server.c` initializes config, ACL, the module system and connection types, then hands control to the `ae` event loop (`aeMain`). The same binary multiplexes into sentinel, `redis-check-rdb` and `redis-check-aof` modes by argv[0] inspection. Storage is entirely in-process (`kvstore`/`dict`/`listpack`/`quicklist`/`rax`/`ebuckets`), persisted by RDB snapshot and/or AOF manifest, and replicated over a custom PSYNC protocol. Build is GNU Make: `src/Makefile` compiles the core and vendored `deps/`, while the top-level `Makefile` delegates to `scripts/*.sh` for the module-bundle workflow. Deployment shape is a bare binary + `redis.conf` (or the generated `redis-full.conf`), with an Ubuntu 24.04 build image in `docker/Dockerfile.noble`.
- `main()` in src/server.c is the single entrypoint for redis-server, redis-sentinel, redis-check-rdb and redis-check-aof: it calls `checkForSentinelMode()` on argv, then dispatches to `redis_check_rdb_main()` / `redis_check_aof_main()` when `strstr(exec_name, "redis-check-rdb"/"redis-check-aof")` matches, before any config parsing. — [src/server.c#L8251-8365](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.c#L8251-L8365)
- Startup order in `main()` is fixed and dependency-driven: `initServerConfig()` → `ACLInit()` (commented 'must be initialized ASAP because the basic networking code and client creation depends on it') → `moduleInitModulesSystem()` → `connTypeInitialize()` → `keyMetaInit()`. — [src/server.c#L8330-8340](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.c#L8330-L8340)
- The event loop is created in `initServer()` via `aeCreateEventLoop(server.maxclients+CONFIG_FDSET_INCR)`, and per-DB storage is allocated as three parallel structures — `kvstoreCreate()` for `db->keys`, `db->expires`, plus `blessedKvstoreCreate()` for `db->blessed_keys` and `estoreCreate()` for `db->subexpires`. — [src/server.c#L3105-3130](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.c#L3105-L3130)
- `main()` ends with `aeMain(server.el)` after `redisSetCpuAffinity(server.server_cpulist)` and `setOOMScoreAdj(-1)`; everything after that point is event-loop driven. — [src/server.c#L8600-8614](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.c#L8600-L8614)
- The core links 130+ objects listed in `REDIS_SERVER_OBJ` in src/Makefile, including the non-upstream modules `bless.o t_array.o sparsearray.o chk.o hotkeys.o gcra.o vector.o fwtree.o estore.o client_comp.o cluster_asm.o iothread.o keymeta.o`. — [src/Makefile#L404](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L404)
- Vendored third-party code lives in `deps/` and is built as separate targets: `DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram fpconv xxhash tre` — note `tre` (regex) is a dependency of the new array type, which includes `../deps/tre/local_includes/tre.h`. — [src/Makefile#L39](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L39) [deps/](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/deps/) [src/t_array.c#L15-17](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/t_array.c#L15-L17)
- The top-level Makefile is not upstream's: it includes `modules/manifest.mk`, defines a `GOALS_WITH_ARGS` positional-argument capture mechanism, and routes `build`/`clean`/`test`/`deploy`/`bootstrap`/`run`/`tarball` to `scripts/*.sh` rather than recursing into `src/`. — [Makefile#L13-45](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/Makefile#L13-L45) [Makefile#L100-160](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/Makefile#L100-L160)
- `modules/modules.yaml` is the single source of truth pinning four external modules to immutable refs: redisbloom v8.11.81, redisearch v8.10.1 (with `build_env: LTO=1 REDISEARCH_GENERATE_HEADERS=0 INLINE_LSE_ATOMICS=0`), redisjson v8.10.0, redistimeseries v8.10.0. — [modules/modules.yaml](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/modules/modules.yaml) [modules/MODULES.md#L18-40](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/modules/MODULES.md#L18-L40)
- Test entrypoints are four shell wrappers that locate tclsh 8.5–9.0 and invoke `tests/test_helper.tcl`: `./runtest`, `./runtest-moduleapi` (which first runs `$MAKE -C tests/modules` then names 48 `--single unit/moduleapi/*` suites), `./runtest-cluster`, `./runtest-sentinel`. — [runtest](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/runtest) [runtest-moduleapi](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/runtest-moduleapi) [src/Makefile#L529-541](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L529-L541)
- `make -C src test` depends on building redis-server, redis-check-aof, redis-cli, redis-benchmark and `module_tests` before shelling out to `(cd ..; ./runtest)`; `test-modules`, `test-sentinel`, `test-cluster` are separate targets. — [src/Makefile#L529-541](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L529-L541)
- External integrations are network protocols rather than SDKs: the cluster bus (`src/cluster_legacy.c`), the PSYNC replication protocol (`src/replication.c`), TLS via OpenSSL gated on `BUILD_TLS=yes|module` (`src/tls.c`), and optional zstd compression gated on `-DUSE_COMPRESSION=1` detected via pkg-config. — [src/Makefile#L157-169](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L157-L169) [src/Makefile#L343-357](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L343-L357) [src/tls.c](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/tls.c) [src/client_comp.c#L1-6](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/client_comp.c#L1-L6)
- The deployment artifact set is defined by `scripts/deploy.sh` / `scripts/uninstall.sh`: core binaries and symlinks into `$(PREFIX)/bin` (default `/usr/local`) and module `.so` files into `$(PREFIX)/lib/redis/modules`, with `loadmodule` paths rewritten into a generated `redis-full.conf`. — [Makefile#L117-140](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/Makefile#L117-L140) [scripts/deploy.sh](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/scripts/deploy.sh) [scripts/sync-redis-conf.sh](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/scripts/sync-redis-conf.sh)
- `docker/Dockerfile.noble` is the only container definition — an Ubuntu 24.04 multi-arch build environment (amd64+arm64) that installs Redis prereqs and then runs `modules/docker-install-bundled-module-deps.sh` to execute each bundled module's `.install/install_script.sh`. It is a build image, not a runtime image. — [docker/Dockerfile.noble#L1-55](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/docker/Dockerfile.noble#L1-L55)
- Memory allocator selection is a build-time runtime boundary: `MALLOC` defaults to `jemalloc` on Linux and `libc` elsewhere, and is forcibly downgraded to `libc` whenever `SANITIZER` is set. — [src/Makefile#L81-120](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L81-L120)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
