Database Access Patterns Explorer
Compare different database access patterns applicable to a wide range of applications. While examples reference Node.js, Next.js and Remix, these patterns translate across various tech stacks. Understand the tradeoffs in complexity, abstraction level, and separation of concerns.
Filters
Each metric is rated 1 to 5. Filled segments show the rating; open a pattern for the full breakdown, use cases, and framework notes.
Repository Pattern
Abstracts data access layer from business logic
Resource Pattern
Organizes data access around resources mirroring REST endpoints
Active Record Pattern
Combines data access methods and domain logic in a single class
Data Mapper Pattern
Separates domain objects from database access logic using mapper classes
Unit of Work Pattern
Tracks changes and coordinates writing to multiple repositories in a single transaction
DAO Pattern
Abstracts persistence operations for a specific entity type
Query Builder Pattern
Provides a programmatic way to construct SQL queries
Service Layer Pattern
Defines application boundaries and available operations
Transaction Script Pattern
Organizes business logic as procedural scripts or functions
Table Data Gateway Pattern
Provides a gateway class for all access to a single database table
Row Data Gateway Pattern
Provides an object that acts as a gateway to a single database row
CQRS Pattern
Separates read operations from write operations