Temporal workflows at scale: Part 2 — Sharding in production
Dec 14, 2022Savannah Longoria

Summary
This post details how PlanetScale leverages Vitess for horizontal sharding of MySQL databases to achieve massive scalability, explaining the roles of VTGate, VSchema, and VTTablet. It provides a concrete example of configuring vSchema for a Temporal workload, demonstrating how to shard tables based on `shard_id` or `range_hash` using the `xxhash` Vindex and the `MoveTables` process for seamless traffic migration. The post highlights the importance of setting the History Shard Count in Temporal and showcases the performance benefits of this sharding strategy through production QPS and IOPS graphs during peak periods.