Please tell me how it is done correctly.
There are 2 users who can exchange messages and delete messages from visibility on their page.
I have the following structure:
id user to_user message date but it is also necessary that the user can delete messages from the chat, but the essence of the message itself remains.
I think this is done with 2 fields with boolean values, which would entail unnecessary queries. user to_user in essence there is no dialogue, there are only messages that connect and form a dialogue, which means there are 2 options: user to_user and to_user user .
** it is necessary that the user can delete the message, thereby the message becomes invisible for this user. but it is visible to his interlocutor.
In general, so as not to fence the city I appeal to you for advice)
Thank.
mysql, since it will be too fat for her when sampling. Or play with the types of tables and scaling. To implement soft deletion, make theis_removedfield, most frameworks contain ready-made behaviors for working with soft deletion. - DanielOlivouser_id. - Akina