Chat apps
hey there, im new here, i am wondering if its advisable to build a chat application (like whatsapp/telegram) using Convex. Coming from SQL background, i would understand if the
messages
table is inserted, it will trigger the real time update to all the users
chat (which is not good??)2 Replies
Yes chat apps are one of the recommended apps to build on Convex. The thing to remember is a query only does a realtime update if the data it read has changed. If there are multiple individual chats and a user is only looking at a single chat, then the query will only send updates when there is a new message in that particular chat.
Here's a demo project that has multiple channels (i.e. chats) https://github.com/get-convex/convex-demos/tree/main/relational-data-modeling . Note this project uses "filter" but to be more efficient you would want an index.
GitHub
convex-demos/relational-data-modeling at main · get-convex/convex-d...
Demo apps built on Convex. Contribute to get-convex/convex-demos development by creating an account on GitHub.
thank you for the clarification!