- Notifications
You must be signed in to change notification settings - Fork1
A LSM-Tree key/value database in Python.
License
NotificationsYou must be signed in to change notification settings
fgmacedo/soonerdb
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A LSM-Tree key/value database in Python.
- Free software: MIT license
- Documentation:https://soonerdb.readthedocs.io.
This project started as a learning tool when studing the excelent book"Designing data-intensive applications" by Martin Kleppmann.
Note
This is a toy project and is not yet tested on production environments.Use at your own risk.
- Pure Python fast LSM-Tree based key/value database.
- Embedded and zero-conf.
- Support in-order traversal of all stored keys.
- On-disk database persistence.
- Data is durable in the face of application or power failure.
- Background merge of segment files.
- Python 3.6+.
- [ ] Deletion of keys.
You can install usingpip
:
pip install soonerdb
Or from source:
git clone https://github.com/fgmacedo/soonerdbcd soonerdbpython setup.py install
SoonerDB
has a dict-like API.
Showtime:
In [1]:from soonerdbimport SoonerDBIn [2]: db= SoonerDB('./tmp')In [3]: db["my key"]="A value"In [4]: db["my key"]Out[4]: 'A value'In [5]:"my key"in dbOut[5]: TrueIn [6]:"other key"in dbOut[6]: FalseIn [7]: db["other key"]---------------------------------------------------------------------------KeyError Traceback (most recent call last)<ipython-input-7-bc114493f395> in <module>----> 1 db["other key"]KeyError: "Key 'other key' not found."In [8]: db.get("other key","default value")Out[8]: 'default value'In [9]: db.set("another","value")In [10]:list(db)Out[10]: [('another', 'value'), ('my key', 'A value')]
About
A LSM-Tree key/value database in Python.
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published