Vercel dropped a database and leaked new Next.js features
Вставка
- Опубліковано 1 тра 2023
- Vercel just introduced 4 new storage products, including a serverless Postgres database, a durable Redis store, and file uploads with CloudFlare R2. They also leaked some details about a new server actions feature for Next.js
#webdevelopment #database #thecodereport
🔥 Get the new Next.js 13 Full Course
Upgrade at fireship.io/courses/nextjs
Use code NEXT30 for 30% off PRO access
💬 Chat with Me on Discord
/ discord
🔗 Resources
Vercel Storage Announcement vercel.com/blog/vercel-storage
Next13 Report • Next.js 13… this chang...
Next13 Course fireship.io/courses/nextjs
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- Does Vercel offer a database?
- Vercel Postgres basics
- Vercel KV basics
- Alternatives to AWS S3 file storage
- New Next.js Features
- Next.js server actions - Наука та технологія
Fireship PRO members make the Code Report possible... Use NEXT30 to take 30% off this week only fireship.io/pro
Fine, Jeff, you can have my lifetime money. This time.
I have to wonder what percentage of companies still use mysql or sql server as their primary DB software.
Whats this? A 2023 Code Report without the word AI in it?!
The new ai used to write the script for this video is humble now so it does not promote itself
Fuck ai
Don’t poke the bear…
Not even Javascript. smh. the chaneel has gone downhill.
the ai is used inside the database to hash the keys with zero to none collisions 🔥🔥🔥
vercel is announcing some soooolid products, however if you dive deeper into the blob pricing it gets ugly real freaking fast, its more expensive than R2 which is fine i guess as they take their cut however vercel charges for egress bandwidth while cloudflare does not, and i think that will turn the pricing to ugly due to the type of files you will mostly use for this database(images or videos)
i think they got some backlash on twitter yesterday and they have since removed blob pricing page from their docs, or at least i cant find them now so they might be re-considering the pricing model while its still in closed beta, hopefully they remove bandwidth costs..
This is the only one of the three products in a private beta -- probably the most likely to change!
That's the reason for all these startups offering these "serverless" and "easy to deploy DB services", it's much more expensive than setting up your own database on a vps, using free open source DB, and charging you a premium constantly for a one time script made to setup these services every month. It's the AWS and Firebase model. Scare people into not deploying their own services, then charge them a premium for "easy deployment" and "high availability" every month. you can/do have high availability with traditional fail-over and load balancing. they want you to pay $20-200+, for what essentially is a $5-20 vps with open source services setup for you.
Add something spoiled to the barrel, remove it and everything seems fresh.
@@amrrahmy123 "hey want you to pay $20-200+, for what essentially is a $5-20 vps with open source services setup for you."
Bad take, pager duty costs a hello of lot more than a $20 vps.
Investment in delegation is profitable.
@@amrrahmy123 it's not for someone with a tiny project that can do everything on a single $5 VPS it's for sites that need to scale beyond that without worrying that their $5 VPS will not be able to handle a traffic spike.
Welcome back! Thanks for this.
For the record, server actions were "leaked" weeks ago. It's open source. Maintainers have been talking about it openly on Twitter.
That intro is a good intro for my day. Got permission yesterday to reproduce a Kubernetes issue on production today xD
I was missing fireship so much!!! Was just talking with a friend
it's about wrapping existing tools as a service, stunning
Now you can easily delete all tables in your prod db using a faulty react component
This is the scariest part of this server components hype and they don't seem to care at all
@@metatronicx How is it different from a random route callback dropping your database? If you are afraid of this, clearly separate db roles into "admin" and "application" so only the former is allowed change schema definitions. You'd have implement this logic the moment the database has more than 1 consumer application anyway.
All you gotta do not f up 😂❤ every time I merge my code to main 😂
😂 it is so true
Me when I accidentally force-push a breaking change to main: "Hey, we're supposed to have branch protections. Honestly, I'm mad at YOU."
Writing sql in react components reminds me of sql in php “views”, something we learned was a bad idea long time ago. Yet, here we are… 1:43
JS in backend is a bad idea as a whole, and it should have stayed in front. Nonthless, you already have better & production ready stacks about a decade ago that JS is doing at this moment.
It's just amusing to see everyone trying on hyped tech getting replaced with another tool copied from another eco-system. What it can not do is replace 3 or 4 decades of engineering that powers modern day development stacks.
JS is just another player in the whole industry having its own place, mainly in front end and lightweight computing, but it can not be everywhere :)
I know they sound similar but it's completely different from PHP... Here we are using all the advantages of PHP development without the pain of a shitty language and tons of security vulnerabilities typical of PHP development. We are using a battle-tested framework here. Some may argue that Symfony does the exact same thing. To those I say: keep programming with your bullshit PHP
@@MaulikParmar210 but the non-blocking I/O is a game-changer for most CRUD auth applications, it's all handle by libuv library in CPP, and with typescript you get your type safety, so I don't see the problem here ?
@that's a lot java has vertx, php has amp / swoole / reactphp, .Net has TAP methods, python has sanic / tornado, go has it's own runtime, etc.
Async is not a problem for those who truly need it, regardless of whatever language they are using. Also, a lot of these projects are a lot older than most node frameworks!
@Wolfrost or may be learn standard and be framework agnostic and may be in process loss a bit rude attitude, choice is yours!
It's funny when you say battle tested, when a lot of large ( More than 100M active users ) sites, stores, government systems, and financial and healthcare backends are powered by those bullshit implementation being part of their stack doing their jobs without making a fuss about being awesome or being ahead of their time while rest of the world is just catching up to some standards developed years ago.
Thanks Jeff
I'm a technical founder and when we started our company in mid 2021 we decided to go with: NextJS / Vercel / Supabase / Upstash / S3. No regrets!!!!
3:40 woah so cool to see the place I live in the video! It's Moscow's Seligerskaya metro station, you can see the triangle building in street view it's exactly like in the video
I wonder if they're planning on competing in bandwidth cost as well? Because current prices are hilarious compared to other cloud platforms. Cloudflare even has free egress
$4-500 the TB of bandwidth, mostly from a CDN, which can cost you $5-10 on bunny CDN or even on digital ocean
yes vercel has cool stuff but infuriatingly shitty pricing that isn't competitive at all
Acid 🤣💯 nailed it! Your meme game is next level!
Interesting that for Deno KV they used Apple's oss project.
I am currently building the next billion dollar app and have decided to go serverless but I have no idea which database as a service provider to go with. A round up of them all would be nice, like "I built 1 app on N DaaS providers"
Here Jeff recommends Supabase. Also last week I heard from a serial app maker entrepreneur to love it too. Maybe worths for you to check it out
No billion dollar app here, but I sure want to cut down on cost and increase my margins. If anyone knows a good db provider at a fair price please let me know.
Appwrite
@@andresroca9736 supabase is just great they give auth RLS and easy integration with your frontend framework and of course fully typed sql queries
@@mosca204 Digital Ocean has managed DB starting at $15
Just wanted to let Fireship know that I LOLed at the picture he chose for "ACID". 🤣
Amazing video!
What are those competitors in minute 0:52? :0
Are these features available right now?
hmm, from your explanation, isn't all the databse here is complementary? postgres for transactional/traditional database, Redis for storing cache like login key, the third one is for store user config, and the blob one is just for storing file
You got me with "dropped", well played....we played
You are the best, It might be a great idea to make your amazing courses available for "geo discounts" in order to super weak currencies be able to enroll :)
Thanks in advance and thanks for the video!
how is the authentication handled in the new nextjs course? is it via custom registriation and login or via auth providers?
nextjs the most goated web framework. I just built an entire site in nextjs in 5 days. Full site. + tailwind css. Nextjs made getting into react easy. Love it as a framework.
nice Nouns Fry gif
No AI. We’re back to normal FireShip ❤ 🔥
That way of uploading files seems like a big security concern (e.g. for financial attacks). You don't have control on the upload if the client can upload directly to the bucket!
very cool, but man, it is going to be crazy expensive
I mean if you have 100 users it's not that bad, (for having fun)
@@thatsalot3577 the free tier is super limited, you're better off using the source providers they have better pricing/ free tiers
I understood like 5% of this video, but I really like watching them...
thanks 😘
Hey Fireship! You should do a “100 seconds of” video on Zig & all of the different LLMs, not just GPT. That would be sooo cool!
We legit just migrated from postgres(were deploying on aws) to mysql a week ago. Now we're moving back because of this vercel update. We already use a lot of vercel services and with this we would be able to put most of our aws stuff in vercel(including s3 storage). Just hope vercel announces app hosting so we can host our backend servers(even though we use serverless, some endpoints take hours to run)
Damn your company must be swimming in cash , Vercel hosting is not cheap by any metric
@@hakuna_matata_hakuna No they're probably just messing around and doing nonsense, nobody serious switch to MySQL then back to postgres in a week just because vercel implemented an already existing service
If you have so much cash to burn...why not
your company dies not know what its doing
@@tilakmadichettitheappdeveloper Lol
I got an ad for you on your video. Fireshipception
“This is an awesome feature and I’m glad to see Next stealing it from Remix” lmao that gave me a nice laugh. Thank you.
that looks like big SQL injection vibes at 1:30, unless Vercel sql command automatically sanitizes interpolated strings
Can you do PostgREST in 100s? It's an amazing tool that automatically wraps your Postgres database with an API layer and grants access using native PG roles and row-level permissions.
We've been working with this tech since the inception of our stack, and it's a breeze to use!
And it's written in Haskell, so it's *blazingly fast*.
As a second, I'd be happy to hear about SQLAlchemy or Flask/FastAPI!
What's the use case for PostgREST? I'ved Hasura for years at work and it's absolutely garbage for anything but simple CRUD apps. lol
dont put business logic in database guys
@@PenguinCrayon269 say that to postgres functions lol
Vercel builds its own services that work great together, but is their goal to have a wide range of services like the major cloud providers? Hmm, I don't think so, but for web apps based on serverless and friendly configuration - I think it's an interesting concept. Of course, another issue is profitability and prices and so on. It looks like a very friendly "ecosystem" now. Thanks for the news summary.
No, none of these services are built by Vercel themselfs, they rely on other providers like AWS, Neon, Upstash etc
@@mikopiko Yes that's right but their services are based on other services but that was not the point of my statement. After all, they took different technologies and made something functional. This is the meaning of my first words "Vercel build its own services...".
I like supabase. I wonder which ill like more for db, storage, auth in 3 months
Does @vercel/postgres automatically parameterize queries or do you have some tasty SQL Injection at 1:29?
3:52 🍄ACID 🍄 I see what you did there 😉👍
Isn't the current nextjs project structure still in beta after like a year? Seems like they enjoy shipping half baked goods to say they did it. Can imagine this will work great with that being said.
Lol based
what are you even talking about
@@fallenpentagon1579 He's talking about the app directory. It's still in beta after a year
You mean experimental?:D
@Janos Marta yes
I don't suppose your Supabase course covers how to run it in a container (VS they cloud hosted service)?
I can hear artifacts in your voice from time to time. Wonder why :P
2:07 forms triggering server actions causing redirects.. aaand we have arrived at… Ruby on Rails. 🤫
ok, so Vercel is basically doing the "Designed by Vercel in San Francisco" move and making millions of dollar by just putting some fancy designs around it. We will never learn...
Tbf they do have real experts behind it (e.g. Svelte creator and many others). I kinda want to trust them on this one
Oh nooo, fancy designs. Nothing good can have good design. Things should look bad.
@@chepulis That's not the point. Vercel is just a scam and it only works because of marketing and a fancy design. For comparison: Cloudflare Worker: $0.50 for million requests (50ms CPU time); Vercel: $2.00 for 1 million execution units (1eu = 50ms CPU time). You pay four times more on vercel for the same product. And the bandwidth cost is just stupid. 40$ for 100GB extra.
@@Joseph-ke3xc or, just dont be a lazy developer and invest a few days into learning AWS or whatever the hell it is you need. Also, putting together and maintaining the infrastructure is not as difficult as all the vercel sponsored influencers and the twitter crowd might make you want to believe.
@Joseph bruh with this insane job market, knowing Vercel vs knowing how to set it up yourself is the difference between being on the short list for a potential layoff vs being a valuable asset to your team
me: They want stole or store ur data?
Fireship: Both
they want to store our precious data , how sweeeet they are 🙃
They want MY data? I am flattered
damn, nextjs is getting really similar to php
But better
@@oscarljimenez5717 as someone who has worked on both techs. nextjs(typescript) over PHP(laravel) any day
no really
i recently switched back to laravel. tired of the hype train in js/ts world. im just trying to build things, don't have time to experiment on a new framework and library every week.
@@name_less227 you don't have to.
I don't get anything but this is fun to watch
um, you can tell "most" databases to load into and operate out of memory. So you can make a cluster of in-memory read databases with a node running of disk as a write master... speed and scalability. key-values are actually faster because they're generally just the hashing algorithm with a map to where it is stored (even if it's on disk), so there's less scanning. key-value databases are also absurdly terrible if you want to run anything that smells like it's ideal in SQL.
Kv dbs make sense for doing things that are nanoscale and require barely any data, but require acid like principles, like unauthenticated rate limiting against certain endpoints for instance. You log an IP for a User at your site via edge middleware, when they hit a certain endpoint (lets say something that is generally free but if people were abusing it, it should cost money, like pdf converters or UA-cam mp3 ripping).
The IP is stored as well as a cookie for the unauth session.
Every time that cookie and IP hit the endpoint, insert a row.
When a limit has been reached, return a different result.
Catch the result on the frontend, throw a CTA to the User to sign up to the Pro plan.
@@JetJockey87 , yup, they're super handy. Simply not the tool for anything close to complex data you need to query in fancy ways. For example, I'd rather use a spoon to swap my brain with a bowl of warm tapioca than use mongo as a reporting database.
Deploying apps can be risky
00:00
✦
Versel now offers four new databases for Next JS deployments.
00:31
✦
Neon is an SQL database with automatic scaling and fault tolerance.
01:04
✦
Comparison of backend tools
01:31
✦
New API called Server Actions allows creating server functions alongside components
01:57
✦
Cloudflare offers four databases for different use cases.
02:25
✦
175.20 179.28 allows storing unstructured data on edge
02:55
✦
FoundationDB by Apple is a fast and consistent global key value database
03:24
While they are in competition for storing my data, I store my own data
Firebase is still my baby lol. Auth, real-time do, storage, it’s too ez for developer side projects.
Prisma handling PostgreSQL has some issues hope thsi helps.
That’s pretty cool, I’m still gonna host things on my own though.
every day a new JS framework, database it's really hard for programmers
Today I learned what's upstash
Did you said store or stole at the end of the video?
I think the term "front-end cloud" is the most cursed thing I've heard this year
It even sounds unusual 😲
Vercel is clearly competing with AWS, Google cloud and Azure now. They are trying to pull in NextJS crowd, and I am sure it's not a small number, especially with growing popularity of the framework. Smart move.
Vercel is built on top of AWS, actually. They essentially built a platform on top of it to make it easy for devs to get stuff done without 1000 hours of AWS training beforehand. They "compete" with AWS as much as a Best Buy "competes" with Samsung.
I legit can't say if you're trolling
how?
they are just doing firebase for even dumber dummies
like nobody will stick with them in serious org because cost optimization would not be possible and vendor lock would be huge
its just another tech stack masturbation for the sake of it
oh well, just how they say: when in doubt, use mysql
everything is great and all, but why 'any' is in 1:27
Welp looks like a bold move
Does This one course on NextJS13 replace the old one?
Interestingly enough, the T3 stack also created a blob hosting service that at the moment offers larger file sizes than Vercel blob and "released" it in beta format the same day. I wonder how far the connections between the two stacks / companies go since this simultaneous release is toooootally inconspicuous.
Theo does not work for Vercel, what are you implying here? 🤔
Hi fireship give kysley a try if you like sql like syntax you gonna love it,
But yes managing migration with prisma is still ❤
Why not both? I use both right now. Prisma for schema, migrations, generate Zod and DB Types, kysely for complex queries.
I feel like drizzle is more better than prisma. individual entity files, sql methods, etc. also the vercel docs say drizzle integration is coming.
The future is so bright! Now I can go through life without ever owning anything, rent my home, lease my car, subscribe for movies, tv, games, remote rendering consoles, phone, food, cloths... And now, finally, we don't need to use or support Free Open Source Software any more, we can pay a big tech company exorbitant rates to own our data forever instead! How exiting, where do I sign up?
Chat gpt said “that shits expensive bro”
of course I want to write sql right inside component (nope)
Amazing! Love your videos!
Directory on VPS + nginx RP > S3
I'm surprised there's no vector database (I don't know what that is).
*they're just expensive wrappers for other products!!!
came to check if we are replaced yet
Very cool but it still refuses to import my 3D model assets and textures for some cursed reason! I don't know why tf it does that. I'm upset bc I rly wanted for my portfolio with three.js elements to work there ugh
OMG! This is why I wasn't using Vercel! This was the biggest downsides for it, and now it's solved! 😁
where is the sveltekit course?
Is it still cool if I continue to use relational dbs?
did that first thing really happen?... damn
No mention of pricing 🧐
Aws of nextjs
You misspelled Drizzle at 1:34
Thank god we can ask ChatGPT what we should pick 😌
I am disappointed that the pricing didn't stick out to you.
I have my own mariadb instance on my server ;)
Haha, are server actions a reimplementation of aspnet postback from 2000?
My colleague dropped a database once. It was the biggest shitstorm I had ever seen.
Why dont you create longer videos contents like what are different databases
and how are they classified
Bro reading title i though that vercel dropped a database
2:22
Aren't they fast because they do O(1) lookups, not because of RAM storage? The moment you start performing usual database operations like count/filter/sort/aggregate on the cache storage all its speed advantage vanishes into ether.
Not to mention the cache in a microservice architecture would require at least a TCP connection, so any advantage of storing in RAM-only (how do you even do that while being ACID-compliant?) is lost.
3:38
It's not that hard really, as of 2023 only postgresql has a truly open-source license without gotchas. Basically any database solution which doesn't allow a local deploy without internet access is DoA.
it’s fast because of being a KV store AND being in-memory. A KV-store by its nature limits the DB operations you can perform, so yeah, in cases you need such operations then it has no particular advantage, but it would have to be measured: disk access time vs. extra ops time. KV from RAM plus those extra operations (in CPU) is probably faster with small data, but an on-disk DB with a different structure to the data (RDBMS or graph) is probably faster with large data.
Redis KV store doesn’t store in RAM only, but is RAM-first, with persistence to disk regularly. Which is faster (but more expensive in terms of $) than disk-first with RAM only for caching.
Choosing the appropriate DB for a given use case can be really hard, since there are a lot of worthy contenders (DB types) and offerings within those types. Not all use cases are best solved with an RDBMS like Postgres, even though it is a good default for many if not most use cases if you don’t really want to think about it. But once you do think about it, it’s complex. Like all things.
db-engines dot com is a good place to get an overview and compare.
For all the old geezers who’ve _always been_ using PostreSQL: We’re cool again!
But can we use a database as dataset to train our own Ai? 🤔 or stolen databases
I'll stick to mariadb. Simple and works fine
There should be a limit of how many databases are allowed to be released in a year.
How about mastering one framework at a time?
2:21 And *SQL databases aren't? 🤨
what about upload thing by theo
The first 10 seconds gave me a mini stroke just thinking about it lol
Does the Postgres support pgvector?
Its incredible how a framework based on a framework that goes by "we dont do shit, look for a library" is going crazy with the idea "we do everything" and both are loved by the same people.