AshCubDB - A CubDB data layer for Ash resources

I’m happy to announce the first (useful) release of AshCubDB an Ash data layer which allows you to back your Ash resources with CubDB.


From the CubDB documentation:

CubDB is an embedded key-value database for the Elixir language. It is designed for robustness, and for minimal need of resources.

CubDB is an impressive piece of engineering which is widely used by folks working on Nerves projects. I only learned about it earlier this year, but I’ve been itching to play with it since.

It supports ACID transactions, concurrent reads and writes and is generally resistant to data corruption during unexpected shutdowns or crashes.


AshCubDB does not support, nor is it currently aiming to support all the many many features of other Ash data layers. It does support the basic CRUD operations and filtering. You can use it today.

There are a few things that I haven’t nailed down:

  1. How to handle “migrations” when the attributes of a resource change and thus the existing records are now invalid?
  2. How to handle transactions. CubDB essentially switches to a unit-of-work style structure when in a transaction, with a different API (CubDB.Tx).
  3. Should we dynamically start the CubDB processes when we need them (the current solution) or require that apps start them in their own supervision tree?



Idiomatic for 3 is let people start it by adding to application.ex imo

Edit: its also what ash auth does

1 Like

CubDB author, just here to say that this is awesome!

I am also happy to get feedback on CubDB from Ash users.


Thanks for your awesome software. I’m so excited to see what the Ash community builds with it.


Just learned about CubDB, now I have to play with it and the new ash integration :slight_smile: . Also, the FAQ was very enlightening and did cover my actual questions about CubDB.