What is BinaryDB?
BinaryDB is a lightweight, embeddable key-value database that stores data in memory with persistent serialization to disk. It’s designed for small to medium datasets where simplicity, reliability, and ease of integration matter more than maximum performance.BinaryDB is currently in active development. Some advanced features like write-ahead logging (WAL), indexing, and advanced concurrency controls are planned but not yet implemented.
Why BinaryDB?
BinaryDB fills the gap between simple file-based storage and full-featured database systems. It’s perfect for:- Embedded applications that need persistent storage without external dependencies
- Prototyping and development where you need a simple data store quickly
- Small to medium datasets where in-memory storage is feasible
- Python projects that want to avoid complex database setups
Key Features
In-Memory Storage
All data is kept in memory for fast access, with atomic persistence to disk when you commit changes.
Simple API
Intuitive methods like
set(), get(), delete(), and update() make it easy to work with your data.Transaction Support
Basic transaction control with
begin(), rollback(), and end() to safely manage changes.Atomic Persistence
Changes are written to disk atomically using file replacement to prevent corruption.
Core Capabilities
Persistent Key-Value Storage
BinaryDB provides a dictionary-like interface where you store any Python object against a string key:Atomic Commits
Changes are only persisted to disk when you explicitly callcommit(). This ensures data integrity:
Transaction Control
Wrap multiple operations in a transaction to ensure they succeed or fail together:Architecture
BinaryDB uses Python’spickle module for serialization and pathlib for file operations. It requires only the Python standard library—no external dependencies.
Security Warning
Design Goals
BinaryDB prioritizes:- Simplicity - Easy to understand, easy to integrate
- Reliability - Atomic operations prevent data corruption
- Embeddability - No external dependencies or server processes
- Correctness - Clear error handling and validation
What BinaryDB Is Not
BinaryDB is not suitable for:- Large datasets that don’t fit in memory
- High-concurrency multi-process scenarios
- Distributed systems requiring replication
- Production systems requiring advanced query capabilities
- Situations where you need SQL or complex queries
Project Status
BinaryDB is an active development project created by Raúl Novo. The core database functionality is implemented and stable, but several advanced features are planned:- ✅ Core CRUD operations
- ✅ Atomic persistence
- ✅ Basic transactions
- ✅ Error handling
- 🚧 Write-ahead logging (WAL)
- 🚧 Indexing support
- 🚧 Advanced locking mechanisms
- 🚧 Caching layer
License
BinaryDB is licensed under the GNU General Public License v3 (GPL-3.0). You can freely use, modify, and redistribute the code, but any redistributed versions must also be under GPL v3 and credit the original author.Next Steps
Installation
Learn how to get BinaryDB and add it to your project
Quick Start
Build your first BinaryDB application in minutes
