When Qdrant user-defined sharding with shard keys fits your data
Custom sharding fits a team whose data is already split by tenant, region or time range and who want rows from the same group kept together on the same shards. Qdrant's user-defined sharding, available since v1.7.0, lets you route each point to a shard key you choose, so a query scoped to one key touches only the shards holding that key. The mode is switched on with sharding_method set to custom when the collection is created, and it cannot be chosen later for an existing collection, so the decision belongs in the design phase. Teams that keep the default automatic sharding get shards spread evenly by Qdrant without any routing work on their side.
Default automatic sharding is usually enough when your data has no natural partition that queries respect, when every search spans the whole collection, or when you have no compliance or noisy-neighbor reason to isolate groups. It is also the simpler path to operate, because you have one shard layout to reason about and no per-key placement to monitor. Custom sharding earns its extra complexity when a large share of queries filter on one key, when you must place a group's data on specific nodes or in a specific location, or when you need to add or remove a whole group without touching the rest of the collection. Confirm these needs with your own query logs before you commit.
Before you choose, ask your engineers to list the key values you expect and how many distinct values will exist over time, and to check that every query can name its key. Custom sharding multiplies physical shards, so a high number of keys can produce more shard files and overhead than your hardware can hold comfortably. Review the official Qdrant distributed deployment documentation for the current behavior of custom sharding in your target version, and test the layout on a non-production cluster that mirrors your real key distribution.
Sharding options and when each one fits
This table compares default automatic sharding with custom sharding by tenant, region and time range, showing the routing benefit, the effect on physical shard count and the main risk of each. Read each row against your data layout, and use the shard-count row to check how many physical shards your key plan creates before you create the collection.
| Option | Routing benefit | Shard-count effect | Main risk |
|---|---|---|---|
| Default automatic sharding | Points spread across shards by Qdrant without a routing key, so no key choice is needed | Total physical shards follow the shard number and replication factor only | Every query may touch all shards, and tenant or region data cannot be isolated by placement |
| Custom sharding by tenant | Each tenant's points land in shards for that key, so a tenant query can target its own shards | Shard number applies per key, so physical shards multiply with the number of tenant keys | Many small keys create many small shards, and point ID uniqueness holds only within each key |
| Custom sharding by region | Regional data stays grouped, which helps when placement or locality rules apply to a region | Physical shards grow with the number of region keys, usually a small and stable count | Uneven region sizes create hot shards, and a key used for queries must be set on every request |
| Custom sharding by time range | Recent data can sit in its own shards, and old shards can be targeted or retired by key | Physical shards grow with each new time key, so the count rises over time | New keys must be created on schedule, and old keys can accumulate unless you plan their removal |
Choosing low-cardinality shard keys without exploding shard counts
Shard keys decide how many physical shards a collection creates, so the number of distinct key values matters as much as the key itself. The cards below cover the decisions that keep that number manageable as tenants, regions and time ranges grow.
Avoid one key per user
A key per user is the most common high-cardinality mistake. Each key gets its own set of shards, so a few thousand users can turn one collection into thousands of shard groups, each with its own overhead on every node. Group users into tenants or cohorts before you create keys, and confirm the expected user count against the shard math before the first collection is built.
- User-defined sharding since
- v1.7.0
Count the physical shards first
Total physical shards equal shard_number multiplied by the number of keys and by the replication factor. Before you pick a key scheme, multiply the planned key count by shard_number and by the replication factor, then check that the result fits the RAM, disk and file handle budget of your nodes. Treat that number as the ceiling for the design, not as a detail to fix later.
Group tenants into bounded buckets
When tenants vary widely in size, map them to a fixed set of keys, such as a hash bucket or a customer tier, rather than one key each. Choose a bucket count that stays stable as the customer base grows. Document the mapping function, since moving a tenant to a different key later means re-ingesting its points.
Use time buckets with a fixed window
For time-based data, a key per month or per quarter keeps the key count predictable, and old keys can be retired once their retention window ends. A key per day or per hour multiplies shards quickly. Confirm how long data must stay searchable and how many keys that window implies before you pick the granularity.
Watch key growth after launch
Key counts rarely stay flat. Track how many keys each collection holds, how many are created per month and how many are retired. Set an alert before the count crosses the level your sizing supports, and decide in advance who approves new keys. A key creation process prevents the slow drift that makes a design expensive to unwind.
Keep point ID rules across keys
Point ID uniqueness is enforced only within a key, so the same ID can exist under two different keys. Decide whether IDs must be globally unique in your data model, for example by prefixing with the tenant identifier, and enforce that rule in the ingestion code. Otherwise a lookup by ID may return the wrong record when keys are not specified.
Point ID uniqueness rules across shard keys
Point ID uniqueness in a Qdrant collection with user-defined sharding is enforced only within a shard key. The same point ID can exist under two different keys, each as a separate point with its own vector and payload. For a team that has always treated the ID as a global identifier, this is the rule most likely to cause silent data problems, so it should be settled before the first upsert. An upsert for ID 42 under the key tenant_a does not touch a point with ID 42 under tenant_b, and a delete or payload update must also name the key it targets.
Plan the ID strategy before loading data. If your source system already issues globally unique IDs, such as UUIDs generated at ingestion, use them and keep the shard key separate from the ID. If IDs are per-tenant sequences, a point ID that looks unique in your database can collide across tenants once it lands in Qdrant, so either make IDs globally unique in the application or include the key in the ID. Also confirm with your client SDK version how it passes the shard key on upserts, updates, deletes, retrieves and searches, because a request that omits the key may not hit the point you expect.
Where your application needs to find a point without knowing its key, keep the shard key as a field in the payload or in an application mapping table from global identifier to shard key and point ID. A payload field is simpler to audit and survives reindexing, while a mapping table avoids storing the key in vectors that may be exported. Either way, test the cross-key lookup path, including deletes for erasure requests, because a point removed under the wrong key leaves its counterpart intact. Confirm the exact behavior for your Qdrant version in the Qdrant distributed deployment documentation before you design the data model.
How to set up custom sharding on a self-hosted cluster
This sequence takes a self-hosted Qdrant cluster from a sharding plan to a collection where each shard key holds its own points, with a check after every step so the layout is confirmed before real data arrives.
Plan keys and shard counts
The platform or data team lists the shard keys the collection needs, such as tenant, region or month, and estimates how many keys will exist at launch and as the business grows. Set shard_number as the shards per key, then multiply it by the number of keys and the replication factor to get the total physical shards. Check that shard_number is a multiple of the node count, as the distributed deployment docs recommend, and that each key has a low cardinality so the total shard count stays manageable. Done when the team has a written table of keys, shard_number, replication factor and expected physical shard total, reviewed against the node count.
Confirm the cluster and storage prerequisites
The operator confirms that the cluster has at least three nodes for production, that every node runs on block storage with a POSIX-compatible file system rather than NFS or S3, and that the nodes are reachable on the expected REST and gRPC ports. Confirm the Qdrant version you run supports user-defined sharding, which is available since v1.7.0. Check the cluster health endpoint on each node and confirm that all peers appear in the cluster state before creating any collection. Done when every peer reports healthy and the version and storage checks are recorded.
Create the collection with custom sharding
Create the collection with sharding_method set to custom, along with the chosen shard_number and replication factor. The platform engineer sends this request through the REST API or a client SDK, and the exact parameter names and call shape must be confirmed against the distributed deployment docs for your Qdrant version before running it in any environment. Because the sharding method is set at creation, plan to create the collection once with the final values. Done when the collection info response shows the custom sharding method and the expected shard_number and replication factor.
Create each shard key
For each planned key, the operator creates a shard key on the collection using the key creation call in the distributed deployment docs. Each key triggers creation of shard_number physical shards per replica, so create keys in a controlled batch and watch cluster load while they initialize. Keep a record of every key name so later loads and queries reference the same values. Done when the collection info lists every expected key and the shard count for each key matches the plan from step one.
Load points with the shard key specified
The application or migration job writes each point with its shard key included in the request, so the point lands in the shard group for that key. Use a small test batch first, with a point for each key, and include the point ID. Remember that point ID uniqueness is enforced only within a key, so the same ID can exist under two different keys. Done when the test batch writes without errors and a point retrieved with its key returns the expected payload.
Verify shard distribution and counts per key
Run count requests scoped to each shard key and compare the results with the number of points loaded for that key from the source system. Check that the shards for each key are spread across nodes, using the cluster or collection info output, and that every replica reports an active state. Confirm that a search filtered by one key returns only that key's points. Done when per-key counts match the source, every shard is active on its assigned nodes, and key-scoped searches return only the expected data.
Record the layout and monitor growth
The operator saves the final layout, including the keys, shard_number, replication factor, node placement and the physical shard total, to the operations runbook. Set a recurring check that compares the number of keys and per-key point volume against the plan, so the team notices when new keys push the physical shard count past what the nodes handle comfortably. Done when the runbook entry is reviewed by the platform owner and the monitoring check is in place.
Security and isolation considerations for shard keys
Shard keys decide where points are stored, not who can read them. The cards below cover the controls that must sit around shard keys in a self-hosted cluster: access, placement, deletion and network exposure.
Shard keys do not enforce access
A shard key routes points to a set of shards, but any client with permission on the collection can still query points under any key. Per-tenant isolation therefore needs JWT access control scoped to the collection, or payload-level filters enforced by your application layer. Check that tenant applications never receive a key or token broader than their own data. Treat a missing filter as a data exposure, not a routing error.
Qdrant security docsConfirm data location before choosing regions
Using a region as a shard key controls placement inside your cluster, but it does not by itself state where each node physically runs. Confirm with your architects which data centers or cloud regions host each node, and whether any tenant's data may leave a given jurisdiction. Snapshots and backups can copy data to other locations, so their storage targets belong in the same review.
Plan deletion of a key and its data
Deleting a shard key removes its shards and points, but backups, snapshots and replicas made before deletion still hold the data. Write a procedure that covers each copy, records when deletion completed, and confirms the result by querying the key afterward. Ask your compliance team which retention period applies before any erasure request is accepted.
Secure cluster ports with TLS
Self-deployed Qdrant listens on all network interfaces and has no authentication by default, so every node port is reachable unless you restrict it. Keep the internal cluster port on a private network, enable TLS for REST and gRPC, and apply firewall rules between nodes. Replication and shard transfers move full point data between nodes, so unencrypted peer traffic exposes every tenant's vectors and payloads.
Qdrant security docsLog every authenticated tenant operation
Audit logging records authenticated API operations, so you can tie a write or delete to the credential that made it. Confirm that logs capture the shard key used in each request, because the key is what identifies a tenant's data in your cluster. Store logs outside the Qdrant nodes and set retention with your compliance team before go-live.
Keep key values out of client-visible identifiers
Shard key values often mirror customer names, account numbers or regions. Those values can appear in request logs, error messages and monitoring labels that broader staff can read. Use opaque identifiers where your data classification requires it, and review what metrics and dashboards expose. Map opaque keys to tenants in a controlled system that your access model governs.
How a shard key routes points to shards
The write starts at a client that sends points with a shard key to the Qdrant cluster. The cluster uses the key to pick the shards that belong to that key, not the whole collection, and writes each point to the replicas of those shards on the nodes that hold them. Raft-managed cluster state records which shards exist for each key and where their replicas live, so every node routes the same way. Before go-live, confirm that each key's shards land on nodes you expect and that point IDs are unique within each key, since uniqueness is enforced per key.
Routing of one keyed write across shards, replicas and cluster state.
Limits to confirm before you rely on shard keys
Custom sharding changes how points are placed and how many physical shards a collection creates, so several behaviors need confirming before a design depends on them. The cards below cover the version floor, the deployment path, key lifecycle, and how a layout changes later on a self-hosted cluster.
Confirm the Qdrant version
User-defined sharding with sharding_method set to custom is available since v1.7.0, so every node in the cluster must run that release or later. Check the running version on each node, not only the version in your deployment manifest, because a rolling upgrade can leave nodes on different releases. Also confirm that your client SDK supports the shard key parameters you plan to call.
Check the Helm or operator path
The community Helm chart is one of the documented production paths, but it lacks enterprise features such as zero-downtime upgrades and automatic shard rebalancing. Confirm that the path you choose can create collections with custom sharding, can keep shard placement balanced by hand, and can handle the rolling restarts your upgrade plan needs. Ask whether the enterprise operator in Qdrant Private Cloud changes any of these behaviors before you commit.
Verify that keys cannot change later
Confirm with the Qdrant documentation for your version whether an existing collection can have its shard key set, altered or removed after creation. Plan for the worst case: a key chosen for tenants or regions may need a new collection and a data copy if the model changes. Write down which fields can serve as keys, because the choice shapes every query and access rule built on top.
Plan the physical shard count
The total number of physical shards equals shard_number multiplied by the number of keys and by the replication factor. A key set that grows, such as one key per customer, multiplies the shard count and the memory and disk overhead of every node. Estimate the key count at your planned growth point, then confirm the resulting shard total against your node count and storage headroom before you create the collection.
Test how resharding works on self-hosted clusters
Confirm how your version changes shard count for a self-hosted collection, since resharding is documented for Qdrant Cloud and self-hosted teams generally need a different path. The usual approach builds a new collection, copies data with the migration tool or snapshots, and switches an alias. Confirm the disk headroom the copy needs and whether writes can continue during the copy and cutover.
Confirm point ID rules across keys
Point ID uniqueness is enforced only within a single shard key, so the same ID can exist under two different keys. Confirm that your application never relies on a global ID lookup, and that any join or deduplication logic includes the key in its identity. Test an upsert and a delete under two keys with the same ID before you build write paths that depend on the behavior.
Distributed deployment docsQuestions teams ask before setting up custom sharding
What drives the effort of a custom sharding design?
The effort is set mostly by how many shard keys the design needs and how well those keys are understood before any collection is created. Each key adds a group of physical shards, so the number of tenants, regions or time ranges, and how often new keys appear, shape the work. Teams also need to decide how points are identified across keys, how queries target a key, and how existing data will be routed. A design with a small, stable set of keys and clear query patterns is far smaller than one where keys are created per customer at runtime. Ask any partner to show how the key list, growth rate and query paths feed the design before it is priced.
Can an internal team set up Qdrant custom sharding on its own?
Often yes, if the team already runs Qdrant in production and has someone who can read the distributed deployment documentation closely. The core mechanism is a configuration choice at collection creation, but the consequences reach into client code, backup routines, monitoring and capacity planning. Teams without prior Qdrant cluster experience usually benefit from an outside review of the key model before go-live. Be honest about who will carry the design after the work ends, because shard layout decisions must be revisited as keys grow.
What inputs does the design need from our team?
A design needs a key inventory, growth forecasts and the planned node count. The key inventory lists every tenant, region or time range that will become a shard key, with an estimate of how many points each holds and how long it stays active. Growth forecasts show how many new keys appear per month and how large they get. The node count and replication factor determine how physical shards land on hardware. Also gather the query patterns, since searches that target one key behave differently from searches across all keys, and the retention rules that decide when old keys are deleted.
How do extra shards show up in disk and RAM?
Each physical shard holds its own storage and index structures, so more shards mean more overhead even when the data volume stays the same. The documented formula is that total physical shards equal shard_number times the number of keys times the replication factor, so adding keys multiplies the shard count quickly. Each shard carries fixed costs for files, segments and indexes, and small shards waste memory relative to the data they hold. Replication also doubles storage at a replication factor of 2, which applies to every shard. Ask for a sizing calculation that shows disk and RAM at the planned key count and at the forecast maximum, not only at launch.
Why do high-cardinality shard keys cause trouble?
Keys with very many distinct values, such as one key per user, create very many physical shards, and that overhead grows with every key. The documented formula multiplies shard_number by each key and by the replication factor, so a key space in the thousands can outrun the memory and disk the cluster was sized for. Low-cardinality keys, such as a fixed set of regions or a bounded set of time windows, keep the shard count predictable. When a tenant model is required, consider grouping tenants into a bounded number of keys and filtering by payload within them. Confirm the expected maximum number of keys before any design is approved.
Do point IDs need to be unique across shard keys?
No, point ID uniqueness is enforced only within a shard key, so the same ID can exist under two different keys. This matters for client code that assumes a global ID space, such as deduplication or update logic that addresses points by ID alone. Applications must send the shard key with every write and read that targets a specific point, or they risk reading or overwriting the wrong record. Teams migrating existing data should check for ID collisions across the keys they plan to use. Test this behavior in a staging cluster before relying on it in production.
How long does a sharding design review usually take?
The timeline depends on the size of the key inventory, the number of collections affected and how many open questions remain about growth, retention and client code. No duration is set here because none has been researched for this work, so ask any partner for a timeline tied to a written scope. A review goes faster when the key inventory, growth forecast and query patterns are ready before the first meeting. Delays usually come from unresolved decisions about key cardinality or from clients that still assume a single global ID space.
How DeployOpen scopes and delivers Qdrant sharding work
DeployOpen plans and implements self-hosted Qdrant inside your own infrastructure, so shard key design is settled in writing before any collection is created. We agree the tenant, region or time-range key model, the physical shard count it creates, and the verification steps before work starts.
How we scope
- We map which tenants, regions or time ranges become shard keys and confirm each key is low-cardinality.
- We calculate the physical shard count from shard_number, the number of keys and the replication factor, and agree it in writing.
- Engagements are fixed-scope, with deliverables, environments and timelines agreed in writing before work starts.
How we build
- We create the collection with sharding_method set to custom and add shard keys through the agreed routing model.
- We define point ID rules so uniqueness is enforced correctly within each key and duplicate IDs across keys are handled.
- We test write routing, search filters and per-key behavior on a non-production cluster before any client traffic is moved.
How we hand over
- We document the shard key map, shard count, key creation procedure and the reasoning behind each decision.
- We provide runbooks for adding keys, checking shard distribution and handling a key that grows beyond planned capacity.
- We walk your platform and security teams through the configuration so they can review it against their own controls.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- We can review shard layout as tenants or regions are added and recommend changes before capacity problems appear.
- Retainer scope, response expectations and review cadence are confirmed in writing alongside the quote for your environment.

