How starwindv/wind-kvstore works
Project type and purpose
• This is an open-source, embeddable persistent key-value store engine written in Rust, packaged with:
• A command-line interactive shell (binary: shell)
• A network server exposing the store over TCP (binary: server)
• A Python SDK (under sdk/python) for remote or embedded use
• It emphasizes local persistence, crash-safe writes via WAL, memory-mapped I/O, LRU caching, and paged storage.
File structure
• Top-level files: Cargo.toml, build.rs, LICENSE, README.md, doc/ (detailed docs in English/Chinese)
• src/ directory:
• kvstore.rs – core storage engine (pages, WAL, cache, free-list, compression)
• config.rs – server configuration loader
• server.rs + server_main.rs – network service logic + entry point
• shell.rs + shell_main.rs – interactive CLI logic + entry point
• utils.rs – shared helper functions
• sdk/python/ directory:
• wind_kvstore package wrapping either network calls or FFI
• client.py, pool.py, auto.py – connection pooling, client interface
• sdk/test/python – examples and integration tests for the Python SDK
README for additional insights
• Describes core API (open, get, put, delete, compact, identifier, close)
• Features: WAL, LRU cache, paged storage, free page management, compression
• Guides linking to separate docs for shell and server
Detail
• Every module only if it adds clarity (e.g., config.rs as “Config Loader” inside Server)
• Flow of data for both reads and writes
• Crash recovery path via WAL
• Default parameters (page size, cache size) if space allows