jackc / edge

Edge provides graph functionality to ActiveRecord.
MIT License
90 stars 10 forks source link

How does this compare to Dagnabit? #1

Closed turadg closed 11 years ago

turadg commented 11 years ago

Can you document why someone would choose this over dagnabit?

https://github.com/NUBIC/dagnabit

They sound very similar.

jackc commented 11 years ago

I had not previously seen dagnabit, but a cursory examination reveals a few differences.

  1. Edge is specific to trees and as such only uses a parent id column to establish the tree structure. dagnabit uses edges and nodes. So dagnabit can represent more types of graphs than a tree at the expense of a more complex schema.
  2. Edge is nearly a drop in replacement for acts_as_tree, just faster.
  3. Edge uses Arel instead of SQL strings. This means it should work on any Arel compatible database that supports recursive CTE even if it uses different syntax than PostgreSQL (such as SQL Server).
  4. Edge can preload the association proxies of all records in a tree -- dagnabit might do this but I couldn't find it.

If your graph is a tree edge will probably be simpler to to use, otherwise you would need something like dagnabit.

turadg commented 11 years ago

Ideal response! Thanks.

On Mon, Feb 11, 2013 at 2:11 PM, Jack Christensen notifications@github.comwrote:

I had not previously seen dagnabit, but a cursory examination reveals a few differences.

  1. Edge is specific to trees and as such only uses a parent id column to establish the tree structure. dagnabit uses edges and nodes. So dagnabit can represent more types of graphs than a tree at the expense of a more complex schema.
  2. Edge is nearly a drop in replacement for acts_as_tree, just faster.
  3. Edge uses Arel instead of SQL strings. This means it should work on any Arel compatible database that supports recursive CTE even if it uses different syntax than PostgreSQL (such as SQL Server).
  4. Edge can preload the association proxies of all records in a tree -- dagnabit might do this but I couldn't find it.

If your graph is a tree edge will probably be simpler to to use, otherwise you would need something like dagnabit.

— Reply to this email directly or view it on GitHubhttps://github.com/JackC/edge/issues/1#issuecomment-13396880.