Cloudflare's Hyperdrive, a service that connects Cloudflare Workers to SQL databases, now supports MySQL in general availability after the company fixed a rare bug. Cloudflare says the move from beta to general availability came down to about 20 bug fixes, following a beta announced last year.
Hyperdrive keeps database connections open on Cloudflare's global network and shares them across many Worker requests. Opening a new SQL connection takes at least five network round trips, which adds delay on a serverless platform. Hyperdrive can also cache common queries to reduce latency and load on the origin database. It initially supported only Postgres.
Cloudflare says some beta problems were simple. Emojis written to the database came back wrong because Hyperdrive negotiated utf8, an alias that covers only up to three bytes per character. Switching to utf8mb4 fixed it. A later cleanup command reset connections to the server default encoding, so Hyperdrive now sets utf8mb4 again after every reset.
The hardest problem surfaced when Cloudflare's highest-volume MySQL beta customer reported a small but consistent rate of empty query responses where data was always expected. Engineers combed telemetry, raised the trace rate for that Hyperdrive instance, and searched for network issues as they investigated.
Source: Inside Hyperdrive: How we solved a rare Hyperdrive MySQL caching bug | Cloudflare Blog.