Back

What variant of storing liked announcements to choose? Suggest ur own variant too!

  • 0
  • Android
  • Self Hosted
  • Users
makcik
27 Mar, 2023, 13:02

hi, can you give me some advice about my current project. I have two collections, the first stores all announcements(several attributes(name, price, id...)), the second(own for each person) needs to store liked announcements(with several attributes(name, price, id...)) or only ids of liked announcements. Which variant is better to get list of announcements(with pagination) =>1) bring ids of liked announcements and specify every from the first collection or 2) to to store already liked announcements in the second collection(we will have same attributes in 2 different collections)? Is it significantly longer for user to wait for all requests from server like in 1st variant?

TL;DR
The user is seeking advice on how to store liked announcements in their current project. They have two options: 1) Storing only the IDs of liked announcements and retrieving the rest of the data from the first collection or 2) Storing the entire liked announcements in a separate collection with the same attributes. The user is concerned if the first option will result in longer wait times for the user. There is no solution provided in this support thread.
joeyouss
27 Mar, 2023, 13:37

hey, thank you for shifting it here!

rafagazani
27 Mar, 2023, 13:44

I would do a third collection, "liked announcements". It would hold the user id and ad id. I would use pagination. Storing the ids is a good way. In the next versions (https://github.com/appwrite/appwrite/discussions/5179) we will have a type of foreign key, in a single query you can bring all the data

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