Active Record

Design pattern to manage the data model

Aug 31, 2025

Active Record is a design pattern from Patterns of Enterprise Application Architecture. In this pattern, the data model handles CRUD operations on itself, including both basic CRUD operations and complex operations on the underlying data structure.

It can be visualized as a table wrapped into a class or interface, which provides methods to update the underlying row. Each object represents a row in the table. When an object is updated, the corresponding row in the table is also updated.

This pattern is commonly used by object persistence tools and in ORMs.

Cons

  • Violates the separation of layers of responsibility, as with this pattern the data model works both as business data and repository layer.

Note

Different from the Active Object Pattern.