Design data placement before adding shards
For sharded data, choose shard keys from queries and transactions your application relies on. Prefer keys that:- Distribute data and writes evenly.
- Appear in the predicates of latency-sensitive queries.
- Keep rows that are joined or updated together in the same shard group.
- Remain stable for the lifetime of a row.
- Reference tables duplicate a small shared dataset across shards so joins to sharded data remain local.
- GSIs map another lookup key to the owner row’s shard key.
COPY FROM does not maintain GSI lookup rows for a sharded owner table. Keep
the GSI disabled while copying, then backfill, verify, and enable it through the
same activation process.
Once application data is placed across shards, leave the authoritative shard group as a separate shard.
Size it for metadata, catalog work, sequence reservations, and remaining unsharded tables.
Keep transactions on one shard when possible
Neki can route a transaction to more than one shard, but cross-shard transactions do not provide atomic commit across all shards. Include the shard key in transactional queries and verify the query plan before depending on multi-statement behavior. See Transactions across shards.Watch for scatter queries
A query without enough routing information can run on every shard. UseEXPLAIN and Query Insights to look for an unexpected number of shard calls, then add a routing predicate or revisit the topology.

