Database / Weaviate Vector database Interview questions
What is the difference between HNSW and the HFresh index in Weaviate?
HNSW keeps its full graph structure in memory for fast, high-recall search, which delivers strong query performance but means memory usage scales directly with data volume. HFresh is a newer, disk-based cluster index designed specifically for cases where memory efficiency matters more than achieving HNSW's peak query throughput.
| HNSW | HFresh |
| Full graph structure held in memory. | Only a compressed centroid index held in memory; posting lists live on disk. |
| Higher peak query throughput. | Lower peak throughput, higher latency, in exchange for much smaller memory footprint. |
| Compression (PQ/BQ/SQ/RQ) optional, applied on top of the graph. | Uses mandatory 1-bit RQ for posting lists and 8-bit RQ for centroids by design. |
| Best when memory is available and lowest latency matters most. | Best when memory efficiency is the priority, especially for high-dimensional vectors at large scale. |
HFresh works by clustering vectors into posting lists and using an HNSW-based centroid index (itself compressed) to quickly identify which few clusters are worth searching for a given query, then reading only those clusters' posting lists from disk rather than needing the entire dataset resident in memory, conceptually similar to how a disk-based ANN approach in other vector databases addresses the same memory-versus-scale trade-off.
More Related questions...