← Graph

Deferred Requests

concept 2 connections

Request-level analog of SQLite's deferred transactions that Margheim invented for isolated reader/writer connection pools. Every incoming web request starts wrapped in a `connected_to(role: :reading)` block using the reader connection pool; only when a write operation occurs (via the patched `transaction` method) does it briefly switch to the writer pool, then fall back. Implemented via Rails' automatic multi-database switching initializer with a custom resolver that marks every request as a reading request.

category
pattern
about
Deferred Requests concept
Invented concept for making isolated reader/writer pools transparent to controllers.
concept Deferred Requests
related_to
Deferred Requests is the request-level switching mechanism that makes isolated pools transparent.

Provenance

Read by
1 extraction