Skip to content

Conversation

@beryll1um
Copy link
Contributor

@beryll1um beryll1um commented Nov 24, 2025

  • Use std::optional for Get methods instead of empty strings when NotFound
  • Add RAII wrappers for RocksDB snapshots, iterators and write batches
    (rocks::Snapshot, rocks::Iterator, rocks::WriteBatch)
  • Ensure graceful DB shutdown: sync WAL and wait for compaction/close on the
    dedicated Rocks task processor
  • Link RocksDB privately from the rocks module (LINK_LIBRARIES_PRIVATE)

BREAKING CHANGES:

  • storages::rocks::Client and storages::rocks::Component are removed
  • Component is now components::Rocks with GetDb()
  • Exception and RequestFailedException are removed in favor of StatusNokException
  • Config keys changed: db-path/task-processor -> db_path/max_background_jobs

@beryll1um
Copy link
Contributor Author

beryll1um commented Nov 24, 2025

TODO:

  • Better documentation
    (clarify architecture, object lifetimes, and RocksDB-specific caveats)
  • Consider what configuration needs to be provided first
    (there is literally hundreds of different options across of interfaces in RocksDB)
  • Tests for Snapshot, Iterator, and WriteBatch
    (cover consistency, iterator boundaries, and batch atomicity)
  • Complete standard bidirectional iterator interface for Iterator class
    (account for limitations of RocksDB’s Next/Prev and seeking behavior)
  • Improve finalization behavior
    (WAL sync and compaction may take significant time depending on write load and DB size)
  • Sample for demonstration purposes
    (simple end-to-end example using snapshots, iteration, and batched writes)

...

@beryll1um beryll1um force-pushed the feature/rocksdb-rework branch 2 times, most recently from 9ed0736 to 1e94e27 Compare November 25, 2025 05:21
@beryll1um beryll1um marked this pull request as draft November 25, 2025 05:25
@beryll1um
Copy link
Contributor Author

I've started implementing a more or less viable iterator instead of directly binding RocksDB methods. It's still rough, and some parts (like the bool type cast) are just for testing, but the basic outlines are already in place.

I think it's better to make this pull a draft for now.

@beryll1um beryll1um force-pushed the feature/rocksdb-rework branch from 1e94e27 to f58b942 Compare November 26, 2025 02:16
@beryll1um
Copy link
Contributor Author

It looks like the Iterator is ready and needs to be reviewed. Unfortunately, implementing copying and postfix incrementing is impossible, as this would require copying, which is a rather complex operation in RocksDB (at least I didn't found a viable solution).

@beryll1um beryll1um force-pushed the feature/rocksdb-rework branch 5 times, most recently from f3d9d33 to cfce6f7 Compare December 4, 2025 03:35
@beryll1um beryll1um force-pushed the feature/rocksdb-rework branch 5 times, most recently from 916cbbf to 8f4b5f7 Compare December 9, 2025 09:44
- Use std::optional for Get methods instead of empty strings when NotFound
- Add RAII wrappers for RocksDB snapshots, iterators and write batches
  (rocks::Snapshot, rocks::Iterator, rocks::WriteBatch)
- Ensure graceful DB shutdown: sync WAL and wait for compaction/close on the
  dedicated Rocks task processor
- Link RocksDB privately from the rocks module (LINK_LIBRARIES_PRIVATE)

BREAKING CHANGES:
- storages::rocks::Client and storages::rocks::Component are removed
- Component is now components::Rocks with GetDb()
- Exception and RequestFailedException are removed in favor of StatusNokException
- Config keys changed: db-path/task-processor -> db_path/max_background_jobs
@beryll1um beryll1um force-pushed the feature/rocksdb-rework branch from 8f4b5f7 to 5dbb13b Compare December 9, 2025 10:13
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.

1 participant