Sharding Questions
Hello,
As my bot is nearly reaching the 2k servers. I need to prepare it to sharding but I have some questions to that :
As I use a system like that :
Then I get all the values I need from that const. But as sharding is splitting my code in multiple processes, to gain performance I want these to be centralized in one file and accessible for all the shards at the same time without them to have each one a copy of that data. I made this system to generate less database calls but if each process need to call the database and save his part I will need to change that.
Thanks !
3 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!I would’ve made a class that manages that
One that can cache stuff and make db calls only when necessary
You could also consider using Redis
Interesting, I'll try that, thanks
Well I think he's not really a resource gourmand but as it's a Music Bot I don't know how it will handle in more than 1000 calls at the same time
Yeah I know redis but I don't want to increase the amount of operation
Local files and distant files
Including Radio files