|
|
9 сар өмнө | |
|---|---|---|
| .gitignore | 9 сар өмнө | |
| README.md | 9 сар өмнө | |
| command.zig | 9 сар өмнө | |
| hashing.zig | 9 сар өмнө | |
| index.zig | 9 сар өмнө | |
| main.zig | 9 сар өмнө | |
| makefile | 9 сар өмнө | |
| persistence.zig | 9 сар өмнө | |
| redis.zig | 9 сар өмнө | |
| requirements.md | 10 сар өмнө | |
| socket.zig | 9 сар өмнө | |
| storage.zig | 9 сар өмнө |
An in-memory key-value store written in Zig with Redis protocol compatibility and persistent storage.
PizzaKV is a concurrent key-value database that implements a subset of the Redis RESP (REdis Serialization Protocol), allowing it to work with Redis clients for supported commands. It also supports a simpler custom protocol (Pizzaria Protocol) using \r delimiters. Built from scratch in Zig.
\r-delimited custom protocolSET key value - Store a key-value pairGET key - Retrieve a value by keyDEL key - Delete a key\r-delimited)write key|value - Write a key-value pair (key and value separated by |)read key - Read a value by keydelete key - Delete a keykeys - Get all keys (using radix tree)reads prefix - Get all values for keys matching a prefixstatus - Server status check# Build optimized binary
make build
# Clean build artifacts
make clean
# Start server in Redis mode (RESP protocol, port 8085)
./pizzakv -redis
# Start server in Pizzaria mode (\r-delimited protocol, port 8085)
./pizzakv
# The server will create a .db file for persistence
Simple append-only format:
OPCODE|key|value\r
W|key|value\r - Write operationD|key|\r - Delete operationpizzakv/
├── main.zig # Server, connection handling
├── storage.zig # Sharded hash table
├── index.zig # Radix tree for prefix search
├── persistence.zig # AOF persistence layer
├── hashing.zig # Hash function
├── redis.zig # RESP protocol parser
├── command.zig # Command execution
├── socket.zig # TCP socket operations
└── benchmark_*.sh # Benchmark scripts
-O ReleaseFast optimization