What is the difference between partitioning and sharding?
Partitioning splits a table within one database so the engine can skip irrelevant chunks; sharding splits data across separate databases so each holds a subset. Partitioning is a performance and maintenance tool, sharding is a scale tool with real cost — cross-shard queries and transactions become hard or impossible. Reaching for sharding before partitioning and indexing are exhausted is a common and expensive mistake.