| 1 |
BorgStore |
| 2 |
========= |
| 3 |
|
| 4 |
borgstore implements a general purpose key/value store in Python. |
| 5 |
|
| 6 |
Overview |
| 7 |
-------- |
| 8 |
|
| 9 |
Keys are simple strings like `config/main` or `data/0123456789abcdef` `[str]` |
| 10 |
(config and data are namespaces here). Values are binary objects `[bytes]` - |
| 11 |
when storing, a `memoryview` is accepted as well, so callers can avoid copying. |
| 12 |
|
| 13 |
The `Store` class is the high-level API, so you can comfortably work with the |
| 14 |
kv store without caring for low-level details. |
| 15 |
|
| 16 |
The `backends` package has misc. storage backend implementations. |
| 17 |
|
| 18 |
The `server` package has a REST server implementation, complementing the REST |
| 19 |
client functionality in the `rest` backend. To actually store stuff, the REST server |
| 20 |
can use any backend internally, e.g. the `posixfs` backend. |
| 21 |
|
| 22 |
Store features |
| 23 |
-------------- |
| 24 |
|
| 25 |
- supports URLs, like `file:///srv/borgstore` or `https://myserver/path` |
| 26 |
- easy to use, high-level `Store` API: create/destroy, open/close, list, |
| 27 |
load/store, delete, move, soft delete/undelete, hash, defrag, ... |
| 28 |
- uses a backend to implement the storage |
| 29 |
- optionally uses an additional caching backend, with a configurable cache |
| 30 |
policy per namespace |
| 31 |
- name nesting / unnesting, recursive directory listing |
| 32 |
- statistics collection |
| 33 |
- latency/bandwidth emulator |
| 34 |
|
| 35 |
Backend features |
| 36 |
---------------- |
| 37 |
|
| 38 |
- existing backends for local filesystem, sftp, REST, S3 / B2 (native) and |
| 39 |
many other cloud storage protocols via rclone |
| 40 |
- new backends are simple to implement |
| 41 |
- key validation |
| 42 |
- partial loads / range requests |
| 43 |
- stored object hashing (hashlib algorithms, e.g. sha256, and optionally blake3) |
| 44 |
- stored object defragmentation |
| 45 |
- quota support (only `posixfs`) |
| 46 |
- permissions checking (only `posixfs`) |
| 47 |
|
| 48 |
REST server features |
| 49 |
-------------------- |
| 50 |
|
| 51 |
- server-side permissions/quota enforcement |
| 52 |
- server-side hashsum check of transferred objects before storing |
| 53 |
- network traffic optimization by doing stuff server-side: |
| 54 |
|
| 55 |
- stored object hashing |
| 56 |
- stored object defragmentation |
| 57 |
- the REST server can internally use any backend for storage, e.g. `posixfs` |
| 58 |
- for the REST server, we provide CI tested configs for: |
| 59 |
|
| 60 |
- an nginx-based reverse proxy |
| 61 |
- systemd-based on-demand `borgstore.server` process creation |
| 62 |
|
| 63 |
State of this project |
| 64 |
--------------------- |
| 65 |
|
| 66 |
**API is still unstable and expected to change as development goes on.** |
| 67 |
|
| 68 |
**As long as the API is unstable, there will be no data migration tools, |
| 69 |
such as tools for upgrading an existing store's data to a new release.** |
| 70 |
|
| 71 |
There are tests, and they pass for the basic functionality, so some functionality is already working well. |
| 72 |
|
| 73 |
There might be missing features or optimization potential. Feedback is welcome! |
| 74 |
|
| 75 |
Many possible backends are still missing. If you want to create and support one, pull requests are welcome. |
| 76 |
|
| 77 |
Borg? |
| 78 |
----- |
| 79 |
|
| 80 |
Please note that this code is currently **not** used by the stable release of |
| 81 |
BorgBackup (also known as "borg"), but only by Borg 2 beta 10+ and the master branch. |