T
tRPC

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

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

Ppsx4/6/2023
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?
UUUnknown User4/12/2023
Message Not Public
Sign In & Join Server To View
Ppavidr4/12/2023
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
Tturbina4/13/2023
I can also say that Vercel has been surprisingly less performant than hosting it myself on digital ocean
UUUnknown User4/13/2023
Message Not Public
Sign In & Join Server To View
Ppsx4/17/2023
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 šŸš€

Looking for more? Join the community!

T
tRPC

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

Join Server
Recommended Posts
Throwing 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#L12errorFormatter ignored when using appRouter.createCallerMy errorFormatter works correctly in the actual application using an adapter, e.g. ``` trpcExpress.