Похожие чаты

Hi guys, I'm developing a Telegram bot who reads all

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?

14 ответов

7 просмотров

Yes, redis might be better

Mikel- Автор вопроса

Redis is great, but what's the problem with Mongo? I've used MySQL before for getting the user and chat information.

Mikel- Автор вопроса
The Dreamweaver
Redis is great, but what's the problem with Mongo?...

The problem is that if for each message I need to make 2 or more queries, it may cause serious performance issues

Mikel- Автор вопроса
Mikel
The problem is that if for each message I need to ...

I'm talking about group chats, every message is queries

Mikel- Автор вопроса
Mikel
Why?

Because it's not a huge usage! Yes, if you used Redis it will be more faster, because of Redis method for storing information.

Mikel- Автор вопроса
The Dreamweaver
Because it's not a huge usage! Yes, if you used Re...

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?

Mikel
Imagine my bot is in + 10.000 groups, and imagine ...

One question: Does Telegram accept 10000 requests per second?

Mikel- Автор вопроса
The Dreamweaver
One question: Does Telegram accept 10000 requests ...

The requests are made to my mongodb database, not to telegram

Mikel
The requests are made to my mongodb database, not ...

You said 10000 groups, one message per second.

Mikel- Автор вопроса
Mikel
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.

Похожие вопросы

Обсуждают сегодня

А еще в перле можно уже @arr1 + @arr2?
Sergei Zhmylove
53
I arrived here after a Chico Crypto show highlighted the project & the Team - the fact that the Team had a long history of successfully working with household names gave me e...
Banter is Bullish
1
Привет всем. появился вопрос. Разрабатываю сайт, в данный момент он запущен. Хостинг beget. Добавляю на сайт яндекс метрику с помощью полей client-settings (взято отсюда http...
Andrew
2
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
;.686 ;Система команд процессора 686 ;.MODEL FLAT,stdcall ;Модель памяти плоская, стандартный ;вызов процедуры ;option casemap:no...
Егор Анелькин
1
Почему у макбука экран не сенсорный?
✨ Anatolii Cherednichenko
28
It's unfortunate that the "Then why are you here" or "lol you must've bought high" mantras always come up. I already tried bringing up this subject in the price channel but si...
Leroy Gerrits
4
Есть вопрос: допустим есть железка с каким-то интерфейсом(допустим usb), но как по этому интерфейсу железкой управлять неизвестно, прог нету, а управлять очень хочется надо. К...
Mixail Frolov
15
Is it a good price to buy hex now on 0,0019?
Patrick
29
Всем привет! подскажите пожалуйста как можно увеличить качество фото?
Evgeniy
19
Карта сайта