Open-Source Wikis

/

Redis

/

Fun facts

redis/redis

Fun facts

A small collection of trivia for the curious.

The oldest surviving code

git log --reverse says the first commit landed on 22 March 2009. The files added in that commit that are still in src/ today include sds.c, dict.c, ae.c, anet.c, adlist.c, and zmalloc.c. The dict.h API has been extended dozens of times but the core "two hash tables, incremental rehash" design has never been replaced. The same is true of sds: the length-prefix-before-the-pointer trick has been in the codebase for the entire 17-year history.

Lolwut

src/lolwut.c and the version-stamped sequels lolwut5.c, lolwut6.c, and lolwut8.c exist solely to draw an ASCII-art message when you type LOLWUT into redis-cli. The convention is to add a new one every major release; the 8.0 implementation in lolwut8.c is the current default. The command is real, registered in the command table, and shipped in production builds.

The MANIFESTO

The repository root contains a 6.8 KB file named MANIFESTO. It is not a build manifest; it is a literal manifesto written by Salvatore Sanfilippo describing the design philosophy of Redis (small, focused, code-as-craft, "we are against complexity"). It still ships in every release tarball.

Bus port = data port + 10000

Cluster nodes communicate on a "cluster bus" that is exactly 10000 ports above the data port (src/cluster_legacy.c). It's a hard-coded offset; you cannot configure them independently. If you set port 6379 you also implicitly use 16379.

Two implementations of the cluster transport

src/cluster_legacy.c is 6,581 lines. src/cluster_asm.c is 152,651 bytes (≈4,500 lines). The "asm" suffix here means Auto Slot Migration, not assembly. They are two different cluster controllers that both link into redis-server, with a routing layer in src/cluster.c choosing which to use.

The biggest file in src/

It is module.c at 15,743 lines. Every RedisModule_* exported symbol is implemented there. The runner-up is redis-cli.c at 11,144 lines — this is the interactive shell, monitor, cluster manager, latency tester, big-keys scanner, and live key visualiser, all in a single C file with a giant main() switch.

Tcl, of all things

The integration test harness is written entirely in Tcl 8.6+ (tests/test_helper.tcl, tests/support/*.tcl, tests/unit/**.tcl). Tcl is not used anywhere in the runtime; it is purely for tests. The reason is historical: Tcl was the most natural fit for embedding a Redis client driver in a test harness in 2010, and it has stayed because the harness now contains roughly 220 test files and >300 KB of test infrastructure. The dependency is documented in README.md.

The kqueue, epoll, evport, select swap

src/ae.c selects an event-multiplexing backend at compile time by including exactly one of ae_epoll.c, ae_kqueue.c, ae_evport.c, or ae_select.c. The decision is made by a chain of #ifdefs at the top of ae.c. Linux gets epoll, BSD/macOS get kqueue, Solaris/Illumos get evport, and Haiku gets select as a last resort.

Two spellings of the same author

The git log lists both antirez and Salvatore Sanfilippo as separate authors with 6,153 and 1,059 commits respectively. They are the same person; the first email/handle was used until ~2014, the second after. Combined they account for roughly 55% of the entire commit history.

A Redis without Redis Inc.

The first commit predates the company "Redis Ltd." by years. The trademark, licence, and stewardship were folded under Redis Ltd. only in 2014 onward. The current LICENSE.txt is the third licence the project has carried (BSD-3 → SSPLv1 → tri-license RSALv2/SSPLv1/AGPLv3). Old contributions remain BSD-3 — REDISCONTRIBUTIONS.txt enumerates which.

redis-server is also redis-sentinel, redis-check-rdb, and redis-check-aof

The Makefile builds one binary, redis-server. The other three (redis-sentinel, redis-check-rdb, redis-check-aof) are hard links produced by cp -p in the install step (src/Makefile's MAKE_INSTALL macro). The binary checks argv[0] at startup and dispatches into a different main() path — see redis_check_rdb_main() and redis_check_aof_main() calls in src/server.c around line 7975.

Configuration generated by example

The shipped redis.conf (118 KB) and redis-full.conf (13 KB) are the documentation of every config option. There is no separate "options reference" — the comments in those files are the canonical description of what each option does. The full set of supported options is enumerated in src/config.c (~160 KB), with a one-to-one match between table entries and .conf lines.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Fun facts – Redis wiki | Factory