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
Legend
Abstraction Level
Separation of Concerns
Complexity
Scalability
Testability
Showing 12 of 12 patterns
Repository Pattern
Abstracts data access layer from business logic
Abstraction: 4
Complexity: 3
Resource Pattern
Organizes data access around resources mirroring REST endpoints
Abstraction: 3
Complexity: 3
Active Record Pattern
Combines data access methods and domain logic in a single class
Abstraction: 2
Complexity: 2
Data Mapper Pattern
Separates domain objects from database access logic using mapper classes
Abstraction: 5
Complexity: 4
Unit of Work Pattern
Tracks changes and coordinates writing to multiple repositories in a single transaction
Abstraction: 4
Complexity: 4
DAO Pattern
Abstracts persistence operations for a specific entity type
Abstraction: 3
Complexity: 3
Query Builder Pattern
Provides a programmatic way to construct SQL queries
Abstraction: 2
Complexity: 2
Service Layer Pattern
Defines application boundaries and available operations
Abstraction: 4
Complexity: 3
Transaction Script Pattern
Organizes business logic as procedural scripts or functions
Abstraction: 1
Complexity: 1
Table Data Gateway Pattern
Provides a gateway class for all access to a single database table
Abstraction: 2
Complexity: 2
Row Data Gateway Pattern
Provides an object that acts as a gateway to a single database row