rohan
rohan
DIAdiscord.js - Imagine an app
Created by rohan on 4/15/2025 in #djs-questions
What's the most effective way to handle hundreds (300+) of users who join a single VC to be sorted?
The requirements:
- User joins Voice Channel A - Voice Channel A will have hundreds of users join at once - Each user will need to be filtered (based on internal data from a database, have a local cache with sorting information) to another voice channel - There are currently 4 voice channels to be sorted to, channels B, C, E, F, with possibilities of expansion in the future
The questions: - Is sharding an effective solution to this? I thought I read somewhere that sharding was only to load balance servers (i.e. 1 server with 20K users will be balanced to 4 servers with 5K users as a crude example). Would it be effective for a single server with hundreds of active concurrent user(s) who load it? - When sharding (I'm very ignorant on how sharding works, am currently doing some reading) but does it open multiple connections on the same hardware, or will I need to spin up more servers/instances? - Should I be using the voiceStateUpdate event to check when members join/leave in this case? Is the voiceStateUpdate event even an effective event to look at or am I missing something that is a lot more effective/efficient? - If not sharding, I can implement a FIFO queue, but it would be slow I imagine, since I would have to rate limit myself- are there any recommendations/options to maybe bulk move users? (i.e. users 1-10 need to all be moved to Voice Channel C`) - Is what I want even possible?
28 replies