4 ms·
I've used sequel and activerecord extensively--most recently at http://vodpod.com http://vodpod.com, which has, er, non-trivial database requirements. Hands do
by aphyr 17y ago
I've used sequel and activerecord extensively--most recently at http://vodpod.com http://vodpod.com, which has, er, non-trivial database requirements.
Hands down, Sequel is the superior library. Arbitrary many-through-many-through-many-... relationships, totally customizable callbacks for association building/caching, trivially easy master/slave and multi-master sharding, infinitely chainable and extensible subsets, powerful grouping and joining support... the list goes on and on. Plus it's bloody fast. let's put it this way: it is almost never necessary to drop to raw SQL with Sequel. The only cases in which I've done so have been implemented as Sequel features or plugins within three months. In ActiveRecord, we have to drop to SQL all the time.
Plus, the code is clean. Extremely modular, readily extensible; anyone who's poked around in the AR source can tell you what a nightmare it is to figure out what's going on.
Also, Jeremy Evans (the author), and the rest of the community around it, are awesome--check out #sequel on Freenode sometime.
- jamesbritt 17y agoI started with AR for Jotbot (my desktop JRuby app), but it had assorted funkiness that made using outside of a gem environment too annoying, so I gave up. (Gem code should not have 'require "rubygems"' littered about. ) I had been using Sequel with Web apps already, and when I needed to add adapter code for the Java H2 DB it was pretty straightforward, plus Jeremy was quite helpful. Besides, Sequel always felt more like Ruby than AR. Big props to Jeremy and team for a sweet library. (Just wish it had a different name. :) )
- pkulak 17y agoJust the syntax alone is enough to move from ActiveRecord for any new project. The dataset/method chaining method really makes AR's hash passing seem verbose and cumbersome. Though, I hear AR is moving that way in the next major release, so they seem to know that as well as anyone else.
- petercooper 17y agoActiveRecord 3 does all the method chaining goodness, thanks to Arel :-) It's really nice, check it out.
- compay 17y agoI agree Sequel is awesome, and will probably be my default ORM once Rails 3 settles down. However, the new AR in Rails 3 using Arel is pretty nice too; it's a massive improvement over AR 2. You might want to give it another look.