#Can I create a message system with Supabase?

1 messages · Page 1 of 1 (latest)

sonic geode
#

I am trying to create a DM function using Supabase in a Remix project.
However, I feel that if I create a Message table in Supabase and store the sent messages there, the SQL execution speed will slow down as the volume of messages increases.
Is true what I'm feeling?

wanton atlas
#

technically yes, the more data the slowest it will be

but that's why you should add an index to the columns used to filter the data, so when you query your DB you don't iterate all the rows, only the ones you actually need

e.g. if you add a conversation_id column to the messages tables, and add an index in that column you can then query by conversation, a conversation is unlikely to have a lot of messages, and even it if does have a lot of messages you can paginate them so you only get a subset of those message each times

fluid forum
#

it's kind of pointless

#

unless you have millions and millions of messages you're not going to have much of an issue. and even then , you are going to be using queries to get messages by user id, you're going to have pagination as well. you are not likely to be doing a full blown search on all messages, that's what would be slow.