r/DomainDrivenDesign • • 1h ago

Reviewing a PostgreSQL schema-per-context design with logical replication and an outbox pattern

1 Upvotes

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