Are there any more resources on how to build an Ecto adapter for a key-value store?

Hey all!

I am currently adapting our application to work with Riak instead of Ecto(to be exact: EctoMnesia). Obviously, Riak is a very different beast from a SQL-database, because (by default) it only works as a simple key-value store and therefore has very limited query-abilities.
The main reason wanting to write a (basic!) Ecto adapter for Riak is that I would otherwise end up writing something that is probably close to an unfinished bug-ridden implementation of half of the schema- and association-logic that is in Ecto anyway.

And this brings me to my question: How can an Ecto Adapter be constructed for something like this?
I was only able to find very few resources on building an Ecto Adapter (for Ecto 3) on the net:

  • Part IV of Building a new MySQL Adapter for Ecto 3 on the Plataformatec blog. Unfortunately because it offloads a lot of work to EctoSQL it still keeps a lot of questions of how to do things without EctoSQL open.
  • The Documentation of Ecto.Adapter and related modules. While listing which callbacks need to be implemented, details are lacking. For instance, I have no idea what kind of structures an implementation of Ecto.Adapter.Queryable is supposed to be able to handle.

Any pointers or help would be greatly appreciated! :heart:


Are you saying you already use this?

I found three older projects that appear to have attempted what you are, with older versions of ecto. Maybe they’d be helpful:

Maybe @HashNuke and @pma could offer some insight?



Thank you! I was aware of riak_ecto but not of the other two.