Documentation/Architecture

Storage routing

RegionRouter is a map[regionID]*TSDBClient under an RWMutex. In-memory, reload preserves the connection pool for unchanged URLs.

Synthetic __legacy__

When the regions table is empty a synthetic __legacy__ default region is created so single-region deployments work without migrations.

Reload

After a region is created/deleted the API calls router.Reload() — it re-reads the table, rebuilds the map and keeps conn pools for URLs that haven't changed.

VMForRegion

func (rr *RegionRouter) VMForRegion(regionID string) *TSDBClient
  • Empty regionID → default
  • Unknown regionID → default (no errors, so migrations don't break)