Hacker News new | ask | show | jobs
by drdexebtjl 16 days ago
> We want 99% of what we do to be single shard, but occasionally cross-shard work is unavoidable.

Why optimize for the 1% and put the logic in a database proxy, then? It’s a leaky abstraction.

Require the application to explicitly and loudly make a query for each shard and collate the results.

1 comments

Exactly. sharding is for scaling usecase where queries can be handled within a shard(co-partitioning). If sharding strategy can assign keys from two tables where join is needed you can get achieve same performance.

In another usecase where joins are not needed realtime, you can build another system where results are precomputed and cached. I consider sharding as methodology for scaling instead of onefit all solution. Overall it depends on usecase and sound sharding strategy for performance.