How microsoftarchive/redis works
This repository is a Windows port of the Redis in-memory data store. The main workflow is a client sending commands to the server, which executes them against Redis data structures and returns replies; separate subsystems cover persistence, replication, clustering, scripting, and monitoring. Windows-specific layers provide service hosting, process behavior, and virtual file descriptors. The README documents Windows service support, the fork replacement, jemalloc, and descriptor mapping. Several runtime sources were not sampled, so unverified internal calls are omitted or shown as dashed, unevidenced relationships.
Main entry points: redis.c Server runtime · db.c Command execution · networking.c Command networking · sentinel.c Sentinel monitoring
Components 22
Redis Server
- Server runtime
src/redis.c - Command networking
src/networking.c - Command execution
src/db.c - Blocked clients
src/blocked.c - Publish subscribe
src/pubsub.c - Lua scripting
src/scripting.c - Lua runtime
deps/lua/src
Data and Persistence
- Data structures
src - RDB persistence
src/rdb.c - AOF persistence
src/aof.c
Distributed Redis
- Replication
src/replication.c - Cluster management
src/cluster.c - Sentinel monitoring
src/sentinel.c
Windows Runtime
- Windows service host
src/Win32_Interop/Win32_service.cpp - Virtual descriptors
src/Win32_Interop/Win32_FDAPI.h - Process emulation
src/Win32_Interop/Win32_QFork.cpp - jemalloc allocator
deps/jemalloc-win/src/arena.c
Client Tools
- Redis CLI
src/redis-cli.c - Interactive input
deps/linenoise/linenoise.c - Redis client library
deps/hiredis/hiredis.c - Async client API
deps/hiredis/async.c
Other components
- Redis clients
Connections 21
- Redis clients → Command networking: sends commands
- Command networking → Command execution: dispatches
- Command execution → Data structures: uses structures
- Command execution → Blocked clients: checks waiters
- Command execution → Publish subscribe: routes messages
- Server runtime → Command networking: runs service
- Server runtime → RDB persistence: coordinates saves
- Server runtime → AOF persistence: coordinates logging
- Server runtime → Replication: coordinates replication
- Server runtime → Cluster management: coordinates cluster
- Server runtime → Lua scripting: runs scripts
- Lua scripting → Lua runtime: embeds runtime
- Cluster management → Server runtime: uses server definitions
src/cluster.c - Sentinel monitoring → Redis client library: uses client API
src/sentinel.c - Sentinel monitoring → Async client API: uses async API
src/sentinel.c - Redis CLI → Interactive input: reads input
- Redis CLI → Redis client library: sends commands
- Windows service host → Server runtime: calls main
src/Win32_Interop/Win32_service.cpp - Server runtime → Virtual descriptors: uses descriptor layer
- Server runtime → Process emulation: uses fork replacement
- Server runtime → jemalloc allocator: allocates memory