Vercel Launches 3 New Storage Options for Your Next Project!

Vercel Launches 3 New Storage Options for Your Next Project!

Play this article

If you have tried manually deploying apps to production, then you may know how nerve-wracking things can be. Even the slightest mistake could cause the production database to be deleted, leading the company to lose billions of dollars, making you freak out and flee the country before your boss finds out, and start living in the Himalayas as a goat farmer.

That's why most of the developers use Vercel, Netlify, Heroku, and Firebase as they handle deployment for you and prevent you from making any big mistakes. Anyways vercel just introduced 3 new databases or storage options. And let's see them in brief.

What is vercel?

Well, Vercel is a cloud platform which enables developers to host their websites and web apps that deploy and scale automatically. Vercel is the favourite choice for the deployment of Next.js apps as they have more efficient support for the framework. That's not that big as vercel also maintains the Next.js.

But the best part is that they support almost every language framework though they specialize in javascript frameworks. I have hosted many Python frameworks like Flask, FastAPI and even Django. They even support PHP, I have hosted my app there and haven't got any issues with speed or rendering.

They have a crazy awesome user interface and experience that makes it so user-friendly. It provides a free tier named Hobby for developers to experiment and try their platform. It’s against Vercel’s TOS to run a commercial app on the free tier. Even though you technically could, they will shut down your site if caught in violation. So you'll have to go with a paid plan and it's a bit expensive when compared to other platforms.

Introduction

Vercel introduced 3 new additions to their storage solutions. They did it on 1st May and you can find the announcement on the website. The new additions are:

We will be talking about them individually one by one below. This is a huge thing as they are trying to control users from using any other third-party database solution and managing it themselves. The database was the only thing missing on vercel but now it's kind of complete at least it is in beta for public use. They are not yet available for enterprise usage, mostly they will be available soon.

Vercel KV

It's key-value storage like Redis, in fact exactly like Redis as it is powered by Upstash. If you didn't know Upstash is a Serverless in-memory cloud database from Upstash Inc, a California-based company. It is a Serverless Redis Service. It can be used for caching layer or as a database. You can more details about it here.

For now, I am more interested in the speed at which it works, let's try to create a simple free tier vercel KV storage. The creation is pretty straightforward, they just ask you for the name and the region. I went with Singapore as my region, as it seems to be the nearest one.

They also provide CLI to set and get values directly from the database.

I copied the Template that they provide for the testing, you can get the template source on GitHub. I modified its page.tsx file just to set and get a value from the database.

import kv from "@vercel/kv"

export default async function Home() {
  console.time("res");
  await kv.set("message", "Hello World!");
  const msg = await kv.get("message");
  console.timeEnd("res");
  return <p>{msg}</p>;
}

When I first ran it took more than 200 ms to load, as it was the first request server took time to warm up and respond. Even 2nd and 3rd try still resulted in more than 100 ms, but after that, it came down under to 25 - 50 ms range.

Keep in mind that this was both reading and writing. But when I tested reading from the database alone it was a little above 15 ms.

The storage supports all the operations that can be done on Redis. There are limitations applied on creation, requests, record size etc you can find them here. The pricing seems to be a little above the expected but it may drop in the future.

Vercel Postgres

This was the part for which I was most excited. They introduced Postgres one of the most advanced general-purpose object-relational database management systems. I have been using it for my projects. It's powered by Neon a fully managed serverless PostgreSQL. Neon separates storage and computing to offer modern developer features such as serverless, branching, bottomless storage, and more.

Coincidentally I used Neon for a freelancing project and it was amazing as it provide a web interface to edit, give analytics and view tables which made the development of my Django app super easy. I will have to try it to be sure if it is as good as Neon. The creation of Postgres is simply the same as that of Vercel KV and only requires a name and region ( Singapore is available so I choose that ).

I copied the Template that they provide for the testing, you can get the template source at GitHub. I modified its page.tsx file just to create, insert and select a value from the database.

import { sql } from "@vercel/postgres";

export default async function Home() {
  console.time("create");
  await sql`CREATE TABLE IF NOT EXISTS PERSON (name varchar(255), age int)`;
  console.timeEnd("insert");
  console.time("create");
  await sql`INSERT INTO PERSON (name, age) VALUES ('Akash', 21)`;
  console.timeEnd("insert");
  console.time("select");
  const { rows } = await sql`SELECT * FROM PERSON`;
  console.timeEnd("select");
  return (
    <div>
      {rows.map((row) => (
        <div key={row.age}>
          {row.name} - {row.age}
        </div>
      ))}
    </div>
  );
}
create: 474.285ms
insert: 102.999ms
select: 103.254ms

I have tested it for like 10 times and I think the time averages out nearest to these values. It's pretty good and fast for me at least. Vercel also has a web interface to view tables and execute queries same as Neon.

The pricing is almost the same as that of Vercel KV. And also include the same limitations as of the same. You can view the pricing here.

Vercel Blob

This is something that can be very useful. Vercel Blob allows you to upload and serve files via a global network through unique and unguessable URLs. it's based on Cloudflare R2 which allows you to store large amounts of unstructured data like images and PDF files on the edge in other words it's a replacement for storage buckets like S3 and that could be a game changer if your app does file uploads. It is still in private beta but you can sign up for the waiting list to try it. To signup head to this link.

They say it is users can upload files of any size. But for the private beta phase, the upload size is limited to 4 MB, but soon they will release its full potential and will be available for public beta.

The SDK is pretty simple for developers to use same as the other storage. I don't have access to it so I can't test it for myself but I would say it would be good as the other two. As per the doc, the snippet given is

import { put } from '@vercel/blob';
import { NextResponse } from 'next/server';

export default async function upload(request) {
  const form = await request.formData();
  const file = form.get('file') as File;
  const blob = await put(file.name, file, { access: 'public' });

  return NextResponse.json(blob);
}

The pricing is available here. It will be good for companies looking for storage that has some simplicity yet advanced technologies and have loads of money to waste.

Is it worth it?

Without much of a surprise No, it's not worth it as they are priced insanely high. As it's vercel they have a bit high pricing as always but the products are also somehow astonishingly good and have a good user interface. To phrase it they are Apple of the web industry. But that doesn't justify the pricing,

  • Vercel KV is 1.5x the price of Upstash scaling without the way more generous free tier.

  • Vercel Postgres is 2x the price of Neon scaling without the way more generous free tier. The free tier of Neon has 3GB of storage compared to 256MB of Vercel, no limit of storage on its pro plans compared to 512MB of storage for Vercel, no limit on read and write data compared to Vercel, no limit on compute time compared to Vercel.

  • Vercel Blob is 2 times the price of Cloudflare R2 without the way more generous free tier.

The prices may change later. The VP of Developer Experience at Vercel commented on Reddit that the prices may change with the feedback of the beta users and the pricing of vercel blob isn't final yet.

This is still good for developers who don't want to use other applications just for the database instead they can find all the things in a single place which makes it easier to maintain and use.

Conclusion

Vercel is an amazing platform for hosting web applications without a doubt. And I am sure I am going to use Vercel Postgres for future projects for sure. You should try it for sure as all the storage options are available for the Hobby plan. Vercel is trying new Server Actions an alpha feature in Next.js, built on top of React Actions. They enable server-side data mutations, reduced client-side JavaScript, and progressively enhanced forms. This would be a great feature for web developers.

Lastly thank you for reading this patiently and please follow me on Linkedin, you can find the link at Akash R. Chandran | LinkedIn.

Did you find this article valuable?

Support Akash R Chandran by becoming a sponsor. Any amount is appreciated!