Database / Weaviate Vector database Interview questions
How do you optimize Weaviate for memory efficiency at large scale?
At large scale, memory is typically the dominant cost driver for a Weaviate deployment (particularly for HNSW-indexed collections), so optimization mostly means reducing what has to stay resident in memory without unacceptably sacrificing recall or latency for the workload.
- Enable RQ compression as a default starting point - since it requires no training and provides strong recall retention, it's a low-risk way to meaningfully cut memory footprint on HNSW indexes.
- Consider HFresh for the largest, most memory-constrained collections - trading some peak query throughput for a dramatically smaller memory footprint by keeping only a compressed centroid index in memory and posting lists on disk.
- Use the Dynamic index for multi-tenant collections - avoiding the memory overhead of HNSW graphs for tenants whose data volume never actually warrants it.
- Right-size replication factor - since each replica is a genuine additional copy of the data, match the factor to actual availability and throughput needs rather than over-provisioning by default.
- Use Object TTL for data with a natural expiration - automatically removing stale data keeps the resident dataset (and its memory footprint) from growing unnecessarily over time.
- Evaluate whether every property genuinely needs vectorization - named vectors let different properties be embedded independently, so unnecessary vectors on properties that don't need semantic search can be avoided entirely.
As with most large-scale vector search systems, the general principle is to reserve the most memory-expensive configuration (uncompressed HNSW, high replication) specifically for the data and query patterns that genuinely need that level of performance, while applying more memory-efficient options (RQ, HFresh, Dynamic, TTL) everywhere the workload can tolerate the trade-off.
More Related questions...