PlanetScale is a managed MySQL database that runs on Vitess - the open-source database tech that YouTube uses to keep their shit from falling over when millions of people upload cat videos simultaneously. It was started by engineers who got tired of being woken up at 3am because MySQL couldn't handle traffic spikes.
Core Technology: Vitess Architecture
The key thing is Vitess - Google's open-source solution for when MySQL needs to handle more traffic than a single server can manage. YouTube built this because their MySQL database was about to explode from all the video uploads. Instead of rewriting their entire app, they made MySQL pretend to be one giant database while actually running on hundreds of servers behind the scenes.
Here's how Vitess works under the hood:
VTGate (Query Router): This is the thing your app talks to. It looks like regular MySQL to your application, but behind the scenes it's figuring out which actual MySQL server has your data and sending queries there. If one server dies, VTGate just routes around it. I spent way too much time reading Vitess docs to understand this part.
VTTablet (MySQL Mediator): This sits in front of each MySQL instance and handles connection pooling. Regular MySQL hits the wall pretty fast with concurrent connections (default limit is 151, but you can crank it higher until your server runs out of memory). VTTablet can handle thousands because it actually reuses connections instead of creating new ones like an idiot.
MySQL Instances: Your actual data lives on regular MySQL servers. PlanetScale sets up one primary for writes and two replicas for reads. When the primary dies (and it will), one replica gets promoted automatically.
What PlanetScale Actually Does For You
PlanetScale handles the database operations that usually require a dedicated database admin. No more planning server capacity, managing backups, or applying security patches. You just use the database and they handle the infrastructure headaches.
The pricing is consumption-based, which is great when you're starting out (free tier is permanent, not like AWS's 12-month bait-and-switch), but can get expensive fast when you scale. Learned this the hard way when our analytics queries started costing us $200/month. More on that nightmare in the pricing section below.
Database Branching (The Killer Feature)
The best part of PlanetScale is database branching - think Git for your database schema. You can create a branch, fuck around with the schema, test it, then merge back to production without downtime.
This is huge because normally changing a database schema means:
- Schedule downtime at 2am
- Cross your fingers the migration works
- Get paged at 2:30am when something breaks
- Spend 3 hours rolling back
With PlanetScale, you just merge the branch and Vitess handles the migration behind the scenes. Been using this for about a year now - it's saved our team probably 20+ hours of coordination bullshit and late-night stress deployments.
Performance Reality Check
PlanetScale performs well because Vitess was battle-tested at YouTube scale. Will your app be faster? Probably. Will it be the fastest database ever? No.
The real performance benefit comes from not having your database fall over when traffic spikes. Instead of your MySQL server dying under load, Vitess spreads queries across multiple servers automatically. Your app stays up, customers stay happy, you don't get woken up at 3am by alerts.