Schema separation for event store and read models #166

Closed
opened 2026-03-02 22:41:18 +00:00 by ash · 0 comments
Owner

Problem

All tables live in public schema. No separation between immutable event log and disposable read models.

Solution

Recommended layout:

eventstore.events / checkpoints / command_log
readmodel.* (all projections)

Use Postgres search_path in connection string — two pools, zero code changes.

Implementation

  1. pgstore.EnsureSchema(ctx, pool, name) helper
  2. Docs: recommended layout, rebuild guide
  3. Migration guide: single-schema to two-schema

No framework changes needed — just pool configuration.

## Problem All tables live in public schema. No separation between immutable event log and disposable read models. ## Solution Recommended layout: ``` eventstore.events / checkpoints / command_log readmodel.* (all projections) ``` Use Postgres search_path in connection string — two pools, zero code changes. ## Implementation 1. pgstore.EnsureSchema(ctx, pool, name) helper 2. Docs: recommended layout, rebuild guide 3. Migration guide: single-schema to two-schema No framework changes needed — just pool configuration.
ash closed this issue 2026-03-02 22:45:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ash/eskit#166
No description provided.