Skip to content

Proposal: adopt rethinkdbdash as our official JS/node driver #3771

Open

Description

@danielmewes

@neumino's rethinkdbdash has a lot of interesting features that our official JS driver doesn't currently provide.
Among them:

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.)

Activity

  1. added this to the 2.1 milestone on Feb 12, 2015
  2. deontologician commented on Feb 12, 2015

    @deontologician
    Contributor

    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

  3. chrisvariety commented on Feb 12, 2015

    @chrisvariety

    It's super silly and confusing to end users (like me 😜) to have two competing mostly official node.js rethinkdb drivers. (since @neumino is 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.

  4. danielmewes commented on Feb 12, 2015

    @danielmewes
    MemberAuthor

    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)

  5. thelinuxlich commented on Feb 12, 2015

    @thelinuxlich

    +1 for this, rethinkdbdash is awesome.

  6. marshall007 commented on Feb 13, 2015

    @marshall007
    Contributor

    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!

  7. AtnNn commented on Feb 13, 2015

    @AtnNn
    Member

    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.

  8. danielmewes commented on Feb 13, 2015

    @danielmewes
    MemberAuthor

    @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.

  9. marshall007 commented on Feb 13, 2015

    @marshall007
    Contributor

    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.

  10. neumino commented on Feb 13, 2015

    @neumino
    Member

    A few thoughts:

    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:
      • support null values like @danielmewes mentionned
      • stay relatively close to the official driver
    • 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.
  11. joaojeronimo commented on Feb 13, 2015

    @joaojeronimo

    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 ?

  12. thelinuxlich commented on Feb 13, 2015

    @thelinuxlich

    Don't do that, native promise is slower!

  13. 8 remaining items

  14. stuartpb commented on Jun 25, 2015

    @stuartpb

    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.)

  15. chrisfosterelli commented on May 12, 2016

    @chrisfosterelli

    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.

  16. deontologician commented on May 12, 2016

    @deontologician
    Contributor

    @chrisfosterelli I agree we should use semver, but for the record, the official driver doesn't use semver either (unfortunately)

  17. chrisfosterelli commented on May 12, 2016

    @chrisfosterelli

    Ah, sorry my bad! Never noticed dependency issues so I assumed :)

    On Thu, May 12, 2016, 1:04 PM Josh Kuhn [email protected] wrote:

    @chrisfosterelli https://github.com/chrisfosterelli I agree we should
    use semver, but for the record, the official driver doesn't use semver
    either (unfortunately)

    —
    You are receiving this because you were mentioned.
    Reply to this email directly or view it on GitHub
    #3771 (comment)

  18. danielmewes commented on May 16, 2016

    @danielmewes
    MemberAuthor
  19. modified the milestones: backlog, on May 22, 2020
  20. gabor-boros commented on May 22, 2020

    @gabor-boros
    Member

    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.

  21. removed this from the milestone on May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions