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, thispostwith full information will be copied tousers-timeline(users news strip)/UID/postId: FULL INFOto allfollowersof thisuser. And every edit will edit each mention of thispost.Every time user adds new
post, thispostIDwill be copied touser-timeline(users news strip)/UID/postId: trueto allfollowersof thisuser. And every edit will edit only source post.
Which logic is better with Firebase?