Rethinkdb 2.2 changefeeds with include_initial

For the simplest example, I can say that I'm pushing the list of my favorite dishes to everyone who signs up.

r.table('food').changes().run(conn, (err, cursor) => {
  cursor.each((err, change) => {
    io.emit('NEW_FAVORITE', change);
  })
})

Now let me say that I have 500 people who are actively watching me add my favorite products. What would be more effective, 500 people subscribed to 500 changes, each of which had include_initial, or 500 initial requests that were redirected to these people, and then 500 people watched 1 replacement? Bonus points to explain the reasons!

+4
source share
1 answer

, , 500 , , - , , 500 .

RethinkDB , , 500 . , , changefeeds , , changefeed 500 , .

include_initial , . , changefeed, , . include_initial .

( - , 500 A, RethinkDB B. , changefeed , B , , 500 . A B A, . - node A 500 node, RethinkDB node.)

+4
source

Source: https://habr.com/ru/post/1616984/


All Articles