DataMapper vs Sequel

From WikiVS, the open comparison website
Jump to: navigation, search

DataMapper and Sequel are Ruby libraries that provide object models on top of relational databases. While DataMapper is meant to use any data store back-end, Sequel focuses only on relational databases, specifically, SQL databases.


[edit] Philosophy

DataMapper starts with the object model and tries to abstract away the way the objects are stored. Hence, DataMapper maps objects onto its data store back-end. Sequel Models work the other way, starting with the database, and mapping database rows onto objects.

[edit] Technology

DataMapper and Sequel provide an impressive array of features that are found in no other ORMs.

[edit] Query Interface

Both DataMapper and Sequel have special DSL constructs that provide easy ways to fetch data using Ruby datatypes.

[edit] Back-ends

DataMapper supports most major SQL databases. However, it is not limited to databases only. DataMapper can map object models to YAML and CSV, as well as object databases.

Sequel supports all major SQL databases.

[edit] Model Library

Sequel is divided into two parts, the core library and the model library. The core library allows users to connect, read, and manipulated databases directly, while the model library provides an ActiveRecord-like interface to create object models on top of the core library.

DataMapper has only one library that does all the database manipulation.

[edit] Lazy loading

DataMapper has direct support for lazy loading.

[edit] Eager graphs

Both DataMapper and Sequel have support for eager graphs. DataMapper's eager loading is implicit, while Sequel's eager loading is explicit.

See Also the Following Articles

Personal tools