How wiqer/ef-redis works
Project type and purpose
• EF-Redis is a standalone Java implementation of a Redis server, built on top of Netty.
• It accepts Redis (RESP) protocol commands over TCP, executes them against an in-memory data store, appends operations to an AOF log, and returns RESP-encoded replies.
File structure
• Top‐level: pom.xml, src/main/java/com/wiqer/redis, src/main/resources, src/test
• com.wiqer.redis: entry point (MyRedisServer, RedisServer), networking (channel/…/ChannelOption, netty/channel/…), protocol (resp/*, CommandDecoder, ResponseEncoder), core logic (RedisCoreImpl, CommandHandler, command/impl/*), data types (RedisData, RedisString, RedisList…), persistence (aof/Aof, RingBlockingQueue), utilities, configs.
• Patterns:
• Netty pipeline pattern (decoder → handler → encoder)
• Strategy pattern (ChannelSelectStrategy + multiple ChannelOption implementations)
• Command factory + command hierarchy (CommandFactory, Command and impl/*)
• Single-threaded vs multi-threaded event loops
README for additional insights
• Server startup via MyRedisServer using Java+Netty
• Supports only AOF persistence and basic five data types
• Recommends single‐threaded select model for best performance
• External clients: redis-client, redis-desktop
Detail
• Every major package or logical module as a distinct component.
• Both synchronous flow (command handling) and asynchronous flow (AOF queue).
• Strategy pattern decision point for ChannelOption selection.
• Configuration loading at startup.