Concurrency and parallelism concepts

Concurrency and parallelism concepts describe how HNSW serves many queries and builds with many threads without corrupting the graph - and what throughput-versus-latency trade-offs follow.
Created: Updated: 2 min read

These are the topics in this section, each on its own page with a stable path you can bookmark or share.

What topics are covered in this section?

Concurrency and parallelism concepts describe how HNSW serves many queries and builds with many threads without corrupting the graph – and what throughput-versus-latency trade-offs appear under load.

What must stay correct when threads overlap?

Parallel query serving is mostly read-mostly graph safety; parallel insertion and multithreaded construction need per-node or careful global locking so adjacency updates do not race. Thread-safety guarantees, nondeterministic build order, work queues, and batch query execution are the operational vocabulary. CPU affinity can stabilize latency on busy hosts. The trade-off between throughput and latency explains why maxing QPS may hurt p99.

Bugs here look like flaky recall or rare crashes, not clean benchmark curves.

How does Weaviate approach concurrent HNSW?

Weaviate is built for concurrent imports and queries, with async indexing options that queue graph mutations so object writes return quickly. Tombstone cleanup runs as maintenance alongside traffic. Understanding parallel insertion versus read-mostly serving helps you choose consistency and resource limits. Replication adds another layer of parallelism across nodes – see distributed search for that scale.

Part IV’s concurrency chapter is the deep narrative for these terms.

Open parallel query serving, parallel insertion, read-mostly graph safety, and throughput-versus-latency pages, then Part IV’s concurrency chapter. For cluster scale, continue into sharding and replication.

This section covers threads cooperating on one graph. Next, read “What is parallel insertion?” or Part IV’s concurrency chapter, then failure-mode race-condition pages if you suspect corruption under load.