psx
psxā€¢2y ago

How can I make tRPC+NextJs APIs faster? (db and functions region is already same)

Hi, I have migrated my website backend (https://clubofcoders.com) from NestJs + Prisma + Cloud Run to tRPC + Prisma + NextJs serverless functions. But I am not quite happy with the performance (screenshot is attached). The requests are taking up to five sec on first loads and 2/3 secs. afterward; I am using the same region for serverless functions and the database (planetscale). Hosted on vercel. Any ideas I can improve this?
ClubOfCoders - Learn to build production ready websites
Join ClubOfCoders and learn full stack development, Next.js, Tailwind CSS, Firebase, Supabase, TRPC, Prisma, TypeScript, React, AWS and more
5 Replies
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
PavidR
PavidRā€¢2y ago
Yep Iā€™m gonna ditch vercel for self docker hosting. Less scalable for sure but I cannot accept my app is taking so long to display so few data
Lu
Luā€¢2y ago
I can also say that Vercel has been surprisingly less performant than hosting it myself on digital ocean
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
psx
psxOPā€¢2y ago
I have figured this out, now I have deployed it on aws using a server less server. Fargate and stuff, using a service flight control hq, they have built a platform where we can deploy our applications without worrying about all aws complex stuff. Now website is 10 times faster šŸš€