Database design - groups chat - seen messages I have an application in which users form groups and chat together. One of the features is the well known "this message was seen at {some date here} by user {some user}". My concern is whether I've designed this correctly as with my current implementation database grows really fast in size. 

My approach is really simple. Once a user sends a message to a chat group, assuming there are N memebers in that group, N - 1 rows are created in chatMessagesSeen table. 

Columns of that table are id, messageId, userId, groupId, date and seen. Last column is a flag used to store whether the message was seen. So that's 4*4+8+1 = 25 bytes per entry. Pretty large chat groups are common, so 100 members in one room is nothing exceptional.  

I'd very much appreciate if anyone could share experience with a similiar problem, what should I take into consideration and whether there are any better ways to do this (sure they are, right). I wonder how giant social sites with this feature handle the problem.
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.