Questions
9 of 14
1What is a segment in Qdrant's storage engine, and why does a collection consist of multiple segments rather than one monolithic index?
2What role does the Write-Ahead Log (WAL) play in Qdrant, and what failure scenario does it protect against?
3How does memory-mapped (mmap) storage allow Qdrant to serve a collection larger than available RAM?
4What does the background optimizer do in Qdrant, and why can too-aggressive optimization affect query latency?
5What is the practical difference between storing vectors in-memory versus on-disk in a collection configuration, and when would you choose on-disk?
6What is sharding in a distributed Qdrant cluster, and what determines which shard a given point is written to by default?
7What is custom sharding, and how does it change the way multitenant data is distributed across a cluster?
8What consensus algorithm does Qdrant use to keep cluster metadata consistent across nodes, and what does it coordinate?
9What are Qdrant's tunable read/write consistency levels for distributed operations, and what trade-off do they represent?
10In a replicated cluster, what happens to search results if a query is served while one replica of a shard is temporarily out of sync?
11Walk through what happens internally, at a high level, when a client sends a filtered vector search request to a distributed Qdrant cluster.
12Why does Qdrant merge and re-rank results from multiple shards rather than simply concatenating each shard's top-k?
13How does a payload filter interact with segment selection during query execution - does Qdrant always scan every segment?
14What is the performance implication of running a query that touches every named vector on a point versus one that specifies using?
09 / 14

What are Qdrant's tunable read/write consistency levels for distributed operations, and what trade-off do they represent?

Consistency levels trade freshness and correctness for latency and availability

Qdrant exposes consistency on both the write and read paths. On writes, write_consistency_factor controls how many replicas of a shard must acknowledge an operation before it is considered successful - one, a majority, or all. On reads, the consistency parameter controls how many replicas must respond before the result is returned - one, quorum, majority, or all. There is also write_ordering, which controls whether the WAL is flushed before or after the write is applied, trading durability for latency. These are not global settings; they can be set per request, so a latency-sensitive endpoint can read with consistency=one while a correctness-sensitive endpoint reads with consistency=all.

The mechanism is the same for both paths. A write goes to the shard's primary, which appends it to the WAL and streams it to replicas. With write_consistency_factor=1, the primary acks as soon as it has the write locally; replicas catch up asynchronously. With majority or all, the primary waits for that many replicas to confirm receipt before acking. A read is routed to one or more replicas depending on the consistency level: consistency=one sends it to any healthy replica, consistency=majority sends it to a majority and reconciles (returning the freshest view), consistency=all queries every replica and requires all to respond. Higher consistency means fresher, more complete results, but it costs latency and reduces availability because more replicas must be up and reachable. Lower consistency means faster responses and higher availability, but the result may be stale relative to the most recent write.

  1. 1

    Write: write_consistency_factor = 1 | majority | all. Higher means the write is durable on more replicas before acking.

  2. 2

    Read: consistency = one | quorum | majority | all. Higher means more replicas must respond and results are fresher.

  3. 3

    write_ordering: controls WAL flush behavior relative to applying the write; affects durability window and latency.

  4. 4

    Per-request: consistency can be set on each query, so different endpoints can use different levels.

  5. 5

    Interaction with failures: consistency=all makes reads and writes fail if any replica is down; lower levels tolerate replica failures.

The trade-off is the classic CAP trade-off expressed at the replica level: stronger consistency costs latency and availability, weaker consistency risks stale reads. In practice I choose consistency=one for search endpoints where a slightly stale result is acceptable and where tail latency matters, consistency=majority for read-your-write scenarios where a user has just submitted data and expects to see it, and consistency=all only for operations that genuinely require the latest state on every replica - which is rare, because all is fragile: a single lagging replica makes the operation fail. The common mistake is assuming the defaults are strong. Qdrant's defaults are permissive, which is a reasonable choice for search but wrong for read-after-write workflows. If your application upserts a point and immediately searches for it, you need either wait=true on the write or a stronger read consistency, or both. The second common mistake is setting consistency=all with a replication factor greater than one and then being surprised when a single slow replica causes timeouts. The third mistake is conflating read consistency with metadata consistency; the consistency parameter governs point data, while collection config and topology are governed by Raft. Version note: the ReadConsistency types and the write_ordering enum values have changed across releases, and the exact defaults differ. Always set them explicitly on paths where the behavior matters.

javascript

Version-dependent: the ReadConsistencyType enum and WriteOrdering enum, and their exact values, have changed across Qdrant releases. In some versions the read consistency is expressed as an integer number of replicas rather than a named level; in others it is a named enum. The write_consistency_factor is a collection-level setting, but it can also be overridden per request in some versions. Verify the API and the defaults on your version, and if you are relying on consistency for correctness, test the specific failure scenarios (replica lag, replica down, primary failover) rather than trusting the documentation alone.

Difficulty: 8/10
Topics: Consistency, Replication, Distributed Architecture

Scenario Questions

0-2 years experience
  1. 1

    You upsert a point with wait=False and immediately search with consistency=one. Explain why the search might not return the new point.

  2. 2

    A teammate wants to set consistency=all on every query to be safe. Explain the availability cost of that choice.

2-5 years experience
  1. 1

    You have a replication_factor=3 collection and one replica is consistently slow. Explain how consistency=majority and consistency=all behave differently for reads and writes in this situation.

  2. 2

    You need to guarantee that a user who just saved a document can immediately search for it. Walk through the write and read consistency settings you would use and the latency cost.

5-8 years experience
  1. 1

    Design a consistency strategy for a system with three endpoints: a search-as-you-type endpoint, a user document list, and an admin audit query. Specify the write and read consistency for each and justify the choices.

  2. 2

    Your cluster has cross-region replicas with 50ms inter-region latency. Explain how consistency levels interact with this topology and what you would set for each region's traffic.

8+ years experience
  1. 1

    Derive the availability and latency of a Qdrant collection as a function of replication factor, consistency level, and per-replica failure rate. Identify the configuration that maximizes availability for a given freshness requirement.

  2. 2

    You must support a 'read your writes' guarantee across a multi-region deployment with a 100ms p99. Describe the design, including how you would handle a region failover without violating the guarantee.

Follow-up Questions

  • How would you design a read-your-write guarantee for a user-facing feature without setting consistency=all, which is fragile under replica failure?
  • What happens to write latency as you increase write_consistency_factor from 1 to majority to all, and how would you measure the trade-off on a real cluster?