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
UU
Unknown Userā€¢400d ago
P
PavidRā€¢400d 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
B
bā€¢399d ago
I can also say that Vercel has been surprisingly less performant than hosting it myself on digital ocean
UU
Unknown Userā€¢399d ago
P
psxā€¢395d 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 šŸš€
More Posts
Superjson "undefined"When returning a list from the db with a ton of potential undefined fields, superjson just crams a tThrowing fastify errors when using fastify adapterHello, I'm using `fastifyTRPCPlugin` from `@trpc/server/adapters/fastify` and trying to throw errorsConfused about createProxySSGHelpersIf you can use this helper inside of `getServerSideProps` without having `ssr: true` what is the difHow to check if data is being prefetched?What is a method to check if ssg prefetching actually occurs? Through the network tab?How can I access ctx from inside of a procedure?``` const appRouter = t.router({ helloTab: t.procedure.input(z.object({ url: z.string().url() })).Async User Call in `createContext` (context.ts) or in `isAuthed` (in trpc.ts)Hi all! Should I be getting the user in all requests via createContext in the following async call `'req' of undefined in onError of express middlewareI've recently noticed that I get a bunch of errors regarding req object missing in ctx for onError pMutations and Queries in React Contexts causing unexpected behaviorsIn my organization, we recently moved to put all of our mutations/queries into React Contexts and ouCustom error managementHey peeps! I could've sworn I created a GitHub issue about this, but I must've been dreaming, becauscontext questionWhy are the context examples only showing opinionated examples with next/react auth ? Also i find itasync middlewareis it possible to define an async middleware? I want to do something like this but it throws errors The type of the second route of the nested route is neverhttps://github.com/StringKe/nx-mulit-trpc-type-error/blob/main/apps/app1/src/pages/index.tsx#L12