Hello all,
Today I am excited to announce ArangoXEcto, an all-in-one ArangoDB adapter for Ecto, has reached version 2.0. This included a lot of reworks of functionality and now has (what I would say is) a pretty good integration with standard Ecto functionality.
If you don’t know what ArangoDB is, it is a powerful graph database that is performant, scalable and feature rich. One of the powerful features of ArangoDB is that it can act as a regular NoSQL database as well as a graph database and is designed for enterprise uses as well (ai bandwagon anyone?).
As far as I am aware this may be the most integrated a graph database has been into Ecto, i.e. without having to use excessive non-Ecto functions, however, I could be wrong on this so keen to hear if anyone else has tackled this challenge.
The journey
Before I started my journey in Elixir I had used ArangoDB with Python and when I discovered (and fell in love with) Elixir I immediately wanted to use ArangoDB with Elixir. When I had a look around for packages I was disappointed to find that there was no package that integrated with Ecto (at least above version 2). So, being the good citizen of the open source community that I like to think I am, I decided to write my own ArangoDB adapter that directly integrated with Ecto.
To get started I drew upon mpoeter’s conversion of Ecto queries to AQL (ArangoDB’s query language) and used the amazing Arangox package for database connections. So thank you to both of the aforementioned for their contributions.
What I had embarked on was a lot more work than my naive self had first bargained for. As it turns out, it is not so easy to get a graph database to function with a tool that was originally designed for relational databases. However, after many iterations of functionality I believe I have finally gotten it to a point where using a graph database with Ecto is quite seamless.
Yes, there are some edge cases and some asterisks on some functionality but as it stands everything works pretty well!
Going forward
Looking to the future I would like to do a few things:
- Look into furthering graph database support directly into Ecto through a PR (e.g. supporting multiple queryables on associations and more). At the moment some functionality is re-implementations of code already in the Ecto codebase and that can be problematic for maintainability.
- Further develop the named graph functionality
- Implement some of the more advanced ArangoDB functionality (i.e. some more of the enterprise features)
Please let me know your thoughts on the library.