Persistent Storage¶
Persistent mode stores data durably on disk.
Creating a Persistent Database¶
File Structure¶
my_graph.db/
├── data/ # Main data files
├── wal/ # Write-ahead log
└── metadata # Database metadata
Durability Guarantees¶
- Write-Ahead Logging (WAL) - All changes logged before applying
- Checkpointing - Periodic consolidation of WAL into data files
- Crash Recovery - Automatic recovery from WAL on startup
Configuration¶
db = grafeo.GrafeoDB(
path="my_graph.db",
# Sync mode: 'full' (default), 'normal', 'off'
sync_mode='full'
)
| Sync Mode | Durability | Performance |
|---|---|---|
full | Highest | Slower |
normal | Good | Faster |
off | None | Fastest |