Active record pattern
The Active Record pattern combines an object representing a persistent data record with operations for querying, storing, updating, and deleting that record.
Quarkus in Action
The active record pattern is a persistence pattern in which a data record object encapsulates the operations for storing, updating, deleting, and querying itself.
- How it is used
- Replaces stubbed reservation storage with entity-centered database access in a Quarkus service.
- How deep it goes
- Works through extension setup, entity definition, resource changes, transactions, and persistence verification without cataloging every Panache operation.
- Examples
- Uses Car method calls, a PostgreSQL-backed Reservation resource, POST/GET and psql checks, and a MongoDB Rental entity.
- What you can do after
- Build it from scratch with Panache entities and call their persistence and query methods from a Quarkus service.
Unit Testing Principles, Practices, and Patterns
The Active Record pattern combines a domain object's business logic with its persistence operations against a database.
- How it is used
- Deploys domain objects as both business-logic holders and database gateways, especially in simple or short-lived projects.
- How deep it goes
- Defines the pattern, diagnoses its testing costs, and demonstrates refactoring toward services, factories, and in-memory domain objects.
- Examples
- Uses a User class that loads itself from Database, changes email state, saves data, and sends a message.
- What you can do after
- Evaluate when database coupling makes a domain class overcomplicated and refactor coordination into an application service.
Read how Unit Testing Principles, Practices, and Patterns explains active record pattern →
Architecture Modernization: Socio-technical alignment of software, strategy, and structure
The active record pattern combines an object representing a domain record with the methods that persist and retrieve that record from a database.
- How it is used
- Uses a combined domain-and-persistence model to support rapid early delivery in a growing product.
- How deep it goes
- Defines the coupling and traces its maintenance and scaling consequences, but stops short of implementation detail.
- Examples
- Uses a Netherlands-to-Germany gigs-platform expansion to expose regional-model, integration, and team-scaling pressures.
- What you can do after
- Evaluate how coupling domain and persistence logic affects changeability, understandability, and scalability.
Related concepts
- Panacheimplemented by · Panache is a Quarkus framework that simplifies object-relational and database access development through concise APIs and entity-oriented abstractions.
- repository patternalternative to · The repository pattern is a software design pattern that abstracts access to and persistence of application or domain data, hiding storage-specific operations.
- EntityManageralternative to · EntityManager is a Jakarta Persistence API interface that manages persistence contexts and performs lifecycle and persistence operations on entity instances.
- couplingproduces · Coupling is the degree of dependency between software components, including how their behavior, availability, or changes affect one another.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


