How manosriram/nimbusdb works
nimbusdb is an embedded, persistent Bitcask-style key-value store. The main workflow is callers opening a database, then reading, writing, expiring, or deleting keys backed by append-oriented data files and an in-memory key directory. Separate capabilities include batch operations, prefix iteration, change watching, and merge compaction. The excerpts show key-directory, segment, cache, batch, and watch interactions; some storage and lifecycle details are documented only at a high level, so those links cite the README.
Main entry points: db.go Database Operations · reader.go Prefix Readers · segment.go Segment Index · wal.go Entry Encoding
Components 13
Database API
- Database Operations
db.go - Options and Types
types.go
Lookup and Cache
- Key Directory
btree.go - Block Cache
db.go - Segment Index
segment.go
Persistent Storage
- Entry Encoding
wal.go - Data Files
db.go - Merge Compaction
db.go - File Utilities
utils/file.go
Database Features
- Batch Operations
batch.go - Prefix Readers
reader.go - Change Watcher
watch.go
Other components
- Application
Connections 18
- Application → Database Operations: opens and operates
README.md - Application → Batch Operations: starts batch
README.md - Application → Prefix Readers: iterates keys
reader.go - Application → Change Watcher: subscribes
README.md - Database Operations → Options and Types: configures
db.go - Database Operations → Key Directory: looks up keys
db.go - Database Operations → Block Cache: caches blocks
db.go - Database Operations → Segment Index: locates blocks
db.go - Database Operations → Data Files: reads and appends
README.md - Database Operations → Entry Encoding: encodes entries
wal.go - Database Operations → Merge Compaction: runs compaction
README.md - Database Operations → Change Watcher: sends events
db.go - Batch Operations → Database Operations: commits through
batch.go - Prefix Readers → Key Directory: iterates index
reader.go - Prefix Readers → Database Operations: loads values
reader.go - Segment Index → Data Files: tracks file blocks
segment.go - Entry Encoding → File Utilities: encodes fields
wal.go - Merge Compaction → Data Files: rewrites live entries
README.md