Announcing Dagnabit
I’ve just released dagnabit, an ActiveRecord plugin for representing directed acyclic graphs in relational databases. The source is online at Gitorious and the library is available as a gem from Gemcutter.
I wrote dagnabit because I needed a way to support fast reachability queries (i.e. “is node C connected to node A?”) in directed acyclic graphs for a work project. Existing dag plugins, at the time, either provided only slow recursive queries (slow when each recursion requires you to hit the database) or had unwieldy code bases.
(You can argue that a relational database isn’t the right place to store a dag. You can argue that DataMapper is the new hotness and ActiveRecord is legacy. I tend to agree on both, though am more cautious on the latter. But sometimes you have to work with what you’re given, for inertial or institutional reasons.)
dagnabit is my attempt to solve both problems. It’s fast and well-tested. (Yes, I know line coverage doesn’t mean much, but it’s a start.) Documentation’s a little dodgy, unfortunately, but I think it’s sufficient to use the library. Let me know if that’s not the case.