Live data from Hacker News

The PlanetScale serverless driver for JavaScript

planetscale.com

31–40 of 56 posts

Re: The PlanetScale serverless driver for JavaScript

#31

Earlier quoted context omitted.

> This specifically is targeting environments where a MySQL client isn't able to run. Oh, absolutely and I didn't mean to imply it wasn't useful, I was just saying I went down the Prisma path and will be sticking with that. Even so I'm glad this exists for times that I don't need the full weight/power of Prisma but do want to talk to a PlanetScale DB.

I went down the Prisma path investigating JavaScript ORMs, and... I have opinions. :) I feel that what we have would be useful within a Prisma context, but given their complexity and how Prisma works, it's likely not very practical with their "engine".

That’s fair. They are the only game in town, last I checked, that has full (good) TypeScript support which is a must-have for me. TypeORM is the other I know about and I’ve used it as well but I greatly prefer Prisma.

Other than having to bundle the engine I’ve been very happy with Prisma + PlanetScale. I’m open to any other TypeScript ORMs if you know of them.

Re: The PlanetScale serverless driver for JavaScript

#33

Earlier quoted context omitted.

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…

There are, in my opinion, a few other concrete benefits outside of performance too that I didn't touch on. I plan on touching on them more in my follow up blog post though. A lot of this for me/us at this point is still theoretical since we don't have tons of application yet. Serverless was an easy first target since they require HTTP as the transport. The real experiments will come when we say, put together a Python…

Do you think, if this becomes the norm, that we could start seeing no-backend apps (thick client talking directly to DB)? Maybe with the occasional light worker/lambda

Re: The PlanetScale serverless driver for JavaScript

#34

Earlier quoted context omitted.

There are, in my opinion, a few other concrete benefits outside of performance too that I didn't touch on. I plan on touching on them more in my follow up blog post though. A lot of this for me/us at this point is still theoretical since we don't have tons of application yet. Serverless was an easy first target since they require HTTP as the transport. The real experiments will come when we say, put together a Python…

Do you think, if this becomes the norm, that we could start seeing no-backend apps (thick client talking directly to DB)? Maybe with the occasional light worker/lambda

I'm going to use a big notice here: None of this is inherently safe to use as a client. This is similar security profile as a database driver. This API has no row level auth or anything like that. Unless this is explicitly what your product is doing, like within PlanetScale, this is what powers our Console, don't use this in a browser.

With that said, I personally have no real opinions on this topic. It's pretty far out of my wheelhouse. I think that's more something like Firebase and gang, but that's not something we're gunning for at the moment and aren't trying to replace that.

Re: The PlanetScale serverless driver for JavaScript

#35

Earlier quoted context omitted.

I went down the Prisma path investigating JavaScript ORMs, and... I have opinions. :) I feel that what we have would be useful within a Prisma context, but given their complexity and how Prisma works, it's likely not very practical with their "engine".

That’s fair. They are the only game in town, last I checked, that has full (good) TypeScript support which is a must-have for me. TypeORM is the other I know about and I’ve used it as well but I greatly prefer Prisma. Other than having to bundle the engine I’ve been very happy with Prisma + PlanetScale. I’m open to any other TypeScript ORMs if you know of them.

I would not consider myself a member of the JavaScript or TypeScript communities. I just build the infrastructure and platforms to support these kinds of things. :)

Re: The PlanetScale serverless driver for JavaScript

#36

Has anyone tested edge functions + planetscale (or similar) vs edge functions + a database read replica also located at the edge? It seems like you lose most of the benefit of your code running at the edge if your database is still in an AWS region.

To my knowledge you can use planetscale’s read replicas in different regions which the user is then routed to the closest one? I was going to use fly.io until I realized PlanetScale does this already - or do you mean writes as well?

https://planetscale.com/docs/concepts/read-only-regions

Re: The PlanetScale serverless driver for JavaScript

#37

Earlier quoted context omitted.

I mean I'm using PlanetScale with Prisma ORM on AWS Lambda right now without issue. Unlike many DB providers, PlanetScale supports nearly unlimited connections. I think I saw in their docs they have a soft-limit of something like 250K connections. I used Aurora Data API before moving off Aurora Serverless (insane pricing) to Prisma and PlanetScale, I don't think I'd go back to the HTTP API as Prisma works very well a…

I agree about Aurora Serverless pricing! Yeah, I think this new thing would be less useful for Lambda as that does support TCP connections. However a HTTP API is required for e.g Cloudflare Workers where you can't create a normal MySQL client. I think that's where this could shine.

We are hearing from some users that the performance with Lambda is really good with the new driver. We are going to do some comparisons soon to see if there is more worth sharing on it too. We are going to do a Twitch stream adding it to a Lambda on Tuesday at 11am CT if you are interested. https://www.twitch.tv/planetscale

Re: The PlanetScale serverless driver for JavaScript

#38

Earlier quoted context omitted.

I went down the Prisma path investigating JavaScript ORMs, and... I have opinions. :) I feel that what we have would be useful within a Prisma context, but given their complexity and how Prisma works, it's likely not very practical with their "engine".

That’s fair. They are the only game in town, last I checked, that has full (good) TypeScript support which is a must-have for me. TypeORM is the other I know about and I’ve used it as well but I greatly prefer Prisma. Other than having to bundle the engine I’ve been very happy with Prisma + PlanetScale. I’m open to any other TypeScript ORMs if you know of them.

I haven't used them, but https://github.com/koskimas/kysely and https://github.com/RobinBlomberg/kysely-codegen are doing some interesting things with TypeScript, focusing just on generating SQL queries, quite a bit more lightweight than Prisma.

Re: The PlanetScale serverless driver for JavaScript

#39

This is huge for me. I went down the path of trying to build an entire API on CF Workers and the biggest stumbling block was no easy access to external relational databases due to a lack of v8 compatible connectors. This was before the D1 announcement of course.

is it because you couldn't find a DB that you could talk to over http[s]?
Post reply on HN