Both split a big table, but at different levels. Partitioning splits one table across multiple files inside a single MySQL server. Sharding splits data across multiple independent servers. Partitioning helps a table that's too big for one file; sharding helps a workload too big for one machine.
Partitioning (one server)
events (
id , created_at DATETIME, payload JSON,
(id, created_at)
) ((created_at)) (
p2024 LESS THAN (),
p2025 LESS THAN (),
p2026 LESS THAN ()
);
