Question:
How to create a social network "feed" with Firebase as a backend that scales?
Possible answers:
"MVP" is the design of the root child feeds, one for each user, and the addition of a new message from the next user in each subscriber channel.
users
user1
name: bob
user2
name: alice
follows:
user1: true
posts
post1
author: user1
text: 'Hi there'
feeds
user2
post1: true
This works well and is demonstrated in the project Firefeed. But this is not very good: if Katy Perry wants to publish something, her mobile phone will have to write millions of feeds.
Therefore, the solution reported in this SO question passed this operation to the server process.
, Firebase - "-backend" , , , , .
, feeds ?
:
baseRef.child('posts')
.orderBy('author')
.whereIn(baseRef.child('users/user2/follows').keys())
, whereIn Firebase API, : (
?