MontréalCrépusculeCiel clair
David Paquet Pitts/Experiments
Interactive Tool

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.

Showing 12 of 12 patterns

Repository Pattern

Abstracts data access layer from business logic

Abstraction4 out of 5
Complexity3 out of 5
Diagram & details

Resource Pattern

Organizes data access around resources mirroring REST endpoints

Abstraction3 out of 5
Complexity3 out of 5
Diagram & details

Active Record Pattern

Combines data access methods and domain logic in a single class

Abstraction2 out of 5
Complexity2 out of 5
Diagram & details

Data Mapper Pattern

Separates domain objects from database access logic using mapper classes

Abstraction5 out of 5
Complexity4 out of 5
Diagram & details

Unit of Work Pattern

Tracks changes and coordinates writing to multiple repositories in a single transaction

Abstraction4 out of 5
Complexity4 out of 5
Diagram & details

DAO Pattern

Abstracts persistence operations for a specific entity type

Abstraction3 out of 5
Complexity3 out of 5
Diagram & details

Query Builder Pattern

Provides a programmatic way to construct SQL queries

Abstraction2 out of 5
Complexity2 out of 5
Diagram & details

Service Layer Pattern

Defines application boundaries and available operations

Abstraction4 out of 5
Complexity3 out of 5
Diagram & details

Transaction Script Pattern

Organizes business logic as procedural scripts or functions

Abstraction1 out of 5
Complexity1 out of 5
Diagram & details

Table Data Gateway Pattern

Provides a gateway class for all access to a single database table

Abstraction2 out of 5
Complexity2 out of 5
Diagram & details

Row Data Gateway Pattern

Provides an object that acts as a gateway to a single database row

Abstraction2 out of 5
Complexity1 out of 5
Diagram & details

CQRS Pattern

Separates read operations from write operations

Abstraction5 out of 5
Complexity5 out of 5
Diagram & details