Cloudflare's R2 costs $0.36 per million read operations (after the 10 million you get for free) [1]. Vercel is wrapping R2 and is charging $2 per million reads [2]. They're also charging $0.15/GB for egress (after the 1GB you get free), when R2 charges nothing, and the storage cost is doubled from $0.015/GB on R2 to $0.03/GB on Vercel. That's quite the cost increase for the DX improvement. [1] https://developers.clou…
Does this mean I have to potentially deal with two vendors when there is an outage? Awesome!
Storage on Vercel
71–80 of 144 posts
Re: Storage on Vercel
#72Earlier quoted context omitted.
You will get better customer support from Vercel. Cloudflare gives almost zero customer support if you are pay-as-you-go plan.
For what it’s worth when I was TL I would regularly hang out on discord and answer questions for R2. I believe the team still does that and the community itself also answers a lot of questions. Now that I TL Workers KV I do the same in that chat room. There’s also the community forums although I find it’s harder to stay on top of those personally. Not trying to say our paygo support is as good. Just saying for those…
Re: Storage on Vercel
#73This is cool and whatever, but after the work my company has put in to actively move things away from Vercel I'm going to assume it's hugely overpriced by default compared to even other similar SaaS services.
Its extremely expensive, and I'm aware of two companies migrating away from NextJS itself (neither were ever hosting with Vercel, though). I've only talked in depth with one of them, but the reason is complexity: they want "a react framework" and every update to NextJS substantially raises the complexity bar, introducing a large number of features that they don't want or need. There's also been at least one incident…
Re: Storage on Vercel
#74Earlier quoted context omitted.
I don't think you understand what the code is doing. That's a string templating function , not a raw templated string. `${formData.get('name')}` will get passed as a parameter in a var-arg, not stuck straight into the string.
Right. The code converts all expressions into $N-parameters. However Postgres does not support parameters in all locations, eg. this would fail: import { tableName } from "../shared" sql`SELECT * FROM ${tableName} WHERE id=${formData.get('id')}` The @vercel/postgres package needs a big disclaimer that it works very differently from node-postgres and what is and is not allowed.
Also, node-postgres is ripe for sql injections because you just concatenate strings yourself when using it...
Re: Storage on Vercel
#75I really wish this had been Fly or Supabase. I’ve used Neon and it is much less performant and often times completely non responsive. My company already uses Cloudflare so the rest isn’t a big change for us.
Re: Storage on Vercel
#76I looked into serverless postgres offerings a few months ago and came to realize that while it is possible, it doesn't appear that we have figured out how to develop with it as well as we have with traditional postgres. ORMs are fairly incompatible with serverless postgres, and schema migrations are difficult to handle because you have an unknown number of asynchronously updated copies of your code spread around the…
This is why at Xata we have developed our own ORM-like SDK for TypeScript and we store migration files in the repo. The SDK is very lightweight so it runs in any serverless runtime. It also means we can create DB branches on the fly for each PR, with whatever schema is in the repo, and when the PR is merged, the `main` branch gets migrated automatically.
There's also issues with complexity even if the solutions get figured out. What are you getting in return? Serverless is great IMO when it's the simplest solution to a problem, ex: "I only have a front end but I really need a simple API action that daisy-chains a few API calls".
Re: Storage on Vercel
#77the margin that vercel makes on these products that you can easily integrate with nextjs (or anything else that runs on their infra) is crazy. All of them offer easy integration with the edge or lambas functions... I don't see how vercel justifies this price outside of DX
Consumers have always been willing to pay a premium for simplicity & convenience. No difference here: devs will pay for DX.
Re: Storage on Vercel
#78Careful here. You'd be building a vercel-specific API into the middle of your data access stack. That might be fine... e.g., if it has a limited/specific use or lifetime, so that you know you won't get stuck.
But otherwise, use a standard, portable client. The docs say you can use any postgres client, so you should be able to choose whatever you prefer.
Re: Storage on Vercel
#79Earlier quoted context omitted.
Right. The code converts all expressions into $N-parameters. However Postgres does not support parameters in all locations, eg. this would fail: import { tableName } from "../shared" sql`SELECT * FROM ${tableName} WHERE id=${formData.get('id')}` The @vercel/postgres package needs a big disclaimer that it works very differently from node-postgres and what is and is not allowed.
They've looked at Postgres.js ( https://github.com/porsager/postgres ) before — wouldn't mind if they enabled those other cases in the same way. Also, node-postgres is ripe for sql injections because you just concatenate strings yourself when using it...
Why the heck would you do that?
I guess for any library that accepts SQL, someone might concatenate strings rather than use the parameter handling.
Re: Storage on Vercel
#80Earlier quoted context omitted.
Its extremely expensive, and I'm aware of two companies migrating away from NextJS itself (neither were ever hosting with Vercel, though). I've only talked in depth with one of them, but the reason is complexity: they want "a react framework" and every update to NextJS substantially raises the complexity bar, introducing a large number of features that they don't want or need. There's also been at least one incident…
This is also my concern. If the happy path is Serverless/Edge (on Vercel) with React Server Components I'm in for a big rewrite. I'm holding off any new investments in the Next.js ecosystem until the dust settles or a more community focused and stable alternative arises.