redis/redis
By the numbers
Data collected on 2026-04-30 from the unstable branch at commit 0bbb196c4.
This page is a quantitative snapshot of the codebase. It is regenerated each time the wiki is rebuilt.
Size
| Metric | Value |
|---|---|
Total .c files (excluding deps/) |
219 |
Total .h files (excluding deps/) |
81 |
Total lines of .c source (excluding deps/) |
200,399 |
Total lines of .h source (excluding deps/) |
16,012 |
Lines in src/ only (.c + .h) |
~190,000 |
| Tcl test files | 219 |
JSON command spec files (src/commands/) |
244 |
xychart-beta horizontal
title "Lines of code by file (top 10 in src/, excluding generated commands.def)"
x-axis ["module.c", "redis-cli.c", "server.c", "cluster_legacy.c", "t_stream.c", "networking.c", "sentinel.c", "replication.c", "t_zset.c", "rdb.c"]
y-axis "Lines" 0 --> 16000
bar [15743, 11144, 8222, 6581, 6197, 5783, 5474, 5452, 5033, 4659]src/commands.def is generated and clocks in at 485,000 bytes (12,000 lines); it is excluded from the chart so handwritten code is comparable.
Structure
| Directory | Purpose | Lines (.c + .h) |
|---|---|---|
src/ |
The Redis server, CLI, and check tools. | ~190,000 |
src/commands/ |
One JSON file per command. | ~600 KB across 244 files. |
src/modules/ |
In-tree sample modules. | ~13,000. |
tests/ |
Tcl test harness. | n/a (Tcl). |
modules/vector-sets/ |
Built-in vector index. | ~7,500 (compiled into redis-server). |
deps/ |
Vendored third-party libraries. | Not counted; out of project scope. |
Activity
| Metric | Value |
|---|---|
Total commits on unstable |
13,052 |
| Commits in the last 365 days | 485 |
| Unique authors | 914 |
| First commit | 2009-03-22 (Salvatore Sanfilippo) |
| Most recent commit (this snapshot) | 2026-04-29 |
Churn hotspots (last 90 days)
| File | Commits |
|---|---|
src/server.h |
22 |
src/module.c |
16 |
src/db.c |
16 |
src/server.c |
14 |
src/rdb.c |
14 |
src/t_stream.c |
12 |
src/commands.def |
11 |
src/cluster.c |
11 |
src/t_hash.c |
10 |
src/cluster_asm.c |
8 |
server.h and commands.def are the two structural files that change every time someone adds a configuration option or a command. The presence of cluster_asm.c (Auto Slot Migration) and t_hash.c (hash-field TTL work) as hotspots reflects the active feature themes of the recent quarter.
Bot-attributed commits
Searching the full git history for committer or co-author lines containing [bot] returns 0 matches. Redis does not currently use Dependabot/Renovate-style automated bots in its unstable branch, and there is no factory-droid[bot] or github-actions[bot] co-authorship history. This is a lower bound — inline AI tools (Copilot etc.) leave no signal in commit metadata.
The closest thing to bot-authored work is the auto-generated file src/commands.def, produced by utils/generate-command-code.py. That file is committed with a real author identity, so it does not count.
Contribution distribution
The repo has 914 unique committers in its 17-year history. The top six committers between them author the bulk of src/:
| Range | Approx. share |
|---|---|
| Top 1 (antirez / Salvatore Sanfilippo, counting both spellings) | ~55% |
| Top 5 | ~70% |
| Top 20 | ~80% |
| Top 100 | ~92% |
Per-person line counts are intentionally omitted from this page; see Maintainers for the by-subsystem ownership table.
Complexity
The five largest single files in src/:
| File | Lines |
|---|---|
module.c |
15,743 |
redis-cli.c |
11,144 |
server.c |
8,222 |
cluster_legacy.c |
6,581 |
t_stream.c |
6,197 |
These are the natural candidates for refactoring. module.c is dominated by the API surface — every RedisModule_* exported symbol is implemented there — and is unlikely to shrink. redis-cli.c is a single-binary interactive shell that has accreted dozens of subcommands; it is a typical cleanup-opportunity candidate.
The deepest include chain runs src/server.h → commands.h, object.h, redismodule.h, keymeta.h, plus another two dozen direct headers. Practically every .c file in src/ includes server.h (transitively pulling in the entire schema for a redisServer, client, and redisDb). The codebase deliberately avoids per-translation-unit headers for the most common types.
Tests
| Suite | File count |
|---|---|
Unit (tests/unit/) |
90+ Tcl files (some collected in unit/type/) |
Integration (tests/integration/) |
28 Tcl files |
Cluster (tests/cluster/) |
Sub-tree |
Sentinel (tests/sentinel/) |
Sub-tree |
Module API (tests/unit/moduleapi/, helper modules in tests/modules/) |
60+ files |
The C-level unit tests embedded in redis-server (the redis-server test ... invocation) cover dict, ziplist, listpack, intset, sds, kvstore, t-digest, bloom, vset, gcra, fast_float_strtod, crc, hyperloglog, and a few internals.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.