mirror of
https://github.com/aziascreations/BakaShrot.git
synced 2026-11-23 20:58:46 +01:00
1a1603f3f3
- bindings/csharp/NibblePoker.BakaShrot.Client: P/Invoke over the DLL's UTF-16 exports, one Client per handle (namespace NibblePoker.BakaShrot). C# 2 and the .NET 2.0 BCL only: net35 (.NET Framework 2.0 and up) and netstandard2.0 (.NET Core 2.0 and up, .NET 5 and up) - No JSON or TOML parsing: ListTopics, ListNodes and Query return the raw JSON string for the caller to parse; settings go to the constructor - The package: the four native libraries under runtimes/<rid>/native/, their THIRD-PARTY.txt under licenses/<rid>/, and a build/net35 .targets copying the right one next to .NET Framework apps (which ignore runtimes/) - CI: a nuget job after the four release builds packs it with the release's version and libraries, checks the listing and keeps it as the bakashrot-nuget artifact - Tests: an NUnit project (net48 and net8.0) against a real server with certificates from `bakashrot cert`, 13 tests - release.py ships BakaShrot.cs in csharp/; docs/client.md, building.md, readme.md, revamp.md (step 14) updated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
75 lines
3.8 KiB
Markdown
75 lines
3.8 KiB
Markdown
# BakaShrot
|
|
A vibe-coded and opinionated message store built on SQLite, with replication between servers.
|
|
|
|
BakaShort allows applications and scripts to push/read data and files and let them replicate over an entire mesh regardless of whether the links are up or reliable. \
|
|
It also allows to sleep easy knowing each client is strongly authenticated by using certificates over public networks.
|
|
|
|
|
|
## Features
|
|
|
|
* Cert-based authentication with TLS 1.3 connections
|
|
* Easy tools provided to manage it and CRL-based revocations.
|
|
* Role-based scoping of push and reads baked into certificates.
|
|
* Directional replication between servers, either complete or by topic and node names.
|
|
* File replication, one per message, up to 1 GiB by default with resumable replication.
|
|
* Per-topic and per-server retention of messages and files.
|
|
* Edge can be configured to minutes while internal can hold years independently.
|
|
* Read-only SQL queries on stored JSON messages.
|
|
* Every push flushed to disk before it's answered, or about twice the pushes with `synchronous = "normal"`
|
|
* Supports Windows and Linux, both on x64 and ARM64.
|
|
* Clients:
|
|
* A C library (`bakashrot.dll`, `libbakashrot.so`), with a C header and PureBasic prototypes
|
|
* A CLI tool to push, read, query and list
|
|
* A Python module over the library, without dependencies, as a wheel with the library in it
|
|
* A C# client over the library, one file without dependencies, for .NET Framework 2.0 and 3.x up to the latest .NET
|
|
|
|
|
|
## Limitations
|
|
The main ones, all in [docs/known-issues.md](docs/known-issues.md) with what's left as it is and why:
|
|
|
|
* No replication consensus. *(See [Why not something else](#why-not-something-else))*
|
|
* Peers are trusted with what they replicate, and clients only scope restrictions based on their role.
|
|
* Only 1,048,575 topic and node pairs can exist per database.
|
|
* Clients poll for new messages themselves.
|
|
|
|
|
|
## Quick Start
|
|
All instructions to setup a BakaShrot network can be found in [guides/](guides/).
|
|
|
|
It should take you 5-10 minutes if you test without docker, and maybe 10-15 minutes if you use a dockerized server.
|
|
|
|
|
|
## Why not something else
|
|
|
|
### Replicated SQL/SQLite DB
|
|
Projects like [rqlite](https://github.com/rqlite/rqlite) and [dqlite](https://github.com/canonical/dqlite) could have been perfect for what BakaShrot tries to accomplish. \
|
|
They require a leader, a constant S2S connection, and do not support split networks by design.
|
|
|
|
In contrast, BakaShrot moves trust off the server mesh itself and assumes you properly set up each node with a unique name and cert to prevent conflicts.
|
|
|
|
This prevents you from properly load-balancing, letting untrusted users push messages, and whatnot. \
|
|
But you gain the ability to host a message-server network over unreliable links without losing a single bit of data.
|
|
|
|
### MQTT Brokers
|
|
[Mosquitto](https://mosquitto.org) and other MQTT brokers handle the topic-based messaging in a near-perfect way, but they only deliver messages to whoever is subscribed at that moment, and have limited archival options. \
|
|
BakaShrot keeps every message, and allows you to re-read them days or years later.
|
|
<!-- And compared to mosquitto, you won't want to jump off a bridge while setting it up. -->
|
|
|
|
### Other message stores
|
|
Projects like **Kafka, NATS JetStream** are a good alternative to BakaShrot if you have the infrastructure and resources to host them.
|
|
|
|
However, I don't have heaps of RAM to piss away on running a JVM or other stuff. \
|
|
And BakaShrot, while simpler in all other aspect, takes less than 50 MB to run and can share any 1-2$ VPS with other applications very easily.
|
|
|
|
|
|
## Cloning
|
|
```
|
|
git clone https://github.com/aziascreations/BakaShrot.git
|
|
```
|
|
|
|
|
|
## License
|
|
All the code in this repo is released in the [Public Domain](LICENSE).
|
|
|
|
The releases include third-party crates under their own licenses, listed with their texts in `THIRD-PARTY.txt`.
|