Docs / Scale search with the load

Scale search with the load

When search traffic spikes, KalDB adds query nodes, cache nodes, and extra replicas of the data being searched, then releases them when the traffic is gone, without rebalancing any data.

KalDB sizes search capacity to the load it has right now. When search traffic spikes, it adds query nodes, cache nodes, and extra replicas of the data being searched. When the traffic goes away, it gives that capacity back. None of this moves data that is already stored.

How KalDB scales search capacity with the loadAI agents send searches to one query node, which reads snapshot replicas from two cache nodes. Every snapshot is stored once in S3. When an incident drives five times the searches, KalDB adds two query nodes and two cache nodes and loads extra replicas of the hot snapshots from S3. When the traffic goes away, the extra replicas and nodes are released without rebalancing.S3every snapshot, stored onceS1S2S3S4S5S6load replicasAI agentssearchingincident: 5× searchesQuery 1Query 2releasingQuery 3releasingCache 1S1S2S3Cache 2S4S5S6Cache 3releasingS1S2Cache 4releasingS1S2Every search for the incident window lands on Cache 1. Latency climbs.Hot snapshots S1 and S2 now have 3 replicas each. Cold snapshots keep 1.Extra replicas are dropped. Every snapshot is still in S3, so nothing is rebalanced.
Search capacity 1 query node · 2 cache nodes. Sized for normal load. Search load is up 5×. Searches are slowing down. 3 query nodes · 4 cache nodes. Hot snapshots have 3 replicas. Back to 1 query node · 2 cache nodes. No paying for the spike after it's over.

The problem

In Elasticsearch and OpenSearch, every index has a fixed number of replicas, and each node stores the shards it serves. Adding a node means copying shards onto it, and removing one means copying them off again. Rebalancing takes hours on a large cluster and adds load at exactly the wrong moment, so teams provision for peak and leave it there.

Search peaks are rare and short. During an incident, engineers and the AI agents investigating it all hit the same few hours of logs at once. A cluster sized for those moments sits mostly idle the rest of the time, and a cluster sized for normal load slows down exactly when search matters most. Adding replicas to the whole index doesn’t help much either: it multiplies the storage cost of every index to speed up a small slice of the data.

How it works

KalDB separates storage from compute. Indexers upload every finished chunk to S3 as a snapshot, and S3 is the source of truth. Cache nodes hold replicas of snapshots on local disk to serve searches quickly, and query nodes fan searches out to them. Since no node owns data, nodes can be added and removed without rebalancing.

  1. Steady state. One replica of each snapshot is spread across a small pool of cache nodes, and a few query nodes handle searches.
  2. Traffic spikes. When search load rises, KalDB sees which snapshots the searches are hitting. During an incident, that is usually a narrow time window.
  3. More nodes, more replicas of hot data. KalDB adds query nodes and cache nodes, and creates extra replicas of the hot snapshots on the new cache nodes. They load straight from S3. The number of replicas varies by snapshot: hot snapshots get several, cold ones keep one.
  4. Searches spread out. Query nodes send each search to any replica of the snapshots it needs, so the load is shared across all the copies.
  5. Traffic goes away. When search load drops, KalDB removes the extra replicas and releases the idle query and cache nodes. Every snapshot is still in S3 and still has a replica in cache, so nothing is copied or rebalanced.

Why it matters

  • Fast searches during incidents. The data everyone is searching gets more replicas and more nodes exactly when it is needed.
  • No paying for peak. Query and cache capacity follow the load, so the cluster runs at normal size most of the time.
  • Scaling takes minutes, not hours. New cache nodes load snapshots from S3 instead of copying shards from other nodes.
  • Replicas where they count. Extra replicas go to hot data only, instead of multiplying the storage cost of every index.

Trade-offs

  • New nodes need a warm-up. A new cache node has to download its snapshots from S3 before it can serve them. Until then, existing replicas keep serving searches.
  • Scale-down is deliberately slower than scale-up. KalDB waits for the load to stay low before releasing nodes, so a brief lull in an incident doesn’t trigger a scale-down and an immediate scale-up.

Related