Cloudflare makes Hyperdrive MySQL support generally available
Hyperdrive, previously Postgres-only, now pools MySQL connections in production, after a beta that fixed 20 bugs including a caching flaw that returned empty query results about once in every 100,000 requests.
Cloudflare made MySQL support for Hyperdrive generally available on 14 October. Hyperdrive is its connection pooler for Workers, built to avoid the five network round trips a fresh SQL connection normally costs from the edge; until now it only worked with Postgres.
Getting there meant fixing 20 bugs found during the beta. One was a character encoding mismatch: MySQL’s “utf8” is actually a deprecated alias for the 3-byte utf8mb3, not full 4-byte UTF-8, so emoji in query results came back corrupted until Hyperdrive switched to requesting utf8mb4. The harder one was a caching bug: when a Client and Endpoint node shared a cache, each could store query results encoded with different connection capabilities, so a cache hit sometimes returned an empty response where Workers expected data, about 0.001% of the time. The fix was to always cache a canonical version of the result bytes rather than whichever node happened to write it. Cloudflare says the service now holds 99.99% connection success in production.
Why it matters: if you’re running Workers against a MySQL database, PlanetScale’s Vitess product included, you no longer need to build your own pooling layer or wait out a Postgres-only beta. That 0.001% failure rate sounds small, but at scale it is exactly the kind of bug that is nearly impossible to reproduce locally, which is presumably why it took a beta to surface.