Live data from Hacker News

The PlanetScale serverless driver for JavaScript

planetscale.com

41–50 of 56 posts

Re: The PlanetScale serverless driver for JavaScript

#42

Very cool and lightweight way to talk to PlanetScale but for now I'll stick with Prisma. Prisma is much heavier (engine weighs in at ~50MB) and that can be a non-starter for serverless in some cases but it works for me on AWS Lambda. The nice thing about PlanetScale is you get nearly unlimited connections (soft limit of like 250K IIRC) so making 1 connection per active lambda isn't a problem at all. I've been using P…

We didn't talk much about this yet, but the underlying tech for this will help you within Lambda too reduce latency even over normal MySQL. This specifically is targeting environments where a MySQL client isn't able to run.

Is the HTTP API technically a wrapper of the vtgate's grpc interface?

Re: The PlanetScale serverless driver for JavaScript

#43
post #12

This is great! Potentially the missing piece in the world of "serverless": a serverless SQL database accessible over HTTP with no minimum price. I saw AWS Aurora has a Data API but currently that does have a minimum monthly cost. Fauna is possibly the closest, but that appears to involve translating SQL to its FQL. How stable is the beta?

It's 90% there... but not allowing foreign keys [1] (=cascading delete) means that this solution becomes equal with DynamoDB (Serverless + Scale to 0 as well) because products will either be built for it from day one or never support it with a full fledged DB server instance that is 100% up in mind. Unfortunately, didn't find a lot in-between. [1] https://planetscale.com/docs/learn/operating-without-foreign...

I like foreign key constraints as much as the next guy, but they are hardly the only difference between MySQL and DynamoDB. For example, you should be able to use Rails/Django/Laravel without foreign key constraints, you can use off the shelf SQL clients or BI clients, etc.

Re: The PlanetScale serverless driver for JavaScript

#44

Earlier quoted context omitted.

We didn't talk much about this yet, but the underlying tech for this will help you within Lambda too reduce latency even over normal MySQL. This specifically is targeting environments where a MySQL client isn't able to run.

Is the HTTP API technically a wrapper of the vtgate's grpc interface?

It's a good chunk of it, but is a lot more suitable for public consumption.

Re: The PlanetScale serverless driver for JavaScript

#45

While this is cool tech and convenient, I worry about run-away costs and what happens if the company goes down? Seems like a LOT of risk.

> what happens if the company goes down?

It's open-source. What's your concern now?

https://github.com/planetscale/database-js

Re: The PlanetScale serverless driver for JavaScript

#47
post #6

Curious what the performance impact is of replacing TCP with HTTP for this kind of thing

Great question! Author of a lot of the infrastructure surrounding this here. I plan on following up with a more technical deep dive on some of these aspects, but it's quite a bit hard to do a 1:1 comparison. While, obviously, HTTP also uses TCP, I'm going to assume you're asking more about the binary MySQL protocol vs HTTP. On the surface, yes, HTTP is going to have more overhead with headers and the other aspects th…

That's a stretch goal I can get behind... wish I had a nice excuse to use QUIC :(

Re: The PlanetScale serverless driver for JavaScript

#49

Please forgive my ignorance. Is it right if I say the password seems to be available on the client side? import { connect } from '@planetscale/database' const config = { host: ' ', username: ' ', password: ' ' } https://github.com/planetscale/database-js

Correct. I would not recommend doing that. This is analogous to a database driver. It's raw access to the database.

Re: The PlanetScale serverless driver for JavaScript

#50

Please forgive my ignorance. Is it right if I say the password seems to be available on the client side? import { connect } from '@planetscale/database' const config = { host: ' ', username: ' ', password: ' ' } https://github.com/planetscale/database-js

They say in the post to use environment variables when deploying. I think they’re talking about server-side JS, not JS running in an end-user’s browser.
Post reply on HN