Data Fields for Messaging System

Hello, I

FIrst of all, i’m sorry because this might be a very basic question, but i’m confused because of a suggestion i had. I’m building a simple messaging system(the one you have lets say in a recruiting company). The data fields i have are content(text), sender(user), receiver(user), timestamp(date) and read(Yes/No). Am i on the right track?

You need two data types:


  • Users (List of Users) - this these are the users who should have access to the thread


  • User (User) - who sent the message
  • Read users (List of users) - users who have read the message
  • timestamp (date) - when the message was sent
  • content (text) - what is the message
  • Thread (Thread) - which thread/conversation is the message part of

There are two ways to go about privacy rules:

  1. Add a List of Users on the Message that includes everyone in the thread/conversation so that if Current user is in List of Users they can view the message. The downside is that if you change the users in the conversation then you need to modify every message’s list of users so they can view the full chat history.

  2. Enable ‘find this in searches’ for everyone for Message (don’t enable any of the fields for everyone) and enable access to fields when This Message’s Thread’s Users contains Current user. This is easier to manage but means that anyone with technical know-how could find out how many messages are on your website (they can see the message’s unique ID but nothing else).

So, yes, you’re definitely on the right track :slight_smile:

1 Like

Thank you!