Build a High-Performance API with Next.js, Hono, Redis (2024)

  Рет қаралды 39,393

Josh tried upstash

Josh tried upstash

Ай бұрын

In this video, we're going to build a pretty fast API together. Do to this, you're gonna learn how to use Hono, a leightweight web framework, Cloudflare Workers for globally distributed serverless code and Redis as a fast database.
--- Links
FastAPI on GitHub: github.com/joschan21/fastapi
Upstash Redis: console.upstash.com/login
Copypaste list: github.com/joschan21/fastapi/...
Hope you enjoyed the video!

Пікірлер: 67
@404-not-found-service
@404-not-found-service Ай бұрын
Thank you very much for this type of content, I am glad that you left this channel precisely for this type of projects so I can study all this directly here, greetings
@therealsharat
@therealsharat Ай бұрын
Amazing video Josh! Great way to introduce Hono and Cloudlare workers.
@syedarshad2289
@syedarshad2289 Ай бұрын
Hey Josh, that's some cool stuff you got there. Gonna try this out in my next project.
@akashthoriya
@akashthoriya 16 күн бұрын
Helpful, Thank you for amazing content
@abdulhajiyev
@abdulhajiyev 14 күн бұрын
Watching from 🇦🇿 Thank you for amazing video 🙌
@t_park
@t_park Ай бұрын
love this bro thanks!
@Johnny-rf4iu
@Johnny-rf4iu Ай бұрын
Wow this is awesome. Learnt about searching and fast performance API. Upstash is amazing I just like it
@codewithguillaume
@codewithguillaume Ай бұрын
THIS GUY IS THE BEST !
@eliuddyn
@eliuddyn Ай бұрын
Amazing 🔥🔥
@RatherBeCancelledThanHandled
@RatherBeCancelledThanHandled 8 күн бұрын
Great job ! 🙂Thanks for sharing any advice on where to find other grainy background images?
@markus_dev_cwb
@markus_dev_cwb Ай бұрын
Amazing!!!
@EqualToBen
@EqualToBen Ай бұрын
PNPM is awesome! I tried using the random node / npm setup I already had on my pc, then went in a rabbit hole of trying to update node with nvm for windows.... then nuked it all and just installed pnpm and ran "pnpm env use -g lts" which downloaded the latest node version and got me up and running in seconds. Damn if that's all I got from this it was worth it
@deiminator2
@deiminator2 Ай бұрын
Bro 75ms for a redis query? that's whack, with either Aiven or redis cloud and a GCP run docker container you can get as low as 5-8ms, I don't know what upstash is doing but that latency is horrendous
@Joshtriedupstash
@Joshtriedupstash Ай бұрын
this is for multiple redis calls and all string comparisons happening on the backend as that is a much more fair basis to compare redis to postgres. Single redis call is about 2-5ms in US and europe regions and 40ms for asia pacific
@deiminator2
@deiminator2 Ай бұрын
​@@JoshtriedupstashHmmm, but based on the code at 50:18 you only make 2 calls, one for the rank and the other for the zrange which in a zset of that size should take as you say a maximum of 5ms, at least locally. Then you do the string comparison with JS but you are working with a n=100 array, which should be trivial because the strings are also not so long since they are just countries' names So it should be at max 8-10ms, if you get 70+ that probably means your upstash queries are taking ~30ms to execute, in that case your bottleneck is the network and using redis instead of PG would be inconsequential.
@ratasobreviviendoenlascloa4847
@ratasobreviviendoenlascloa4847 Ай бұрын
​@@deiminator2175ms supabase 😢😢😢😢😢😢😢
@RMarcus05
@RMarcus05 Ай бұрын
I think one of the issues is making a new Redis/Upstash connection during every invocation of the /search function. That’s probably 30+ ms of extra latency every search. Instead, it should be initialized outside the /search function and it’ll get reused 99% of the time (except when new worker containers get spun up).
@roberth8737
@roberth8737 13 күн бұрын
Awesome stuff! Any reason for using pnpm over bun?
@nobudev
@nobudev Ай бұрын
Hono 🤘
@syxshooters3121
@syxshooters3121 Ай бұрын
would love to see a video on pnpm, i am using npm but as you mentioned that it helps in caching. Make a video on pnpm if possible.
@Deus-lo-Vuilt
@Deus-lo-Vuilt 12 күн бұрын
I like this from cloudflare with hono
@cetingokdeniz
@cetingokdeniz Ай бұрын
🎉🤞
@tarunsharma8442
@tarunsharma8442 Ай бұрын
I have two questions if anyone could help me(Ik they are silly but anyways): 1) Why are we even exporting default app at the bottom in route.ts file? 2) Why are we not debouncing the input, because I think it's a bad approach to make a request on every input?
@frazuppi4897
@frazuppi4897 Ай бұрын
Thank you a lot for the video, I am wondering, do we loose server side rendering by doing this?
@RedVelocityTV
@RedVelocityTV Ай бұрын
Ofc you do. He made the whole page 'use client'
@frazuppi4897
@frazuppi4897 Ай бұрын
@@RedVelocityTV oh then I am isn't that *bad* ?
@frazuppi4897
@frazuppi4897 Ай бұрын
@@RedVelocityTV but he had the layout.tsx file
@RedVelocityTV
@RedVelocityTV Ай бұрын
@@frazuppi4897 it would be bad if he had other content on the page. But it was just a searchbox. Although it's better practice to have individual components use client than a whole of page.
@frazuppi4897
@frazuppi4897 Ай бұрын
@@RedVelocityTV what if I want to dev a real app?
@prashlovessamosa
@prashlovessamosa Ай бұрын
Hey yo thanks
@user-fg7sm9sq1l
@user-fg7sm9sq1l Ай бұрын
Can we use that in sever actions ?
@rahulkumarmaity7497
@rahulkumarmaity7497 Ай бұрын
still do get the cors error on yarn dev and also deployment any sols josh? or anyone?
@quangminhtran7592
@quangminhtran7592 Ай бұрын
Can the basic code also be implemented Server Side?
@naveenkumar7617
@naveenkumar7617 13 күн бұрын
But then what's the use of rank used with redis, is that something that is taken care by redis, I mean will the rank value gets increased everytime when search results matches or what?
@wallacesilva6087
@wallacesilva6087 Ай бұрын
Foda!!
@igmtink
@igmtink Ай бұрын
more videos like this sir 😁 how about creating a SaaS with this next.js + hono.js + cloudflare and redis sir
@Septumsempra8818
@Septumsempra8818 Ай бұрын
My site keeps crashing coz I have such a slow search (600ms-2sec) and too many users. Did I mention its Django.
@Jim49267
@Jim49267 Ай бұрын
Can you create a search page using images like Pinterest?
@AmodeusR
@AmodeusR 10 күн бұрын
I didn't quite understand why put "letter by letter" in the database. Why not just have the full names and use a includes?
@iampapagray5031
@iampapagray5031 Ай бұрын
the upstash site really needs a dark mode
@juk98765
@juk98765 14 күн бұрын
Bro used all the package managers 😅
@ordinarygg
@ordinarygg Ай бұрын
Redis? Are you living in the different dimension?))))))
@iogilarb
@iogilarb 12 күн бұрын
hono nononononono hono hono hono..
@AnimelifeYT
@AnimelifeYT Ай бұрын
16:36 INDIA🇮🇳 mentioned
@mirzazplayz_rblx
@mirzazplayz_rblx Ай бұрын
Fuck off No one cares
@user-dd3te4rh8j
@user-dd3te4rh8j Ай бұрын
28:35 India 🇮🇳 Mentioned
@defender2212
@defender2212 Ай бұрын
So?
@AnimelifeYT
@AnimelifeYT Ай бұрын
@@defender2212 nothing 😂😂
@therealsharat
@therealsharat Ай бұрын
You're cringe dude do you see anyone from azerbaijan doing this sh*t?
@rtorcato
@rtorcato Ай бұрын
this entire project could be done with cloudflare pages, cloudflare kv and cloudflare workers.
@ricardocastro9998
@ricardocastro9998 Ай бұрын
Maybe, and in java, c#, python, deno Anything can be make in anything tech
@Nab_001
@Nab_001 Ай бұрын
having Josh on your team is like having Cristiano Ronaldo in your team.
@rod6722
@rod6722 24 күн бұрын
More like having Kevin De Bruyne.
@RedVelocityTV
@RedVelocityTV Ай бұрын
Long videos without timestamps 👎
@khanra17
@khanra17 6 күн бұрын
Research what is "FastApi" then clickbait !🤬
@Alex-bc3xe
@Alex-bc3xe 3 күн бұрын
No timestamp = a NO GO
@Mr.BinarySniper
@Mr.BinarySniper 14 күн бұрын
Nextjs itself a garbage framework.. I don't believe the video thumbnail
@briltsoftsupport483
@briltsoftsupport483 5 күн бұрын
But the makers of react recommends them
@m.agaming3795
@m.agaming3795 Ай бұрын
If anyone is facing difficulty in running it using npm First : Run npm i tsx Second : npx tsx src/lib/seed.ts
I Stopped Using Express.js: Because Bun and Hono 🔥
10:23
Sam Meech-Ward
Рет қаралды 96 М.
A Better Way to Write APIs?
12:00
Josh tried coding
Рет қаралды 83 М.
Useful Gadget for Smart Parents 🌟
00:29
Meow-some! Reacts
Рет қаралды 10 МЛН
The World's Fastest Cleaners
00:35
MrBeast
Рет қаралды 138 МЛН
ОДИН ДОМА #shorts
00:34
Паша Осадчий
Рет қаралды 6 МЛН
Are we going back to PHP with fullstack JavaScript?
9:57
Maximilian Schwarzmüller
Рет қаралды 78 М.
Build a Production-Grade API with HonoJS, Cloudflare, Upstash (2024)
1:04:21
Deploy Next Js on Cloudflare
3:57
Sphorb
Рет қаралды 4,4 М.
I DONT USE NEXT JS
54:01
ThePrimeTime
Рет қаралды 307 М.
If this ships, it will change javascript forever
25:54
Theo - t3․gg
Рет қаралды 183 М.
INSANE OpenAI News: GPT-4o and your own AI partner
28:48
AI Search
Рет қаралды 424 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 167 М.
This tool makes self hosting simple
5:59
Web Dev Cody
Рет қаралды 48 М.
NEW GPT-4o: My Mind is Blown.
6:28
Joshua Chang
Рет қаралды 414 М.
What % of charge do you have on phone?🔋
0:11
Diana Belitskay
Рет қаралды 333 М.
Я Создал Новый Айфон!
0:59
FLV
Рет қаралды 3,1 МЛН
СЛОМАЛСЯ ПК ЗА 2000$🤬
0:59
Корнеич
Рет қаралды 2,3 МЛН
How about that uh?😎 #sneakers #airpods
0:13
Side Sphere
Рет қаралды 9 МЛН