Skip to content

Make webui a standalone application #3861

Open

Description

@deontologician

Following a brief discussion on slack, we should investigate making the webui a standalone application, which the server might spawn as a subprocess for convenience.

Overall pros:

  1. Remove special http handling code from the server
  2. Remove http backend from the js -driver
  3. Make it easier to add functionality like websockets etc
  4. The UI needn't formulate its queries as reql, it could just hit a websocket endpoint for a specific query.
  5. The webui could stand as a fairly extensive example of a realtime app built on rethinkdb that:
    • makes use of almost all of its capabilities
    • is architected like a user would actually architect their app (vs. special pleading that only the webui should use the http interface)
    • is kept up to date by necessity, vs. example code that bitrots over time
  6. Might offer more flexibility, spinning up the webui server when necessary on whatever machine you wish, vs. needing to open the webui port on the server machine.

Overall cons:

  1. Possible the server & webui could get out of sync
  2. Building the server backend in node or something would add large runtime dependencies.
  3. If backend is in python or something non-js it would need some extra logic to parse the queries coming in through the data explorer.

Pros to backend in python:

  1. we already have a python runtime dependency (I believe), so a small server wouldn't be a large runtime dependency

Pros to a Node backend:

  1. Could hack around having to parse js on the frontend for the data explorer by being a passthrough to the backend js driver.
  2. The majority of our users are using node.js

Activity

  1. added this to the backlog milestone on Mar 2, 2015
  2. danielmewes commented on Mar 2, 2015

    @danielmewes
    Member

    Putting into backlog for now because I think there's not a sufficiently strong need for this at the moment, compared to the effort it is to change this.
    Once we find that we really need additional features in the HTTP server we should reconsider this.

  3. larkost commented on Mar 2, 2015

    @larkost
    Collaborator

    I don't believe that we have Python runtime dependency in the server. We do have that dependency for building some components, and for testing (even aside from testing the Python driver). So making it in Python would be a new dependency.

    If we go down this route I would vote to build it in C/C++ with the V8 engine and whatever embeddable http server library we want (there are lots of them). This probably would not be that difficult a task.

  4. marshall007 commented on Mar 3, 2015

    @marshall007
    Contributor

    Agreed, I mentioned this over in #3771 (comment). Another "pro" not mentioned here is that this would open up the possibility of making the data explorer language-agnostic in the future. In addition to what @danielmewes said, if rethinkdbdash becomes the official driver that would also be a good opportunity for a re-write.

  5. deontologician commented on Mar 3, 2015

    @deontologician
    ContributorAuthor

    I think the difficulty with making the dataexplorer language agnostic is
    that we'd need to create a python/ruby parser and serializer in js. Though
    there may be simple parsers out there already. I do think it'd be killer if
    we could do that eventually though

    On Mon, Mar 2, 2015 at 5:03 PM, Marshall Cottrell [email protected]
    wrote:

    Agreed, I mentioned this over in #3771 (comment)
    #3771 (comment).
    Another "pro" not mentioned here is that this would open up the possibility
    of making the data explorer language-agnostic in the future. In addition to
    what @danielmewes https://github.com/danielmewes said, if rethinkdbdash
    becomes the official driver that would also be a good opportunity for a
    re-write.

    —
    Reply to this email directly or view it on GitHub
    #3861 (comment)
    .

  6. neumino commented on Mar 4, 2015

    @neumino
    Member

    Could hack around having to parse js on the frontend for the data explorer by being a passthrough to the backend js driver.

    This doesn't quite work since most of the time you have an incomplete query, and therefore can't really call eval on it to get the last term.

    That being said, I think it's a good thing to eventually take out with web ui from the server for the reasons mentioned before.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions