What sharding changes
Each shard can be configured to have a different number of replicas.
Replicas can provide failover capacity in a multi-node profile and can offload read traffic from the primary. A shard configured with no replicas is not highly available.
Partitioning vs sharding
Postgres declarative partitioning splits a logical table into physical tables. In a typical Postgres deployment, it can improve performance and make data pruning cheaper. However, it does not remove a single-primary write bottleneck or let data exceed the capacity of one Postgres instance. Neki distributes a logical table across independent Postgres shards, each with its own primary, storage, and replication state.When sharding is the correct choice
Sharding becomes a good next step for scaling when one or more of these are true:- The primary is persistently limited by write throughput or disk IOPS.
- The working set of your relational data no longer fits within the RAM available on a single instance.
- Independent shards would reduce the amount of data affected by one primary failure.
- The workload has a stable routing key that keeps related data and common queries on one shard.
customer_id or company_id) often keeps each tenant’s rows together in the query workload.

