struggling to structure data in Firestore for a new social app, any tips for a noob?

Author
Sakura Sato Author
|
4 hours ago Asked
|
1 Views
|
0 Replies
0

hey everyone, really new to Firebase and trying to build my first social app. it's kinda overwhelming!

  • Context: just started building a simple social media app (think mini-Twitter) and using Firebase for the backend. it's my first dive into a proper NoSQL database, so bare with me.
  • Core Problem: i'm totally stuck on how to properly structure my data in Firestore, especially with relationships between users, posts, and comments. it feels like there are so many ways to do it, and i'm not sure which is best.
  • Specific Challenges I'm Facing:
    • Should i embed user data into posts/comments, or just use references? i'm worried about data redundancy vs too many reads when fetching a feed. i hear embedding can be good but also bad.
    • How to efficiently query for a user's entire feed or all comments on a post without tons of reads? like, if a user has 100 posts and each has 10 comments, that's a lot of docs.
    • i'm worried about hitting read/write limits or making things unscalable down the line if i get this wrong now. is there a general rule of thumb for this?
  • Seeking Advice On: best practices for data modeling in Firestore for social apps, particularly when dealing with many-to-many relationships or complex user feeds. any design patterns i should be aware of?

any advice for a complete beginner would be super helpful, thanks in advance!

0 Answers

No answers yet.

Be the first to provide a helpful answer!

Your Answer

You must Log In to post an answer and earn reputation.