Skip to content
djairofilhoPublic

About

In-memory database server in Rust with an incremental Redis-compatible core

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Sider

Sider is an in-memory database server project written in Rust. Its goal is to provide an explicit subset of Redis compatibility over RESP2. The name is Redis spelled backward.

The published version is 1.0.1; the current checkout contains staged work after that release. Publication of the planned Docker image depends on validating its candidate build and files. The 1.0.1 release notes describe the published scope without replacing gate receipts.

The binary serves strings, multikey operations, SET options, and TTL over RESP2/TCP. Hashes, lists, sets, and sorted sets share TTL, quota, and typed persistence. Pub/Sub provides binary channels, per-connection subscriptions, and bounded queues. Single-shard transactions provide MULTI, EXEC, DISCARD, WATCH, and UNWATCH, with one AOF append per batch and no rollback for individual execution errors. Owning workers serialize each shard, with bounded queues, connections, and buffers and a default total logical quota of 64 MiB. Optional AOF provides replay, global compaction, and offline shard migration.

Asynchronous Sider → Sider replication transfers snapshots and durable batches, resumes available history, and allows manual promotion. Replicas require the same version and shard configuration; Pub/Sub remains local. Consistent backup exports data while traffic continues, with integrity verification and restoration into a new directory. The published 1.0.1 package has no authentication, TLS, or automatic failover. Use the controlled single-host deployment profile with a loopback client listener; shared-network use is outside that profile.

The strings guide describes commands and limits. The collections and sorted sets guides describe commands in those families and their differential evidence. The complete matrix brings together supported forms, restrictions, and evidence, including transactions and sequences across families. The differential reference uses Redis and redis-cli 8.10.1, pinned in the plan. The 0.1.0-rc.1 candidate was published in the public repository and remains a historical record.

Deliverables and the planned 1.1.0 release are organized in the ROADMAP, with 13 milestones and 57 implementation tasks. Milestones 0.1–0.10 have technical checkpoints; 1.0 and explicitly registered patches have candidate and final releases. The release guide describes synchronizing the backlog and preparing a candidate and final release with the same SHA and approved files. The execution plan through v1 summarizes the current state, next deliverable, and criteria for each version. The agent development guide routes the current GitHub issues by dependency, acceptance evidence, and model. The next development plan records the active workstreams; its proposals do not expand the released 1.0.1 contract.

CI and automatic publication remain deferred. Development uses local validation, and the planned 1.1.0 image will be published manually after its gates pass.

INFO queries instance metrics and sider --diagnose validates configuration without starting the server. The operations guide defines fields, limits, and procedures for full queues, slow clients, and AOF failures. The historical v1.0.1 packages include sider, sider-aof-migrate, sider-backup, and sider-replica. Its Docker image archive copies the Linux executables. The Docker-only v1.1.0 launch plan covers the current development capabilities and its two separate durable profiles. That candidate has not been published; v1.0.1 remains the current release. The v1.0.1 runtime requirements document historical native packages. Version 1.1.0 will distribute only a Linux amd64 container image.

Running the server

Install Rust with rustup. The toolchain and development components are defined in rust-toolchain.toml; rustup uses that file when running commands in the project directory.

git clone https://github.com/djairofilho/sider.git
cd sider
cargo run --locked -- --help
cargo run --locked -- --version

The repository is public and can be cloned without authentication.

The current checkout defaults to a protected security profile that requires a validated SIDER_SECURITY_DIR. Protected client and internal TLS startup is available on POSIX in this development stage; protected Windows startup remains gated. For a controlled loopback development instance, select SIDER_SECURITY_PROFILE=legacy-loopback explicitly. In a POSIX shell:

SIDER_SECURITY_PROFILE=legacy-loopback cargo run --locked

In PowerShell:

$env:SIDER_SECURITY_PROFILE = 'legacy-loopback'
try {
    cargo run --locked
} finally {
    Remove-Item Env:SIDER_SECURITY_PROFILE
}

Use Ctrl+C to shut down. In another terminal, a RESP2 client can send the supported commands. Without SIDER_AOF_DIR, data is lost when the process terminates. With AOF, recovery completes before binding and follows the synchronization policy described in the persistence guide.

Configuration

Variable Default Format
SIDER_ADDR 127.0.0.1:6379 IP address and port; IPv6 in brackets
SIDER_SECURITY_PROFILE protected in the development checkout Use legacy-loopback only for controlled plaintext development
SIDER_SECURITY_DIR Unset Absolute directory containing the validated protected generation; required for protected startup
SIDER_READY_FILE Unset New readiness file with PID, IP, and actual port
SIDER_MAX_DATASET_BYTES 67108864 Positive logical quota, distinct from RSS; no eviction
SIDER_SHARDS 1 Between 1 and 256 workers, with divided quota and fixed configuration
SIDER_AOF_DIR Unset Exclusive data directory; enables AOF
SIDER_AOF_RECORD_VERSION 1 Set 2 with SIDER_AOF_DIR to enable durable MEM.*; an internal listener can export live backups, while replica following remains unavailable
SIDER_AOF_COMPOSED 0 Set 1 with record version 1 and SIDER_AOF_DIR on both nodes for header-7 mixed-owner EXEC and transport-3 replication in the development checkout
SIDER_AOF_SYNC always always waits for sync per batch; everysec synchronizes periodically
SIDER_REPLICATION_ADDR Unset Internal replication, backup, and administration listener; requires AOF
SIDER_REPLICA_OF Unset Upstream IP and port; configures the instance as a replica
SIDER_REPLICATION_READY_FILE Unset Separate readiness file for the internal listener

The address is validated strictly. Use an IP, such as 127.0.0.1:6380 or [::1]:6380, rather than a hostname. Invalid configuration terminates the program with an error. Port 0 requests an ephemeral port from the system. The networking guide lists all SIDER_* limits and deadlines, their defaults, and the readiness file contract.

To try another configuration in PowerShell:

$env:SIDER_ADDR = '127.0.0.1:6380'
$env:SIDER_SECURITY_PROFILE = 'legacy-loopback'
try {
    cargo run --locked
} finally {
    Remove-Item Env:SIDER_ADDR
    Remove-Item Env:SIDER_SECURITY_PROFILE
}

In a POSIX shell:

SIDER_SECURITY_PROFILE=legacy-loopback SIDER_ADDR=127.0.0.1:6380 cargo run --locked

Checking changes

During implementation, run the affected test. Before integrating, use the local command that combines formatting, Clippy, the binary build, and native tests:

cargo test --locked <filter>
cargo xtask check

Extend validation according to the change: documentation and distribution builds when their interfaces or configuration are affected. Do not repeat cargo check after Clippy, which already checks the targets. Preserve the Cargo cache between runs. The contribution guide lists the commands. There is no need to wait for CI to integrate a PR. Record local tests in the PR.

Tests cover the foundation, codec, commands, worker, TCP, and actual binary. Redis fixtures are replayed over TCP and by the server differential suite. The testing guide explains local commands; the differential guide covers Redis/CLI and gate receipts. All new tests use Rust and external tests are opt-in. Before each release, cumulative gates remain mandatory, with manual execution and evidence on the required platforms.

Structure

