When should I not use tRPC

Hi, I'm fairly new to using tRPC, and was wondering what are some situations that would benefit to having a dedicated server to handle those tasks rather than tRPC to handle those scenarios. The only major thing I can think of is Websockets
30 Replies
cje
cje2y ago
not being all in on typescript having more than 1000 endpoints having data that is very graph shaped having external consumers of your api having specific performance requirements
NinjaBunny
NinjaBunnyOP2y ago
in other words just use tRPC lol
whatplan
whatplan2y ago
...if you have a small-medium sized ts monorepo
H
H2y ago
adding to the list having to send files to backend endpoints
whatplan
whatplan2y ago
presigned-urls go brrr
scinorandex
scinorandex2y ago
This is one of the problems I solved in my trpc like thing, and currently they're working on supporting file uploads too using multipart uploads Anything that abuses typescript generics to the extent that trpc does will eventually reach issues with typechecking, so your tsserver will be constantly in a loading state especially if it's resolving prisma types too
theo (t3.gg)
theo (t3.gg)2y ago
If you need to actually process files on a server yourself, 1. you probably don't and 2. if you actually do you should do that on a very specific deployment lol, don't touch your damn application api with that cursed super specific bullshit correct take
jingleberry
jingleberry2y ago
Cron jobs will need a dedicated server (or use upstash)
Neto
Neto2y ago
vercel has a service around that, even if its just calling a api route (same as upstash)
scinorandex
scinorandex2y ago
omw to check if s3 costs money
Neto
Neto2y ago
s3 costs money
scinorandex
scinorandex2y ago
fuck
Neto
Neto2y ago
but unless its heavy trafic price is very fine without considering caching (vercel) $0.023 per GB (storage) $0.09 per GB (transfering from s3 to internet)
jingleberry
jingleberry2y ago
Cost of s3 is negligible… costs pennies unless you’re throwing heaps of stuff at it
scinorandex
scinorandex2y ago
can I self host it on a esxi container with 5TB storage attached to it i have no money or mode of payment but I have access to a friend's esxi cluster so if I can self host an s3 compatible thing
whatplan
whatplan2y ago
wasabi is wild highly reccomend its like $0.005/gb/month no additional fees for api calls
ethan
ethan2y ago
look at minio
Jaaneek
Jaaneek2y ago
How should we approach validating files? For example I want to make sure that no NSFW pictures or mostly pictures of faces are used for avatars on my website, how else can I approach it if not processing them on server? What usually developers do when someone uploads a picture of Stalin as their avatar? Do they just go with it and hope that griefers won't do it too much?
theo (t3.gg)
theo (t3.gg)2y ago
Use a service. You can’t solve this problem yourself.
Jaaneek
Jaaneek2y ago
Could you elaborate further? What kind of service? Btw do developers usually ignore this and let users upload anything they want? Maybe some useful articles that you have in mind on this topic? I would like to learn more about how to approach this. In my company when we ship production apps we basically ignore this altogether and use presigned URLS without any validation but I believe this is not the best/correct practice and would love to learn the correct one
Neto
Neto2y ago
Upload file to S3, trigger a lambda that check image/file content, do whatever it needs based on that As a example
cje
cje2y ago
Unless you’re planning to write your own machine learning algorithm that reliably flags nsfw pictures without too many false positives (good luck on that!!!) you need to use an external service for this. Whether or not you need to check for this type of stuff depends on the type of app Social network? Should probably check! Planning system for a construction company? Maybe not
Jaaneek
Jaaneek2y ago
Can you elaborate further, which service? Any Articles/videos on that? I will let people have public profiles that are shareable but are not really a social network
Neto
Neto2y ago
i think cloudinary offer a service like that
cje
cje2y ago
There’s a bunch of different companies that offer ai/ml based services for this. I’ve never used any of them so no idea how they compare.
Neto
Neto2y ago
aws has its marketplace
Neto
Neto2y ago
as a example they have their own "nfsw" detection service kinda
Neto
Neto2y ago
Jaaneek
Jaaneek2y ago
Thanks
Want results from more Discord servers?
Add your server