You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: adopt rethinkdbdash as our official JS/node driver #3771
There are a few things that we would need to change to be consistent with our other drivers:
not automatically coerce streams to arrays
think about whether we want to keep the connection pool (in its current form). See Explore a connection pool API in client drivers #281 (Probably we should just keep it. Even if our other drivers won't have one at first, it seems to be extremely useful in a node.js environment)
add a HTTP connection for the Data Explorer (edit)
rename the module
So we would probably have to fork it, but should make a serious attempt at diverging as little as possible to allow future patches to be shared between the projects.
(There might be some other differences to our official driver that I'm not aware of / forgot to mention.)
Reacted by Nadeem Bitar, will, Grant Carthew, chrismcc and Luke James
Alternately, we might look at integrating parts of RethinkDB dash into the official driver, depending on how much is different. (i.e. copy the connection pool and stream implementations etc), and leave RethinkDB dash as a bleeding edge driver that can try out experimental ideas
It's super silly and confusing to end users (like me 😜) to have two competing mostly official node.js rethinkdb drivers. (since @neuminois was a RethinkDB employee, I consider rethinkdbdash "mostly official"-- it's very different than someone random publishing another node driver.)
It's not like rethinkdbdash is just some sugar on top of the official driver, either -- it's a complete rewrite as far as I can tell, in a different language no less, which is kind of frightening.
Yeah I think just taking parts of it wouldn't quite work for the reasons @chrisvariety mentions.
(side note: @neumino is now at Google, but he's still maintaining and extending rethinkdbdash)
I don't think this would inherently solve #3600. Even though @neumino recently introduced streaming support, the cursor object itself still doesn't implement the Stream interface.
I do like the idea of making it the official driver, though!
I think forking rethinkdb-dash seems like a bad idea. One of the reasons it is good is because @neumino maintains it and knows the ecosystem well and doesn't hesitate to break compatibility with the other drivers.
Another thing to consider is that it would need to be adapted to run in the data explorer.
@marshall007 as far as I understand implementing the Stream interface on the cursor directly would be risky because of the special meaning of null in Streams (as discussed in #3600).
@AtnNn It would definitely be nice if we could avoid forking, but since we want to do some things differently there might be no way around it.
We could consider just maintaining a patch file and applying it to upstream rethinkdbdash. That way we would be less likely to diverge too far.
Also good point about the Data Explorer, I forgot that in my list.
It would probably be better if we could avoid porting rethinkdbdash to the browser. I'd imagine it would be much simpler if the browser sent the plain-text query to a separate (Node?) process which would evaluate the query and send the results back as JSON.
Something like that would allow all the HTTP stuff to be dropped from rethinkdb core and open up the possibility of supporting other languages in the Data Explorer in the future.
I'll probably take a stab at this and see how it goes if that seems reasonable to you guys.
Then rethinkdbdash has more features like streams, writable streams, connection pool etc, but it still strictly implement all the ReQL methods like the official driver (filter, update etc.)
However, it does not support HTTP connections, which is probably a blocking point now. Nothing prevents HTTP connections to be supported as far as I know.
I think it's still interesting to have a bleeding edge driver. I took me a few tries to implement writable/transform streams (this time 1.16.10 should be good), so it's still nice to have a playground for new stuff. For example, having run({stream: true}) doesn't make that much sense, but I still did it because I didn't think enough. The official driver doesn't have to fall in this pitfall.
@deontologician -- It's a decent effort to implement the connection pool. While I would love to say that I did it right on the first try, there were still a few bugs. If you add multiple servers on top of that, this gets tricky. The devil is in the detail :(
@chrisvariety -- rethinkdbdash is still maintained, and I think I'm still doing a decent job. If I'm not mistaken 1.16 was released on the same day as the server :)
It's probably a decent amount of work for @AtnNn and @larkost to switch driver. Backtraces are typically different in rethinkdbdash. Arity errors are returned by the driver if possible too.
@marshall007 -- yes cursors still exist for two reasons:
Also on a side note, the python driver is going to nicer/more Python-ish way to consume feeds. I think it's fine to have drivers "drift" a bit when it comes to cursors, feeds etc. as long as the ReQL method themselves stay the same.
Massive +1 for this, especially because you advertise your coffeescript driver as a javascript driver (which is not a problem until someone decides to poke around).
Also in the long-run maybe drop the bluebird dependency and use the 6to5 tool to use standard ES6 promises and possibly turn cursors in generators ?
That, or r()-constructed connection objects could be designed to pull double-duty, using their config object as an r.expr if called with an interface that only makes sense when used as r.expr(), and running a query when called in a way that would only work as r.connection(), just as an ugly compatibility hack until r()-as-expr's deprecation can fully take and be fully replaced. (The most frustrating thing would be that r()-as-either would have to defer the connection establishment to do this, in a way that r.connection() would not.)
If this was done, I think it'd also be important to start having rethinkdbdash start following semantic versioning. Currently npm defaults to ^ for versions, which leaves almost everyone using rethinkdbdash vulnerable to random breakage.
Most people who use rethinkdbdash have gotten used to this, but if the official driver suddenly moved to being non-semver during the transition that would likely cause a lot of confusion.
The official driver could be replaced by rethinkdb-ts instead of rethinkdash since it is maintained, still a drop-in replacement and up to date with the latest standards.
Activity
deontologician commentedon Feb 12, 2015
Alternately, we might look at integrating parts of RethinkDB dash into the official driver, depending on how much is different. (i.e. copy the connection pool and stream implementations etc), and leave RethinkDB dash as a bleeding edge driver that can try out experimental ideas
chrisvariety commentedon Feb 12, 2015
It's super silly and confusing to end users (like me 😜) to have two competing mostly official node.js rethinkdb drivers. (since @neumino
iswas a RethinkDB employee, I consider rethinkdbdash "mostly official"-- it's very different than someone random publishing another node driver.)It's not like rethinkdbdash is just some sugar on top of the official driver, either -- it's a complete rewrite as far as I can tell, in a different language no less, which is kind of frightening.
danielmewes commentedon Feb 12, 2015
Yeah I think just taking parts of it wouldn't quite work for the reasons @chrisvariety mentions.
(side note: @neumino is now at Google, but he's still maintaining and extending rethinkdbdash)
thelinuxlich commentedon Feb 12, 2015
+1 for this, rethinkdbdash is awesome.
marshall007 commentedon Feb 13, 2015
I don't think this would inherently solve #3600. Even though @neumino recently introduced streaming support, the
cursorobject itself still doesn't implement theStreaminterface.I do like the idea of making it the official driver, though!
AtnNn commentedon Feb 13, 2015
I think forking rethinkdb-dash seems like a bad idea. One of the reasons it is good is because @neumino maintains it and knows the ecosystem well and doesn't hesitate to break compatibility with the other drivers.
Another thing to consider is that it would need to be adapted to run in the data explorer.
danielmewes commentedon Feb 13, 2015
@marshall007 as far as I understand implementing the
Streaminterface on the cursor directly would be risky because of the special meaning ofnullin Streams (as discussed in #3600).@AtnNn It would definitely be nice if we could avoid forking, but since we want to do some things differently there might be no way around it.
We could consider just maintaining a patch file and applying it to upstream rethinkdbdash. That way we would be less likely to diverge too far.
Also good point about the Data Explorer, I forgot that in my list.
marshall007 commentedon Feb 13, 2015
It would probably be better if we could avoid porting
rethinkdbdashto the browser. I'd imagine it would be much simpler if the browser sent the plain-text query to a separate (Node?) process which would evaluate the query and send the results back as JSON.Something like that would allow all the HTTP stuff to be dropped from
rethinkdbcore and open up the possibility of supporting other languages in the Data Explorer in the future.I'll probably take a stab at this and see how it goes if that seems reasonable to you guys.
neumino commentedon Feb 13, 2015
A few thoughts:
https://github.com/neumino/rethinkdbdash#drop-in
In the end by setting the appropriate default, things will work out of the box like the official driver.
The differences after that are almost none. The only one I can think of is that fields that map to
undefinedare just drop in rethinkdbdash and that there is no option for that -- The official driver should probably do it too, see JS driver - ignore undefined fields in MakeObject #2233Then
rethinkdbdashhas more features like streams, writable streams, connection pool etc, but it still strictly implement all the ReQL methods like the official driver (filter,updateetc.)However, it does not support HTTP connections, which is probably a blocking point now. Nothing prevents HTTP connections to be supported as far as I know.
run({stream: true})doesn't make that much sense, but I still did it because I didn't think enough. The official driver doesn't have to fall in this pitfall.nullvalues like @danielmewes mentionnedjoaojeronimo commentedon Feb 13, 2015
Massive +1 for this, especially because you advertise your coffeescript driver as a javascript driver (which is not a problem until someone decides to poke around).
Also in the long-run maybe drop the bluebird dependency and use the 6to5 tool to use standard ES6 promises and possibly turn cursors in generators ?
thelinuxlich commentedon Feb 13, 2015
Don't do that, native promise is slower!
8 remaining items
stuartpb commentedon Jun 25, 2015
That, or
r()-constructed connection objects could be designed to pull double-duty, using their config object as anr.exprif called with an interface that only makes sense when used asr.expr(), and running a query when called in a way that would only work asr.connection(), just as an ugly compatibility hack untilr()-as-expr's deprecation can fully take and be fully replaced. (The most frustrating thing would be thatr()-as-either would have to defer the connection establishment to do this, in a way thatr.connection()would not.)chrisfosterelli commentedon May 12, 2016
If this was done, I think it'd also be important to start having rethinkdbdash start following semantic versioning. Currently npm defaults to
^for versions, which leaves almost everyone using rethinkdbdash vulnerable to random breakage.Most people who use rethinkdbdash have gotten used to this, but if the official driver suddenly moved to being non-semver during the transition that would likely cause a lot of confusion.
deontologician commentedon May 12, 2016
@chrisfosterelli I agree we should use semver, but for the record, the official driver doesn't use semver either (unfortunately)
chrisfosterelli commentedon May 12, 2016
Ah, sorry my bad! Never noticed dependency issues so I assumed :)
On Thu, May 12, 2016, 1:04 PM Josh Kuhn [email protected] wrote:
danielmewes commentedon May 16, 2016
@chrisfosterelli Also see #5625
gabor-boros commentedon May 22, 2020
The official driver could be replaced by rethinkdb-ts instead of rethinkdash since it is maintained, still a drop-in replacement and up to date with the latest standards.