mercredi 29 juin 2016

How to make my users-friends-groups-messages database design more efficient? [on hold]


I created a database design but the tables messages and gp_messages are redundant.

in single user chat i can store message in message table as there is 1 sender and 1 receiver

but in group chat where there is 1 sender and many receivers it stores data redundantly in message copy table with same message_id

For example in a group chat there will be a common message_id(for each user in group) that will keep on repeating in the message copy table

//UPDATE : i removed the primary key in message copy table cause cannot store redundant messages

also i have 2 tables to store messaged i want only one table to make my DB design more efficient

I want to combine those. Any tips on how I can do that?

This is a screenshot of the scheme:

enter image description here A blue line in the image is a foreign key.


Aucun commentaire:

Enregistrer un commentaire