Hasty Briefsbeta

Bilingual

Replica-aware routing public beta

2 days ago
  • Temporary tables and named sessions in ClickHouse only exist on the replica they were created on, causing failures when subsequent queries load-balance to another replica.
  • Replica-aware routing solves this by consistently sending requests to the same replica, enabling access to session-scoped objects and read-after-write consistency.
  • Over HTTP, use the header `X-ClickHouse-Replica-Tag`; over native connections, override the SNI value with a routing key.
  • Key use cases include maintaining temporary tables/sessions, keeping replica caches warm for performance, and ensuring read-after-write consistency for interactive apps and ETL jobs.
  • The feature is implemented using Istio and Envoy, with consistent hashing on the provided tag or SNI value.
  • Caveats: stickiness is best-effort (subject to upgrades/restarts/scaling), not workload isolation, and limited to Enterprise tier plans.