Path Responsibility
src/lib.rs Library interface
src/main.rs Binary entry point, runtime, logging, and shutdown signals
src/config.rs Validated address, limits, and deadlines
src/resp/ Frames, limits, atomic encoder, and incremental decoder
src/command/ and src/storage/ Parser, typed replies, and synchronously owned map
src/storage/worker.rs Bounded queue, acceptance, and execution by the owner
src/persistence/ and src/storage/snapshot.rs AOF format, writer, replay, and global snapshots
src/bin/sider-aof-migrate.rs Explicit offline migration into a new directory
src/replication/ and src/bin/sider-replica.rs Snapshots, history, resumption, and replica administration
src/persistence/backup/ and src/bin/sider-backup.rs Export, manifest, verification, and restoration
src/server.rs and src/connection.rs TCP, ordering, timeouts, and supervision
src/readiness.rs Atomic readiness file publication
src/error.rs Typed configuration errors
tests/cli.rs Binary integration tests
tests/reference.rs and tests/common/ Binary fixtures and disposable Redis reference
tests/resp_codec.rs Literal fixtures, fragmentation, and codec property tests
tests/commands.rs Five-command semantics and rejection without mutation
tests/tcp.rs TCP fixtures, pipelines, fragmentation, and connection lifecycle
tests/compatibility.rs Independent Sider/Redis comparison and redis-cli integration
tests/gate_contract.rs and tests/harness.rs Evidence, isolation, and test infrastructure failures
dev/test.Dockerfile Local Ubuntu test environment, distinct from the distribution image
Cargo.toml and Cargo.lock Rust package and pinned dependencies
rust-toolchain.toml Toolchain and development components
xtask/ and .cargo/config.toml Local Rust tools, isolated from database dependencies
AGENTS.md Local instructions for coding agents
PLAN.md Historical record of the initial 0.1 design and stages
ROADMAP.md Release sequence and dependencies through 1.1.0
releases/plan.json Versioned source for milestones, tasks, and criteria
docs/releases.md Backlog execution, candidates, publication, and recovery
docs/architecture.md Current boundaries and planned architecture
docs/compatibility.md Compatibility scope and status
docs/compatibility-matrix.md Supported forms, restrictions, and evidence by capability
docs/testing.md Local tests and Redis reference reproduction
docs/resp.md RESP2 codec contracts, limits, and usage
docs/resp3.md Experimental RESP3 subset and validation scope
docs/network.md TCP configuration, acceptance, timeouts, and shutdown
docs/pubsub.md Binary channels, subscriber mode, bounded queues, and Pub/Sub differential tests
docs/agent-development.md Issue routing and autonomous development workflow
docs/next-development.md Operational and AI-memory development fronts
docs/deployment-profile.md Supported deployment boundary and preflight
docs/client-integration.md Client handshake audit and supported paths
docs/recovery-drill.md Backup and AOF recovery evidence
docs/resource-envelope.md Resource workload and measurement contract
docs/redis-benchmarks.md Comparative benchmark method and limits
docs/security-boundary.md Network exposure and authentication contract
docs/agent-memory-v1.md AI memory contract and the separate durable profile
examples/agent-memory/README.md Deterministic external embedding fixture and memory lifecycle example
docs/lua-scripting.md Scripting contract and isolated containment spike
docs/cross-shard-transactions.md Mixed-owner transaction contract and remaining validation
docs/durable-format-registry.md Proposed AOF, replication, and backup format composition
CONTRIBUTING.md Workflow and review criteria

Next step

Strings, TTL, collections, transactions, Pub/Sub, AOF, shards, replication, backup, and administration are integrated. The 1.1.0 candidate must validate the newer memory, RESP3, security, and mixed-owner transaction capabilities alongside the existing base. That includes the compatibility audit, soak testing, and benchmarks against one frozen SHA. Development results remain tied to their SHAs; the presence of runners does not mean gates passed.

The v1.1.0 preparation notes describe the next candidate. Its exact merge SHA must produce one Linux amd64 image, published manually to GHCR and validated by digest before a final tag can point to that same image. Open security and composed-transaction work and every required gate still block publication. No new native Windows or Linux release packages are planned. The 0.1 plan preserves the historical design; the ROADMAP and issues record criteria and current progress.

The database, tests, and project tools use Rust. The project has no Python scripts or CI workflows. When changing the tools or manifest, use:

cargo xtask check --tools
cargo xtask roadmap --write
cargo xtask sync

sync simulates; only sync --apply writes to GitHub through the authenticated gh CLI. The release guide separates the fast development cycle from publication tests. Publishing 1.0 requires a candidate and evidence for every capability. Pending gates block publication, even when bootstrap tests pass.

License

Sider's own code uses the MIT license, with the standard text from the Open Source Initiative. Dependencies retain their own licenses.

Distributed packages include the LICENSE file. The repository and release artifacts are public, while publication to crates.io remains disabled.

About

In-memory database server in Rust with an incremental Redis-compatible core

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages