I have a database with posts
, users
and other nodes like classic social-media app.
I'm continuing implementing best-practices to my application. And now I want to rewrite my news strip (posts of users, that I follow (like home tab in Instagram)).
I have read some info about fan-out
strategy and now I'm confused in how to do it properly.
So, I have 2 opportunities:
Like here: Every time user adds new
post
, thispost
with full information will be copied tousers-timeline(users news strip)/UID/postId: FULL INFO
to allfollowers
of thisuser
. And every edit will edit each mention of thispost
.Every time user adds new
post
, thispostID
will be copied touser-timeline(users news strip)/UID/postId: true
to allfollowers
of thisuser
. And every edit will edit only source post.
Which logic is better with Firebase?