Skip to content

Inmemory storage implementation#82

Open
SK1PPR wants to merge 4 commits into
refactorfrom
inmemory-storage
Open

Inmemory storage implementation#82
SK1PPR wants to merge 4 commits into
refactorfrom
inmemory-storage

Conversation

@SK1PPR

@SK1PPR SK1PPR commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implements MemoryStorage for the StorageEngine trait using a lock-protected BTreeMap
  • Adds in-memory checkpoint save/restore support
  • Wires StorageType::InMemory through API initialization and snapshot restore
  • Adds storage, API, and HTTP smoke coverage for in-memory behavior

Closes #36.

Testing

  • cargo fmt
  • cargo test -p storage
  • cargo test -p api
  • cargo test -p http
  • cargo test -p grpc
  • cargo test
  • docker build -t vortexdb:inmemory-smoke .
  • Dockerized HTTP smoke test with STORAGE_TYPE=inmemory:
    • GET /health
    • POST /points
    • GET /points/{id}
    • POST /points/search
    • DELETE /points/{id}
    • GET /points/{id} returns 404 after delete

@SK1PPR SK1PPR requested a review from Arshdeep54 June 7, 2026 04:56
.points
.read()
.map_err(|_| StorageError::InMemoryLock {})?;
serialize_into(file, &*points).map_err(|source| StorageError::Serialization {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add header in checkpoint files, magic, version or maybe count.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use bufwriter here and bufreader while restoring from file

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.

Implement In Memory Storage

2 participants