2

My UI needs to support the following functionality:

  1. Users can follow other users
  2. A user can like a post
  3. A user needs to see on ONE page all posts that any of the users they follow (and/or themselves) have liked, including who, how many, etc

Users will be accessing this data and liking frequently so the implementation should ideally minimize the amount of writes & reads needed whenever a user views posts or likes a post.

What would be the best way to structure my Firestore database to support this functionality?

Note: I understand that a relational DB would be better suited for this, but I am trying to stick with Firebase to reduce the amount of code I need to support/develop.

Caleb Friden
  • 200
  • 2
  • 8
  • 1
    Check **[this](https://stackoverflow.com/a/52153332/5246885)** out. I think it might help you ;) – Alex Mamo Mar 16 '19 at 11:00
  • Thank you, that was helpful. Seems like a lot of queries are needed to get the data I want with that approach though. +1 query for every user followed. – Caleb Friden Mar 16 '19 at 16:34

0 Answers0