Prerequisites
- Rust 1.82+ (edition 2021)
- Cargo (comes with Rust)
- Git
Clone the Repository
Workspace Structure
Kora uses a Cargo workspace with the following crates:Dependency Graph
The workspace follows a strict, acyclic dependency graph:kora-core has zero internal workspace dependencies. This is a fundamental design principle—never introduce circular dependencies between crates.
Building
Build the Entire Workspace
Build in Release Mode
target/release/.
The release profile is configured with:
lto = "thin"— thin link-time optimizationcodegen-units = 1— maximum optimization (slower build, faster binary)strip = true— remove debug symbols
Build a Specific Crate
Build the CLI Binary
./target/release/kora-cli.
Running the Server
After building, start the server:cargo run:
CLI Arguments
Using a Config File
Createkora.toml:
Testing
Run All Tests
Run Tests for a Specific Crate
Run a Specific Test
Run Stress Tests
Kora includes stress tests with concurrent workloads:Run Tests with Output
Benchmarks
Kora uses Criterion for benchmarks.Run All Benchmarks
Run Benchmarks for a Specific Crate
target/criterion/ with HTML reports.
Available Benchmarks
- kora-core:
SET,GET,INCR,MGEToperations - kora-protocol: RESP2 parsing and serialization
- kora-vector: HNSW index construction and search
Code Quality
Run Clippy Lints
Kora enforces zero Clippy warnings:Format Code
rustfmt settings. All code must be formatted before committing.
Check Without Building
Fast type-checking without codegen:Documentation
Build Documentation
Open Documentation in Browser
Document a Specific Crate
Development Workflow
Before committing, always run:- Code is properly formatted
- No Clippy warnings
- All tests pass
Build Profiles
Debug Profile (default)
- Fast compilation
- Debug symbols included
- No optimizations
- Binaries in
target/debug/
Release Profile
- Slow compilation
- Optimizations enabled (
-O3) - Thin LTO, single codegen unit
- Debug symbols stripped
- Binaries in
target/release/
Bench Profile
Platform-Specific Notes
Linux
Kora usesio-uring for async I/O on Linux. Ensure you have a recent kernel (5.1+):
macOS
No special requirements. Standard Tokio async I/O is used.Windows
Kora should build on Windows, but production deployment is recommended on Linux for optimal performance.Troubleshooting
Build Fails with Missing Dependencies
Ensure you’re using Rust 1.82+:Tests Fail Intermittently
Some tests involve concurrency and may rarely fail due to timing. Re-run tests:Clippy Warnings
Fix all warnings before submitting a PR:Slow Builds
Use faster linker (mold on Linux, lld on macOS):
Cross-Compilation
Kora can be cross-compiled for different targets:Next Steps
- Contributing Guide — submitting PRs and code standards
- Embedded Mode — using Kora as a library
- Architecture — understanding the shard-affinity design