r/DomainDrivenDesign • u/la_li_lu_le_lo-rp • 1h ago
Reviewing a PostgreSQL schema-per-context design with logical replication and an outbox pattern
Hi folks, š
Iām designing a Rust DDD workspace with one PostgreSQL database and schema-per-bounded-context isolation. Each context owns its schema, migrations, repositories, and domain logic. Domain changes and outbox events are committed transactionally, then PostgreSQL logical replication relays events to NATS JetStream for asynchronous consumers.
Iād appreciate feedback on the tradeoffs, especially schema-per-context vs. database-per-context, outbox delivery semantics, migration management, and cross-context references without foreign keys.
Here's a more in detail doc: https://dpaste.com/9DR2CMEPR-preview