Best chat data structure practices

Hi all,

About chat feature at Bubble app.

We have two data types (tables):

  • Conversations (List of threads)
  • Messages (List of messages linked to a thread)

Should we have under Conversation data type List of Messages or rather Messages data type full of Messages and than use Search for Messages to filter each Conversation messages?

As two users might accumulate messages in one thread to be more then 1000, etc., not sustainable, while with Search, we slow down (with extra WU) our app.

If you can share your best practices or other approaches?


Yes as you mentioned if there are too many messages in the thread ,then 2nd option is best as it separates the message storage from the conversation metadata, but requires an additional step to filter messages for each conversation.

1 Like

Thanks for the @reachvijayk79 acknowledgement here.

Anything more to add? Anyone? :slight_smile:

Nothing more to add… but for sure, don’t have a list of messages on the conversation datatype (do it the other way round).

1 Like