-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: future architecture for scale and efficiency #8
Comments
Hi, In the future, I want to have only EventSub connection with Twitch. So when a user changes the stream title or game, Twitch send the bot a message using this event. |
In terms of approach, here's a few random bulletpoints that I can expand on for anything interesting.
I just saw your reply come in as well so few more thoughts before hitting submit :)
|
Also
|
Hi,
Bit busy to reach out in Discord at the moment, but wanted to share my thoughts on how to scale the bot and make it more efficient.
I'd suggest using pm2 to scale the threads and breaking it up into three microservices, this diagram explains my thoughts. We'll use a sticky session technology on the web-ui workers so we don't have to do full sessions since the website isn't all that busy in comparison to the events and discord stacks. It can be scaled by adding more workers, one per vcpu.
You could possibly combine the web-ui with one of the other microservices. Logically speaking it would make sense to do that with the discord, as it'd remove the need for the internal alert api, however that's also the one likely to experience the most load/scaling issues, so possibly best to avoid that.
I've also excluded a database table for "currently live" streamers, however a simple async started when a online is received which checks the database every 15(?) minutes for changes to category or title until an offline is received would handle that.
The text was updated successfully, but these errors were encountered: