How antirez/redis works
Project type and purpose
• This is Redis: a high-performance, in-memory data structure server (NoSQL database, cache, message broker, vector store).
• Written in C, it exposes a text-based RESP protocol to clients, supports modules (extensions), clustering, replication, and sentinel for high availability.
File-structure analysis
• Top-level directories:
• src/ ← core server code (event loop, command dispatch, data structures, persistence, replication, cluster, sentinel)
• deps/ ← bundled third-party libraries (jemalloc, lua, hiredis, linenoise, fpconv, hdr_histogram, etc.)
• modules/ ← Redis modules (RedisJSON, RedisGraph, RedisBloom, vector-sets, etc.) built via the modules API
• tests/ ← tests for core, cluster, sentinel, modules (tcl, C, Python)
• utils/ ← scripts and tools (release, building, cluster, schema linter, etc.)
• src/commands/ ← machine-generated JSON specs for every Redis command
• src/ae.c/.h ← event-driven reactor (select/epoll/kqueue)
• src/thread_mngr ← optional I/O threads manager
• src/rdb.c/aof.c ← persistence engines (RDB snapshots, AOF)
• src/replication.c, cluster.c, sentinel.c ← HA and sharding
• Makefile, redis.conf, redis-full.conf ← build and deployment config
Key insights from README
• Redis keeps data in memory, supports modules, provides multiple data structures & probabilistic structures, clustering, sentinel, and can be built with TLS and modules support.
• The build instructions stress feature flags (BUILD_WITH_MODULES, BUILD_TLS) and show how core, deps, and modules interoperate.