Do I need to implement sharding for a bot hosted on Heroku? Do I need to implement sharding for a bot hosted on Heroku? heroku heroku

Do I need to implement sharding for a bot hosted on Heroku?


According to the official Discord.js guide, sharding is only necessary when you deal with 2,500+ servers. I host my bot on heroku and it has a pretty good connection so far, however it isn't handling anywhere near the amount of requests you talked about (about 350 active users in around 200 guilds atm).

As I said: I can't speak from experience but in theory this should work out fine as the work will be split between the several shards for the Discord API requests and the heroku container.


It's necessary to shard after 2,500 servers because the code won't be able to serve all these guilds alone, I suggest you use sharding and especially the traditional type not the internal as it's known for its scalability. This will require a lot of changes to your code for it to manage child processes for multi guilds, but if your bot is not in 2,500 servers yet just don't shard because you don't need to, at all... you can read more about sharding and its styles here