can u make twitch clone with t3 stack
im just curious if this is possible or not and would the performance be acceptable?
not asking how to do that
3 Replies
the t3 stack is a base, you can add almost anything you want to it so yes
but no you wouldnt handle video stuff over trpc
The frontend for sites like twitch, and most of the FAANG websites are built in react, and next is bleeding edge in terms of creating performant react builds.
If you're talking backend wise, no you likely wouldn't be using node to handle video streaming at twitch level.
Node is best used on non-CPU heavy tasks (those with lots of IO, I.E waiting for network responses, or DB calls are best) due to it being single threaded (multi-threading support is possible, but not its strength and is somewhat an after thought currently)
Since encoding is a CPU heavy task (although it may be GPU, or the likes of Youtube even use dedicated hardware these days), you would be better using something like golang which has multi-thread primitives out the box.
As yoers said, streaming video is a very challenging task and one that entire companies/teams are built around. Even ping.gg uses a 3rd party provider for the actual "streaming" part of ping, while they make it user friendly w/ the UI, inviting guests and other functionality, OBS support, etc.