← All topics

Distributed Systems & Scaling · Topic 164

Throttling and Rate-limiting

Throttling and rate-limiting cap how many requests (or how much resource usage) a client, tenant, or API key can consume. They protect the vector database from overload, ensure fair sharing among multi-tenant users, and help keep latency and throughput predictable.

Summary

  • Throttling and rate-limiting cap how many requests (or how much resource) a client, tenant, or API key can consume. They protect the VDB from overload, ensure fair sharing among multi-tenant users, and keep latency and throughput predictable.
  • Mechanisms: per-second/per-minute limits, concurrency limits, token-bucket or leaky-bucket. Applied at gateway, coordinator, or data nodes. Exceeding limit returns HTTP 429 or backpressure. Rate-limit both query and write traffic; tenant- or namespace-level limits support SaaS. See Kubernetes and load balancers for admission control. Pipeline: request arrives, check limit, allow or 429. Practical tip: apply limits at coordinator and at gateway for defense in depth.

Mechanisms

Common mechanisms: per-second or per-minute request limits (e.g. 1000 QPS per API key), concurrency limits (max in-flight requests per client), and token-bucket or leaky-bucket algorithms that allow short bursts while enforcing a sustained rate. Limits can be applied at the gateway, at the coordinator, or at each data node. When a client exceeds the limit, the server typically returns HTTP 429 (Too Many Requests) or a backpressure signal so the client can retry with backoff.

Applying limits in VDBs

For vector DBs, it is useful to rate-limit both query and write (ingestion) traffic, since heavy indexing can contend with queries for CPU and I/O. Tenant- or namespace-level limits support SaaS offerings where each customer has a quota. Integration with Kubernetes or cloud load balancers can add admission control before requests reach the VDB, complementing in-process throttling. Pipeline: request arrives, check limit, allow or return 429. Practical tip: apply limits at coordinator and at gateway for defense in depth.

Frequently Asked Questions

What is throttling and rate-limiting in a VDB?

Capping how many requests (or how much resource) a client, tenant, or API key can consume. Protects the VDB from overload, ensures fair sharing among multi-tenant users, and keeps latency and throughput predictable.

What mechanisms are used?

Per-second or per-minute request limits (e.g. 1000 QPS per API key), concurrency limits (max in-flight per client), token-bucket or leaky-bucket for sustained rate with short bursts. When exceeded, server typically returns HTTP 429 or backpressure so client can retry with backoff. Can be applied at gateway, coordinator, or data nodes.

Should I rate-limit writes as well as queries?

Yes. Heavy indexing can contend with queries for CPU and I/O. Rate-limit both query and write (ingestion) traffic. Tenant- or namespace-level limits support SaaS where each customer has a quota. See load balancing.

How does this integrate with Kubernetes?

Integration with Kubernetes or cloud load balancers can add admission control before requests reach the VDB, complementing in-process throttling. See coordinator layer where rate limiting is often applied.