Skip to main content

borgstore implements a general purpose key/value store in Python.

Overview

Keys are simple strings like config/main or data/0123456789abcdef [str] (config and data are namespaces here). Values are binary objects [bytes] - when storing, a memoryview is accepted as well, so callers can avoid copying.

The Store class is the high-level API, so you can comfortably work with the kv store without caring for low-level details.

The backends package has misc. storage backend implementations.

The server package has a REST server implementation, complementing the REST client functionality in the rest backend. To actually store stuff, the REST server can use any backend internally, e.g. the posixfs backend.

Store features

  • supports URLs, like file:///srv/borgstore or https://myserver/path

  • easy to use, high-level Store API: create/destroy, open/close, list, load/store, delete, move, soft delete/undelete, hash, defrag, …

  • uses a backend to implement the storage

  • optionally uses an additional caching backend, with a configurable cache policy per namespace

  • name nesting / unnesting, recursive directory listing

  • statistics collection

  • latency/bandwidth emulator

Backend features

  • existing backends for local filesystem, sftp, REST, S3 / B2 (native) and many other cloud storage protocols via rclone

  • new backends are simple to implement

  • key validation

  • partial loads / range requests

  • stored object hashing (hashlib algorithms, e.g. sha256, and optionally blake3)

  • stored object defragmentation

  • quota support (only posixfs)

  • permissions checking (only posixfs)

REST server features

  • server-side permissions/quota enforcement

  • server-side hashsum check of transferred objects before storing

  • network traffic optimization by doing stuff server-side:

    • stored object hashing

    • stored object defragmentation

  • the REST server can internally use any backend for storage, e.g. posixfs

  • for the REST server, we provide CI tested configs for:

    • an nginx-based reverse proxy

    • systemd-based on-demand borgstore.server process creation

State of this project

API is still unstable and expected to change as development goes on.

As long as the API is unstable, there will be no data migration tools, such as tools for upgrading an existing store’s data to a new release.

There are tests, and they pass for the basic functionality, so some functionality is already working well.

There might be missing features or optimization potential. Feedback is welcome!

Many possible backends are still missing. If you want to create and support one, pull requests are welcome.

Borg?

Please note that this code is currently not used by the stable release of BorgBackup (also known as “borg”), but only by Borg 2 beta 10+ and the master branch.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

borgstore-0.6.0.tar.gz (69.5 kB view details)

Uploaded Source

File details

Details for the file borgstore-0.6.0.tar.gz.

File metadata

  • Download URL: borgstore-0.6.0.tar.gz
  • Upload date:
  • Size: 69.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for borgstore-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f3887e0a25f0b2a0e585ca23a524f241a537f23a8c583fce83e91dec0ffb635b
MD5 5084cc16cc75e5311582b457783dccc0
BLAKE2b-256 2575ab6ee33fb83d359ec20f5f4a8518826acb0d9fb5a0bf6cbfa94b3d5f32a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page