Cả hai đều chia nhỏ một table lớn, nhưng ở các cấp khác nhau. Partitioning chia một table ra nhiều file bên trong một MySQL server duy nhất. Sharding chia dữ liệu ra nhiều server độc lập. Partitioning giúp một table quá lớn cho một file; sharding giúp một workload quá lớn cho một máy.
Partitioning (một server)
events (
id , created_at DATETIME, payload JSON,
(id, created_at)
) ((created_at)) (
p2024 LESS THAN (),
p2025 LESS THAN (),
p2026 LESS THAN ()
);
