← Graph

Read-Write Split

concept 4 connections

Krzywda's refactoring recipe for shrinking Active Record models: split each model into a write object (decisions only — validations, business rules, publishing events; no readers, no associations) and a read object (still Active Record, used for displaying data with associations). The write object stays free of Active Record, loses ~80% of its size (readers disappear), and communicates with the read object via domain events. Motivated by Marcus Schirp's remark that Active Record exposes an infinite API.

category
pattern
about
Read-Write Split concept
Describes splitting Active Record models into decision-making write objects and display-oriented read objects.
about
Read-Write Split concept
Direct formulation of the read-write split pattern.
concept Read-Write Split
related_to
CQRS concept
Separating decision-making write objects from display-oriented read objects is a form of command-query separation.
concept Read-Write Split
related_to
Active Record concept
Proposed specifically as a way to shrink bloated Active Record models.

Provenance

Read by
7 extractions