the messages sent in a large ammount of group chats.
For every message the bot receives, it querys a MongoDB database to get that group chat / gets also info about the user. These queries are very costly, what is a better alternative to this case? A Redis database?
Yes, redis might be better
Thanks for your answer 😄
Redis is great, but what's the problem with Mongo? I've used MySQL before for getting the user and chat information.
The problem is that if for each message I need to make 2 or more queries, it may cause serious performance issues
I'm talking about group chats, every message is queries
I don't think so.
Because it's not a huge usage! Yes, if you used Redis it will be more faster, because of Redis method for storing information.
Imagine my bot is in + 10.000 groups, and imagine each second is sent one message. That's 20.000 queries per second. That in the case it's 1 message per second and the groups can grow, are you sure?
One question: Does Telegram accept 10000 requests per second?
The requests are made to my mongodb database, not to telegram
You said 10000 groups, one message per second.
Yes, the messages I receive
Telegram API will handle all of this and sends the status to your script. I think it will block you in this situation.
Обсуждают сегодня