Skip to content

KV Watcher Real Time Updates #33

Description

@taitelee

Problem

Currently, the Pipes Store (which holds the named SQL queries) only loads data from the NATS Key-Value (KV) store when a WaveHouse instance first boots up. In a clustered environment with multiple API or Worker nodes, this creates a synchronization lag: if an admin updates a Pipe on Node A, Node B will continue running the old, outdated SQL until it is manually restarted. This prevents the "Live Coding" experience where query changes should take effect across the entire cluster instantly.

Proposed Solution

Implement a KV Watcher pattern within the internal/pipes/store.go. Instead of a one-time "Get" during initialization, the Store should establish a long-lived subscription to the NATS KV bucket.

When a change occurs (Put or Delete), NATS will push a notification to every WaveHouse node. The Store will then reactively update its local in-memory cache. This ensures that every node in the cluster is perfectly synchronized within milliseconds of a Pipe being updated, without requiring any manual restarts or coordination.

Alternatives Considered

None

Additional Context

None

Activity

  1. added theissue type on Apr 16, 2026
  2. changed the title [-][feature] [Cluster] KV Watched Real Time Updates[/-] [+]KV Watched Real Time Updates[/+] on Apr 16, 2026
  3. self-assigned this
    on Apr 27, 2026
  4. moved this from Backlog to In progress in WaveHouse Task Boardon Apr 27, 2026
  5. moved this from In progress to In review in WaveHouse Task Boardon Apr 28, 2026
  6. changed the title [-]KV Watched Real Time Updates[/-] [+]KV Watcher Real Time Updates[/+] on May 5, 2026
  7. moved this from In review to Backlog in WaveHouse Task Boardon May 5, 2026
  8. EricAndrechek commented on Oct 8, 2026

    @EricAndrechek
    Member

    Closed by #508, which listed this issue but did not close it automatically. Pipes no longer live in a NATS KV bucket: each tenant's pipes come from its pipes.json and are re-adopted without a restart on a file change, SIGHUP, or POST /v1/ops/settings/reload (internal/settings/store.go, watch.go). Every instance reads the same settings directory, so an edit reaches each one when it reloads. Draft #83 targets the removed KV store and is superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions