feat(example-doc-vault): implement dual-backend routing with automatic ObjectUri deduction #11

Open
opened 2026-10-27 14:51:22 +00:00 by crapougnax · 0 comments
Owner

Migrated from GitHub https://github.com/Quatrain/Core/issues/38 (opened by @crapougnax on 2026-09-18).

Part of parent story #9.

🎯 Goal

Configure a dual-database architecture demonstrating seamless multi-backend query resolution via ObjectUri.

📋 Specification

  1. Register primary backend:
    • Backend.addBackend(postgresAdapter, 'postgres', true) (for active operational documents).
  2. Register secondary archive backend:
    • Backend.addBackend(sqliteAdapter, 'archive', false) (for immutable audit logs and compliance records).
  3. Demonstrate automatic ObjectUri routing without manual repository wiring:
    • Document.repository().read('doc-101') routes to postgres.
    • AuditLog.repository().read('archive:audit_logs/log-505') automatically routes to archive (SQLite).
  4. Demonstrate cross-backend Active Record lifecycle (auditLog.save() writing automatically to archive).
> Migrated from GitHub https://github.com/Quatrain/Core/issues/38 (opened by @crapougnax on 2026-09-18). Part of parent story #9. ### 🎯 Goal Configure a dual-database architecture demonstrating seamless multi-backend query resolution via ObjectUri. ### 📋 Specification 1. Register primary backend: - `Backend.addBackend(postgresAdapter, 'postgres', true)` (for active operational documents). 2. Register secondary archive backend: - `Backend.addBackend(sqliteAdapter, 'archive', false)` (for immutable audit logs and compliance records). 3. Demonstrate automatic ObjectUri routing without manual repository wiring: - `Document.repository().read('doc-101')` routes to `postgres`. - `AuditLog.repository().read('archive:audit_logs/log-505')` automatically routes to `archive` (SQLite). 4. Demonstrate cross-backend Active Record lifecycle (`auditLog.save()` writing automatically to `archive`).
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
quatrain/core#11
No description provided.