Hugo Hacker News

Building PlanetScale with PlanetScale

leerob 2021-08-18 19:24:42 +0000 UTC [ - ]

I've been a fan of PlanetScale and recently was able to chat[1] with their Head of Eng. Great team, better product execution. Also moved my personal site from using Firebase/Redis to just MySQL with PlanetScale[2] and the results have been solid. Averaging 128ms on function response times with a p95 of 250ms.

[1]: https://www.youtube.com/watch?v=YqBG5rFP4Ic

[2]: https://github.com/leerob/leerob.io/pull/326

chris_st 2021-08-18 16:43:02 +0000 UTC [ - ]

I've been building a small personal app with PlanetScale and I like it a lot. Their way of doing schema branching works well, and is easy to use (though slightly tedious), and makes a lot of sense. Not affiliated with them in any way, just a pleased customer.

ublaze 2021-08-18 16:47:15 +0000 UTC [ - ]

I've been following PlanetScale for a few years and interviewed their CTO Sugu last week: https://www.softwareatscale.dev/p/software-at-scale-29-sugu-..., if anyone's interested to hear their story of building Vitess for YouTube and some details on PlanetScale behind the scenes.

sorenbs 2021-08-18 20:35:13 +0000 UTC [ - ]

PlanetScale is the serverless relational database we have been waiting for all this time. It's truly excellent, and being based on the same tech that runs youtube, we know it will scale well.

js4ever 2021-08-18 18:31:09 +0000 UTC [ - ]

I noticed they just launched in aws eu-west-1 (Dublin, Ireland). There is now a new option to select the location when you create a new db. Yay it's now usable in Europe!

dyeje 2021-08-18 17:20:30 +0000 UTC [ - ]

Personally, migrations have never been painful enough to warrant this sort of product. The idea of branching databases on the other hand is really cool. Is each branch a full copy? Seems like that would lead to huge storage needs for larger databases.

k__ 2021-08-18 17:22:33 +0000 UTC [ - ]

I had the impression they PS was interesting because they offer serverless SQL.

aseipp 2021-08-18 17:50:57 +0000 UTC [ - ]

I've been PlanetScale for a test drive recently, and it's a bit of both. I also think they kind of go hand-in-hand: if you have "serverless" things (or just Docker), they can come and go with connections very quickly, so picking the correct "pause time" to take the DB down for an ALTER TABLE is possible but a tiny bit awkward. Online migrations mean you never take it down and it's always available so that's kind of moot.

But now you do have some other considerations (see below.) I don't think it's an absolute pancea, but it's certainly a very interesting and very useful secondary point in the design space. I like PlanetScale a lot. The free tier is also actually useful I think.

To be clear even if it's is "serverless SQL" you still have to design with the fact you're using Vitess in mind. So you have no foreign keys, scalability is done by keyspace sharding (not currently available in PlanetScale), apps deal with online migration where the schema evolves as they access it, etc. You have to keep these things in mind but you get some benefits in return, like most things.

pier25 2021-08-18 21:14:55 +0000 UTC [ - ]

> So you have no foreign keys

What other differences are there vs MySQL in terms of data modeling?

tenaciousDaniel 2021-08-18 17:42:31 +0000 UTC [ - ]

Interesting, I'd be fascinated to hear what tech you use, because I've always had a really hard time with migrations.

dyeje 2021-08-18 18:00:22 +0000 UTC [ - ]

Any migration scheme with a timestamp based approach is going to work well (e.g. ActiveRecord, TypeORM).

joshmarlow 2021-08-18 17:50:59 +0000 UTC [ - ]

The database branching idea seems to be popping up more and more. IIRC, TermniusDB supports it too - https://terminusdb.com/

I've not played with PlanetScale yet, but I am planning on playing with TerminusDB in the near future.

MapleWalnut 2021-08-18 17:51:51 +0000 UTC [ - ]

From what I understand, they only branch the schema. They don't copy the data.

rmah 2021-08-18 20:11:08 +0000 UTC [ - ]

This looks quite compelling, but what about use cases where "serverless" is simply not viable. In some industries, you must control access to the server in order to stay compliant with regulations. At least for some of the data. Is there a plan to have a software-only release? Or did I just miss it.

samlambert 2021-08-18 23:19:43 +0000 UTC [ - ]

We won't be doing software only releases or on prem software for PlanetScale. We do have an option to provision into your own cloud account so that the data lives inside your environment and you get all the PlanetScale magic.

dang 2021-08-18 19:57:05 +0000 UTC [ - ]

Previous related thread:

PlanetScale – Database for Developers - https://news.ycombinator.com/item?id=27197873 - May 2021 (128 comments)

TeeWEE 2021-08-18 17:17:28 +0000 UTC [ - ]

At Tiqets we have a different repo with SQL migrations using Flyway... ITs as simply as branching that repo, creating your migration. Getting the pipeline green and merging it back.

All migrations are automatically executed on production, pre-tested. Reviewed. No DB Administrator, No deployment together with the app.

It works quite well..

However, personally I really like not having to deal with schema changes. For example Firebase or Cloud DataStore is really nice... Its the best for developers, but not for data integrity.

nijave 2021-08-19 02:08:56 +0000 UTC [ - ]

This works fine for a lot of cases, but you can run into issues on larger databases. Things like default or calculated columns and indexes can seem like innocuous SQL but end up being incredibly expensive and even acquire locks that block other transactions on bigger databases.

We have some "medium sized" Postgres databases around 1-10TB and something like adding an index to a big table (100s millions of rows) can be quite expensive resource wise

(I'd say "big" is something like 20-50TB+ and small <1TB)

wizwit999 2021-08-19 00:14:41 +0000 UTC [ - ]

So is this product about the actual DB or the devex/ interface. Seems the real insight is in the latter. But the implementation is likely tied to MySQL. Would be cool to use with database of your choice, including existing managed dbs.

zinclozenge 2021-08-18 20:35:20 +0000 UTC [ - ]

So you create a TCP connection to your database over the public internet? Does it have an http api like aurora serverless/fauna/datastax astra?