Answer the question
In order to leave comments, you need to log in
How to properly design MYSQL for chat on node.js?
Hello.
You need to make an adequate chat on node.js as part of an application that will have its own goodies inherent in any normal chat. On this basis, a couple of questions arose:
1) Is it advisable to store the chat history in the form [sender] [recipient] [message] [Date and time] [was read?] in MySQL BD? If the chat is very popular, won't it create too high a load on the database? And what about the number of records that will grow there with great speed? After all, they will still need to be parsed at times in order to download the history of previous messages between users?
If correspondence was only possible between 2 people, then the previous option for storing data in the database would be perfect, since by the id of the user who sent the message and by the id of the user who received it + reading from the end of the database so that it would still be sorted by time can be easily get the history of correspondence of 2 people.
2) What if you add the ability to add people to a simple chat, from which it should automatically become a group chat? What is the best way to store messages from this chat in the database now if there can be many recipients now? And how to easily get history from this dynamically created group of members?
And the last question. It seems to be easier here, but it's still not completely clear.
3)The application already has groups that the user can join. A group is just a row in the database in the groups table that has an id, a name, and other parameters. You need to implement a general group chat. I imagine it like this: in each group, the database will store an array of user IDs that are members of this group as a string. I'm concerned about the size of this line as the band grows in popularity, which makes me think I'm doing something wrong. How to do it right? In addition, if I store the list of group members in this way, I will not be able to normally perform a SELECT query for a specific user to get an array of groups in which he is a member.
Answer the question
In order to leave comments, you need to log in
look in the files for something like
eval(base64_decode("DQpdfdu8Ggf9.*Q=="));
DQpdfdu8Ggf9.*Q== - это для примера, строка может быть другой
Check the content of the posts.
And the search may not help because the redirect can be obfuscated.
as an option to take a backup and compare the difference in files
Hello. Thanks for answers. The site redirected to: financenow.co/work-at-home-mom-success
It turned out that the problem was in the browser, or rather in the installed add-ons - deleted, cleaned, there is no more redirect.
Firefox browser
You are misreading the chat system.
Chats have rooms, inside the rooms there are messages and participants.
Tête-à-tête is a private room with 2 participants.
room
- id
- name
- private
participant (участник чата)
- id
- name
roster (список участников чата)
- room_id
- participant_id
history (история сообщений)
- id
- room_id
- participant_id
- timestamp
- type (тип сообщения, иногда нужны системные сообщения от ботов)
- text
- deleted
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question