0

There are many questions available for the firebase chat structure.

But I cant figure out how to structured in supabase.

As I think,

case 1: In one table store every message of all chat room. In this case billions of row will inserted of message.

case 2: create table named (unique id of chat room of two users) of each chat room. In this case many tables will created in project.

case 3: suggestion of other structure

tailor
  • 373
  • 4
  • 19
  • Case 1, using table partitioning, partitioned by something (could be the chatroom-id, but also per month or something else) would be my first shot when expecting billions of records. – Frank Heikens Sep 09 '22 at 14:48
  • in case 1 , how to store messages of two users in one column? – tailor Sep 09 '22 at 14:53
  • I have a table for channels and another for messages. But this question depends on implementation/scope decisions and it is not suited to StackOverflow. – Mansueli Sep 09 '22 at 14:53

1 Answers1

0

You can take this as an inspiration, goes more into case 1 direction:

https://supabase.com/blog/flutter-tutorial-building-a-chat-app https://supabase.com/blog/flutter-authentication-and-authorization-with-rls

Ben1980
  • 186
  • 1
  • 3
  • 15