mattkrick / meatier

:hamburger: like meteor, but meatier :hamburger:
3.05k stars 172 forks source link

play with streaming graphql results #50

Open mattkrick opened 8 years ago

mattkrick commented 8 years ago

probably needs to be a REALLY big json to be a net win, but for something like relay that aggregates queries in 1 HTTP roundtrip, this could get interesting... https://jakearchibald.com/2016/streams-ftw/

brownish commented 8 years ago

I could see this being very useful for huge geospatial datasets. I'm implementing mapping soon and will definitely attempt to stream the json from rethinkdb.

wenzowski commented 8 years ago

Is this issue specifically about streaming queries? I don't think we have to worry about subscribe because each document is emitted separately, but we could easily have a large json list of notes. Expecting a few thousand items on each kanban isn't unreasonable.

In my opinion this is worth exploring so we can pass backpressure through to the database, though it probably means going around the official rethinkdb client with something like JSONStream

mattkrick commented 8 years ago

nah, this is all about client-side streams. keeping the DB and server in physical proximity, it'll probably never be the bottleneck since it dedupes subscription documents before it sends them over the wire. If it is, RethinkDB has some really simple proxying available to reduce the load of a distributed system. I haven't had this problem though so I'm not the best person to ask about it.

cometta commented 8 years ago

just sharing, facebook recent update to subscription in graphql using @live keyword https://www.youtube.com/watch?v=ViXL0YQnioU&feature=youtu.be .

mattkrick commented 8 years ago

@cometta thanks for sharing! it just so happens subscription support will be my next sprint on https://github.com/mattkrick/cashay. It really is the wild west for real-time updates, so don't be shy if you've got any good patterns you'd like to share!