Back

Database Design (friends)

  • 1
  • Databases
  • General
Mugi
4 Jun, 2024, 12:20

So somewhat generic question, I was wondering how would you handle friend system with option to send friend request with Accept/Reject, also viewing profile of another user and so on. What I have in mind is 2 ways. Creating a table user and when user register it populated that custom table as well to later use for relation purposes and.

or by storing sender user id and receiver userid with status. And viewing profile via Id by using custom appwrite function.

Or using table with only public data that will get populated on register. what approach would you take since app is heavily related around user interaction with each other, chat , calls, channels and so on. Thank you !

TL;DR
Design a friend system by creating a table that stores sender and receiver user IDs with status (accept/reject). Use custom appwrite functions for viewing profiles via ID. Populate a separate table with public user data on registration for easier access. This will help facilitate user interaction features like chats, calls, and channels within the app.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more