|
|
|
|
|
by ahachete
9 days ago
|
|
I have mentioned this before, but here it goes again: I'm really happy that there's more options for Postgres sharding and I applaud Pgdog and the team's efforts and energy. Having said that, this makes it a no-go for me: > shard_number = hash(data) % num_shards https://docs.pgdog.dev/features/sharding/basics/#terminology Most sharding solutions distribute the hash value over linear ranges, that then split across "virtual shards", that are then placed on the physical shards or worker. This allows for shard replacement when needed. For example, Citus works this way, and even adds convenience functions for shard migration (using logical migration) in an automated way. That's all I'd need. Operationally, it's worlds apart. With modulo distribution the only way to replace data is to reshard everything --something you don't want to do however fast the operation may be. |
|
Adding a sharding function in our architecture is relatively straightforward. We also support plugins which can control the flow (and direction) for queries, so our users can add their own (and they do!).