LifecycleHelp

Cloud sync

Help

Cloud sync

Hosted shared database as source of truth; local nodes link and sync portal / instance requests.

Intended model

On hosted Lifecycle, a shared cloud database is the source of truth for desks. Local or edge nodes (for example PGLite on-prem boxes) link to that cloud and sync portal and instance requests so employees and admins see consistent state.

Linked nodes record node id, instance slug, hostname, last sync time, and any last sync error. Instance / portal requests can carry an origin node id and origin kind (such as portal) plus a cloud-synced timestamp.

Linking a local node

On the hosted desk, set DATABASE_URL to the Supabase Postgres URI (pooler preferred). That desk is cloud-primary.

On a local or on-prem install that keeps PGLite, set LIFECYCLE_CLOUD_DATABASE_URL to the same URI. Optional: LIFECYCLE_CLOUD_SYNC_MS (default 30000) and LIFECYCLE_NODE_NAME.

Open Dev → Cloud sync to see link status, linked nodes, and run Sync now. The background loop also pushes and pulls create-instance requests on that interval.

What syncs

instance_requests rows (create-instance names from the apex / portal), including origin node id, origin kind, and cloud_synced_at. Last write by updated_at wins.

Portal actions and instance requests created on a linked node appear on the authoritative hosted desk after sync. If sync is delayed, prefer the hosted instance hostname for staff work and retry the portal link if the desk has not received the request yet.

Status

Schema (cloud_linked_nodes + request origin columns), bidirectional sync, and the Dev Cloud sync pane ship with Lifecycle. Point DATABASE_URL or LIFECYCLE_CLOUD_DATABASE_URL at the shared Supabase project to go live.

Back to help index