Skip to content

Add RocksDB.Lite: Simple document DB on top of RocksDB KV-store - #75

Open
theolivenbaum wants to merge 3 commits into
masterfrom
claude/rocksdb-lite-project-88ai0
Open

Add RocksDB.Lite: Simple document DB on top of RocksDB KV-store#75
theolivenbaum wants to merge 3 commits into
masterfrom
claude/rocksdb-lite-project-88ai0

Conversation

@theolivenbaum

Copy link
Copy Markdown
Contributor

Introduces a small embedded document database layer on top of RocksDB.
Each collection and each index lives in its own column family so sorted
iteration uses the native iterator without keyspace filtering. Scalar
ids and index values are encoded order-preservingly (sign-flipped
big-endian for numerics, NUL-terminated UTF-8 for strings, etc.) which
makes index keys a plain concat of [encoded(value), encoded(id)] and
keeps RocksDB's default comparator matching natural order.

Adds matching MSTest project (Tests/LiteTest) and a CLAUDE.md in lite/
documenting the storage model, key encoding and intentional non-goals.

claude added 3 commits May 23, 2026 07:17
Introduces a small embedded document database layer on top of RocksDB.
Each collection and each index lives in its own column family so sorted
iteration uses the native iterator without keyspace filtering. Scalar
ids and index values are encoded order-preservingly (sign-flipped
big-endian for numerics, NUL-terminated UTF-8 for strings, etc.) which
makes index keys a plain concat of [encoded(value), encoded(id)] and
keeps RocksDB's default comparator matching natural order.

Adds matching MSTest project (Tests/LiteTest) and a CLAUDE.md in lite/
documenting the storage model, key encoding and intentional non-goals.
Adds four new test files (55 new tests, 77 total):

- LiteKeyTests: direct property tests on the order-preserving key encoder,
  covering negative numbers, doubles (incl. infinities), string lexicographic
  order, DateTime chronology, tag ordering across types, prefix-distinctness
  for strings, NUL rejection, and the unsupported-type fallback.

- LiteIndexTests: more index scenarios — string range scans, DateTime
  ranges, double ordering with negatives/zero, Guid exact lookups, multiple
  indexes on one collection, null selector values being skipped, inclusive
  bounds, duplicate-value iteration order, EnsureIndex idempotency, and
  drop/recreate.

- LiteCollectionEdgeTests: string ids, int auto-increment surviving reopen,
  nested object round-trip, empty-collection no-ops, GetCollection identity,
  invalid name validation, 1000-doc bulk test, DeleteAll keeping the
  counter, DropCollection resetting it, large-document round-trip, and
  cross-collection id independence.

- LiteLifecycleTests: directory creation, read-only mode (read/reject
  create/reject drop), idempotent Dispose, persistence across open/close,
  custom serializer hook, ConfigureColumnFamily invocation (built via
  reflection to keep the test project free of a direct RocksDbSharp
  reference — its PackageId would otherwise shadow the runtime NuGet),
  CreateIfMissing=false failing on missing, and reopen-after-drop semantics.
Replaces ProjectReference to csharp/RocksDbSharp.csproj with a
PackageReference to the RocksDB NuGet package in both the lite project
and its test project, per the convention for new projects in this repo.

This also lets the two tests that needed RocksDbSharp.ColumnFamilyOptions
and RocksDbException drop their Expression/reflection workarounds — those
types are now visible through the transitive package reference.
@theolivenbaum theolivenbaum changed the title Add RocksDB.Lite: LiteDB-style document API on RocksDB Add RocksDB.Lite: Simple document DB on top of RocksDB KV-store May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants