(no title)
chrisduesing | 11 years ago
I guess my question is why would this be a preferred solution? It seems to run afoul to the 'one job' design goal. What am I missing?
chrisduesing | 11 years ago
I guess my question is why would this be a preferred solution? It seems to run afoul to the 'one job' design goal. What am I missing?
danielmewes|11 years ago
- You don't have to write logic to figure out which clients need to be updated with some data. You just run the queries that you need to to generate the data for the client, and then RethinkDB sends you an update only if the result of that specific query changes.
- Having the thing that modifies the data send the updates to the connected clients becomes increasingly difficult if you have multiple application servers. Then you would need to set up some separate message passing / broadcasting infrastructure if you also want to update clients connected to other servers. RethinkDB takes care of "passing the news around", even in a distributed environment.
- RethinkDB supports changefeeds not just on the raw data, but also on transformations of the data. Not all transformations are supported yet (for example map reduce queries are not), but our goal is definitely to support changefeeds on pretty much any query. Just knowing that the underlying data has changed isn't enough. In a traditional setting, you would still need to either recompute the whole query, or implement your own logic for incrementally updating their results for every type of query you want to run. RethinkDB updates query results incrementally and efficiently.
(I work for RethinkDB)
chrisduesing|11 years ago
In the case of an exchange I never split a single order book across multiple servers, but I can imagine a lot of applications where this could be an issue. How do you handle data consistency across nodes? Ultimately you have to solve the same issue...
Again, this isn't a big limitation for my use case. That said your answer has certainly given me a greater understanding of other circumstances where it would be very useful. Thank you.
mglukhovsky|11 years ago
coderzach|11 years ago
This is a preferred solution because the only efficient alternative is to inspect every insert or update, manually determining which clients care about those changes.
tracker1|11 years ago
Rapzid|11 years ago
danielmewes|11 years ago
We feel like for many queries (especially the ones you find in web applications) that's not a big deal, since you can efficiently re-run them after reconnecting. In other cases it definitely matters, and we are going to add what you describe in a future release. You can follow the progress (or chime in if you like) at https://github.com/rethinkdb/rethinkdb/issues/3471 .
chrisduesing|11 years ago
coffeemug|11 years ago
- https://github.com/rethinkdb/rethinkdb/issues/3579
- https://github.com/rethinkdb/rethinkdb/issues/3471
EDIT: danielmewes beat me to it.