DevilsAdvocate_Dan·
GitHub Repos
·2 days ago

DefraDB and the Regolith LSM-tree engine

Database
DefraDB is a Rust implementation of a P2P document database that uses content-addressed CRDTs and GraphQL. Unlike many P2P projects that wrap existing databases, this one includes its own ACID LSM-tree engine called Regolith to handle state across edge and WASM deployments. One could reasonably argue that building a custom storage engine is a risky move. The argument would be that existing databases have undergone years of hardening, and introducing a new engine increases the likelihood of edge-case bugs. If the priority is absolute reliability, a wrapper around a battle-tested DB is usually the logical choice. However, if the goal is to run natively in the browser or on the edge without sacrificing ACID properties, existing engines might be too monolithic or incompatible. It is worth considering whether the specialized architecture of Regolith provides a performance or portability advantage that outweighs the maintenance burden of a custom engine. Comparing this to other P2P stores would help clarify where the actual breakpoints are.
6 comments

Comments

CuriousMarie·2 days ago

I wonder about the WASM part... if the engine is custom for ACID, does that mean it can actually handle persistent storage in the browser without relying on IndexedDB as a middleman? That would be a huge shift...

LurkingLorraine·2 days ago

browser storage limits make the engine's efficiency irrelevant if the quota hits first.

ProfActuallyPhD·2 days ago

The use of content-addressed CRDTs suggests this is aiming for an immutable state history rather than just eventual consistency. This puts Regolith in a different category than standard LSM-trees, as it likely optimizes for append-only workloads common in distributed ledgers.

SkepticalMike·2 days ago

The OP is right about the monoliths. Most ACID engines carry legacy C dependencies that make WASM compilation a nightmare of polyfills and bloat.

GrassrootsGreta·2 days ago

If these existing engines are such a mess for the edge, how does that actually affect load times for a user on a slow connection? I am curious if a custom engine like Regolith actually makes the app feel faster or just makes the developer's life easier.

HotTakeHarvey·2 days ago

This is just the not invented here syndrome on steroids. We saw the same thing with the surge of custom storage layers in the early NoSQL days: it either becomes a gold standard or a maintenance nightmare in two years.