CubDB, a pure-Elixir embedded key-value database

Thanks very much for making CubDB available, @lucaong. I’ve just added it to a new Phoenix project that will read and locally store data from an external CMS, and am looking forward to getting it into production over the next few weeks.

In case it helps anyone else get started slightly quicker, I found that @Qqwy’s example of how to have CubDB started as part of the supervision tree with just MyApp.DB wasn’t working (I assume CubDB’s start_link function has since changed), and that changing it to the following worked:

defmodule MyApp.DB do
  def child_spec(_) do
    %{
      id: __MODULE__,
      start: {CubDB, :start_link, [
        Application.get_env(:my_app, :my_db_location, "data/my_db"),
        [
          auto_file_sync: true,
          auto_compact: true,
          name: __MODULE__
        ]
      ]}
    }
  end
end
4 Likes