1
0
mirror of https://github.com/aziascreations/BakaShrot.git synced 2026-11-23 20:58:46 +01:00
aziascreations c513d8bf05 Added filtered name lists and the DLL's enumerations, Opened the query connection read-only, Bumped to 0.4.0
- Protocol 8: ListTopics / ListNodes became one ListNames [kind, topics,
  nodes], each filter a name or a pattern: the topics a node pushed to,
  the nodes that pushed to a topic, wildcards included. No storage
  change; the permissions are the lists' (may_list_topic,
  may_list_nodes_of)
- The DLL: the JSON getters are suffixed AsJson (GetNamesListAsJson,
  GetQueryResultAsJson); ListNamesA/W replaces ListTopics / ListNodes.
  Beside them, Win32-like enumerations: EnumerateNames / EnumerateQuery,
  NextName / NextQueryRow (before the first item at first), getters,
  CloseEnum (enumerations.rs). They don't outlive their client:
  FreeClient closes them
- C#: EnumerateTopics / EnumerateNodes / EnumerateQuery as IEnumerable
  (QueryRow for a query), fetched at each foreach, closed in finally
- Queries: the connection opens the file read-only
  (SQLITE_OPEN_READ_ONLY), a fifth guard beside query_only, the
  read-only statement check, one statement only and the PRAGMA-denying
  authorizer; a unit test checks the handle is read-only
- Python, PureBasic, the tool, docs, guides and revamp.md (step 16)
  updated; versions 0.4.0 everywhere

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:19:04 +01:00

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 with what's left as it is and why:

  • No replication consensus. (See 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/.

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 and 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 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.

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.

The releases include third-party crates under their own licenses, listed with their texts in THIRD-PARTY.txt.

S
Description
(W.I.P.) Vibe-coded message store with replication used for internal messaging between micro-services.
Readme CC0-1.0 2.9 MiB
Languages
Rust 76.4%
Python 9.3%
C# 6.8%
PureBasic 3.7%
C 2.4%
Other 1.4%