M
M
Maxim Timofeev2016-03-28 13:00:05
PHP
Maxim Timofeev, 2016-03-28 13:00:05

How to store chat?

There is a project. In some ways, the structure is similar to social networks. There are people, there are groups. You can chat within groups. The question is how to store chats so as not to overload the server.
I see three options, maybe there are more, help me choose the right one
1. store in the muscle
2. for each group a separate file txt, xml or something else
3. use the chat from VK and not soar your brain
What to choose? Chat is text only and without special features like history search, attacha, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
O. J, 2016-03-28
@webinar

Store everything in the database.
Users are a separate table, groups are a separate table. And an intermediate table of relationships between entities is used with relational databases and "many-to-many" relationships.
And you can store chat messages in one table. Which can then be linked to an intermediate table msgid | user | group
And when implementing a chat backend, you just specify which users belong to the group in which the chat is started.
https://habrahabr.ru/post/193380/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question