Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

ORM Patterns

In practice there are two common ORM patterns:

  • ActiveRecord: uses the model class to handle both business logic and database access.
  • DataMapper: a more complex approach which separates the in-memory objects from the database. Uses two class types:
    • Mapper: handles database access and mapping entities
    • Entities: in-memory representation with business logic

Some ORMs, like TypeORM support both patterns. Others like Sequelize support only ActiveRecord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.