I Found a Faster Way to Build Next.js APIs

  Рет қаралды 32,819

Josh tried coding

Josh tried coding

Күн бұрын

Пікірлер: 50
@TheIpicon
@TheIpicon Ай бұрын
nice job Josh😁. 1 thing i want to highlight for the general info (since there's a lot of juniors in guides like this), is that your requirements for a fast api are mostly targeted for serverless environments, hence you want small dependencies and a lightweight environment to spin up your serverless function/worker as fast as possible. if people want to deploy to a server"full"(I guess) environment (EC2, EKS, OpenShift, VPS), they probably should focus still on the region but not on the startup of the pod rollout bot how fast it can serve requests once it's up ( would probably choose fastify instead of hono in this scenario since fastify is more mature with greater support and Hono is build by "edge first" ideology).
@harshitpant07
@harshitpant07 Ай бұрын
so which is faster in cloudflare hono or fastify I am considering to create a be server in a turbo repo which is better I want to deploy it on cloudflare
@TheIpicon
@TheIpicon Ай бұрын
@ it’s very dependable on the runtime your going to use for your fastify project. For a new project I would consider next-on-pages which is a next.js port for cloudflare on the edge with a crazy free tier
@joshtriedcoding
@joshtriedcoding Ай бұрын
can vouch for fastify, used it at a previous job and I was so positively surprised by it. Cheers man
@harshitpant07
@harshitpant07 Ай бұрын
@@TheIpicon so i am mocking this server as a bank server (project) and so I want this to be always up (or up and running as fast as possible) which is why I was thinking of hono on cloudflare but from what I can understand from your comment do you mean to say next-on-pages would be a better option here as a new project I did used hono before though. (I have never used fastify ) ... thanks
@TheIpicon
@TheIpicon Ай бұрын
@ next-on-pages uses the edge environment of cloudflare which is its own thing based on web standards (it’s the same as Vercel’s edge), I would use cuz it’s hella fast, cheap and easy to use (very similar to Hono)
@mohitcodeswell
@mohitcodeswell Ай бұрын
staying honest is the only thing a youtuber should do The rest is content
@twitchizle
@twitchizle Ай бұрын
i dont think josh is honest
@jitxhere
@jitxhere Ай бұрын
Any specific reason?​@@twitchizle
@childe2001
@childe2001 Ай бұрын
@@twitchizle why?
@slinco65
@slinco65 Ай бұрын
@@twitchizle Care to give your reason for saying that?
@joshtriedcoding
@joshtriedcoding Ай бұрын
appreciate you man
@AnalyticsRank
@AnalyticsRank 4 сағат бұрын
Hello josh, I love your tutorials! They’re always so informative and inspiring. I have an idea for a complete app you could create: a highly practical finance management app with features like category management, expense and income tracking, detailed reports, and even savings goals. I’m sure many people would be interested in such a useful and modern project. What do you think?
@eriknyk2k
@eriknyk2k Ай бұрын
It's awesome! thanks for sharing dude!
@kanasva
@kanasva Ай бұрын
Can’t wait to see the speed test of Workers connected to DB as it reflects more like the real world: D1, Turso, Neon.
@joshtriedcoding
@joshtriedcoding Ай бұрын
did my tests with neon & drizzle, its fun coming back around to it
@eriknyk2k
@eriknyk2k Ай бұрын
I just get why the vercel founder was too worried talking negative things about cloudfare
@joshtriedcoding
@joshtriedcoding Ай бұрын
i was surprised to see the negative comments about cloudflare when that happened, cloudflare is pretty good when it comes to recognizing good new tech imo
@alejandroechavarria539
@alejandroechavarria539 Ай бұрын
Amazing work josh
@thePradiptalks
@thePradiptalks Ай бұрын
@joshtriedcoding Why did you choose Prisma instead of Drizzle if you want it to be lightweight?
@denizdeno
@denizdeno Ай бұрын
For better test results, you can try sending all requests simultaneously in a multi-threaded way and then loop it 3-5 times. Or you can easily perform this test using one of the testing tools - I would recommend Apache JMeter. If you run the tests with settings like 1000 users and 10-15 loops, we can see clear results
@amirfarooq1516
@amirfarooq1516 Ай бұрын
But is it not the same case with vercel function deployment that if a user make request to an api, only the dependencies of that single api will be loaded and not all other apis? Ehy emphasizing over the other router dependencies not being loaded when a request is made to some other router deployed on cloudflare? Any response is highly appreciated.
@VincePolston
@VincePolston Ай бұрын
Hey Josh. What app are you using for creating those text/workflows as you're describing the topic?
@luckysolanki9440
@luckysolanki9440 8 күн бұрын
Hey Josh, can you please help me... Vercel being serverless causes mongodb to exceed connection limit so often, already issue is raised about it but if you have some solution? I use a connectToDb() function in each api made with mongoose, can you make a video on how to make the vercel friendly mongoose middleware
@paw565
@paw565 Ай бұрын
You can hey for testing api performance with ease from the terminal. It's awesome.
@fumblingthroughjavascript
@fumblingthroughjavascript Ай бұрын
Where is the 'mergeRouters' function coming from?
@fumblingthroughjavascript
@fumblingthroughjavascript Ай бұрын
trpc?
@codewithmoses
@codewithmoses Ай бұрын
This is really worth it! Just a short info, there is a scammer running around discord trying to impersonate as “Josh”
@XIIOSRS
@XIIOSRS Ай бұрын
Thanks Moses
@Gohealt
@Gohealt Ай бұрын
Josh in 2025. I was so wrong about my stack. I will go with laravel now ;)
@ChichaGad
@ChichaGad Ай бұрын
Schizo Josh moment
@joshtriedcoding
@joshtriedcoding Ай бұрын
laravel looks dope ngl
@carlosricardoziegler2650
@carlosricardoziegler2650 Ай бұрын
Nice content, it is possible some alternative approach in vps ?
@sohamnandi7526
@sohamnandi7526 Ай бұрын
can you please share the hono-rpc code, if possible ?
@matthewhammond5902
@matthewhammond5902 Ай бұрын
What about containerization? And sharing data between containers?
@matthewhammond5902
@matthewhammond5902 Ай бұрын
Or query optimization.
@CoryTheSimmons
@CoryTheSimmons Ай бұрын
It's wild AWS doesn't have an answer for CF Workers yet. It's definitely in the pipeline though.
@jsvrs
@jsvrs Ай бұрын
using rpc is cool, but the only downside is that you lose control of the caching from the vercel `fetch`
@PreetimanMisra
@PreetimanMisra Ай бұрын
Ah, classic programming. "My code works! Hmmm..., why does it work? The hell??"
@FranciscoMarcosMilhomemAbreu
@FranciscoMarcosMilhomemAbreu Ай бұрын
What is jstack? I don't get it.
@filipniklas
@filipniklas Ай бұрын
Why not server actions?
@sympijs
@sympijs Ай бұрын
well imo database queries are what is slow in many apps. or calling 3rd party services. But it’s usually querying your database / redis
@reze_dev
@reze_dev Ай бұрын
Especially when the backend sever and the database are in different region.
@Deus-lo-Vuilt
@Deus-lo-Vuilt Ай бұрын
More Hono with Cloudflare ❤
@bloodylupin
@bloodylupin Ай бұрын
first hi Josh keep up your awesome job 😎
@mikoo1991
@mikoo1991 6 күн бұрын
josh, are you being lazy?
@clazzy0
@clazzy0 Ай бұрын
first
What Large-Scale Software Looks Like
18:32
Josh tried coding
Рет қаралды 35 М.
How To Handle Permissions Like A Senior Dev
36:39
Web Dev Simplified
Рет қаралды 294 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
AI 的 2024:ChatGPT的停滞不前与Agent的日新月异
1:19:24
课代表立正
Рет қаралды 7 М.
TMUX in 100 seconds | Prime Reacts
11:43
ThePrimeTime
Рет қаралды 177 М.
Next.js vs. Vite - Worth migrating to Vite?
9:17
snackableCTO
Рет қаралды 5 М.
*Next-door 10x Software Engineer* [FULL]
4:50
Programmers are also human
Рет қаралды 854 М.
I built the same app with 5 different stacks
1:20:29
Theo - t3․gg
Рет қаралды 115 М.
How To Build Feature Flags Like A Senior Dev In 20 Minutes
20:33
Web Dev Simplified
Рет қаралды 108 М.
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 693 М.
The Better Way to Load Images
8:46
Josh tried coding
Рет қаралды 53 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН