Database design - groups chat - seen messages
An alternative would be to not add those rows right when the message is created, but add a row whenever a user actually reads the message. Then you can omit the seen flag &ndash; the existence of the row is enough to know that the user saw the message.

That has two advantages:


fewer table rows
no extra work when a user joins a group

With your design, adding a user to a group requires adding a row for every message written by someone in the group.