You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
api-main is the only service with a direct Postgres connection today. The reader streams blocks and writes chain-derived state by calling the secured reader endpoints in api-main, which then touch the same tables that user-facing API code uses. Feed sync and future services either consume those API endpoints or would need read-only access. We need a clear separation before the service surface grows.
Problem:
No enforced boundaries between reader-owned data and API-owned data
Feed sync and future services hit the writer database directly
Risk of data corruption if non-reader services accidentally mutate chain state
Load and lock contention as more services read from the primary
Proposed Solution
Phase 1: Role separation
Create reader_writer role for chain-derived tables
Create chain_readonly role for downstream consumers
Move chain tables to dedicated schema with strict permissions
Phase 2: Read replicas
Stand up read replica for feed sync and analytics
Route read-only queries away from primary
Add connection pooling per service type
Phase 3: Domain separation
Consider splitting into chain DB vs API DB
Evaluate event streaming for cross-domain data flow
Design for independent scaling and failure isolation
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current State:
api-mainis the only service with a direct Postgres connection today. The reader streams blocks and writes chain-derived state by calling the secured reader endpoints inapi-main, which then touch the same tables that user-facing API code uses. Feed sync and future services either consume those API endpoints or would need read-only access. We need a clear separation before the service surface grows.Problem:
Proposed Solution
Phase 1: Role separation
reader_writerrole for chain-derived tableschain_readonlyrole for downstream consumersPhase 2: Read replicas
Phase 3: Domain separation
Beta Was this translation helpful? Give feedback.
All reactions