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
@nviennot's pull requests inspired me to look at ruby driver performance a bit more, and I don't think we can really make the driver fast until we move off of it's protobuf library.
I've looked, and there doesn't seem to be a better one available. I think the best option right now would be to add a JSON API to the server. (This will also allow third-party driver writers without access to fast protobuf libraries to benefit.)
I think if its in before or for the LTS would be a big thing. If it comes after LTS people are going to build there apps maybe build more community drivers that would follow protobufs and then be at a disadvantage. When you say json api do you mean how the json will be formed and it will be the same underline protocol or both things will change.
I mean "you won't need protobufs to talk to the server any more". The format of the JSON document you send will probably map pretty closely to the current format of the protobuf you send. (I think we may also support protobufs for a few versions as a deprecated feature so that people's drivers don't immediately break.)
I know this sounds really dumb but i know some languages have there own serialization format which can be faster for them then it is to use things like json. I think php just calles it serialization and python has pickle. I guess it would be a lot to support all of them but may be much faster in some languages then there existing json implantation.
I think we may also support protobufs for a few versions as a deprecated feature so that people's drivers don't immediately break
Question: are you talking about completely replacing the protobuf API on the server with a JSON API, or are you referring to the Ruby drivers specifically here?
@orthecreedence -- I think the current plan is for the server to support both a protobuf API and a JSON API for a few versions, with the protobuf API marked as deprecated. The protobuf API would then be removed at some point in the future.
To be honest protobufs made us a bit jaded. It's a well-supported library from Google that's broadly adopted, and it sucks. Before we switch to another library we'd have to test the living hell out of it, which is a lot effort. Alternatively we can just pick json which we know works, is supported everywhere, and is very fast. That seems like a path of least resistance that we know will work.
@coffeemug I totally agree but think its better to try other things before going with json also should still test the living hell out of json. I think thrift is pretty good. And if you want messaging have heard great things about zeromq.
@JamesS237 -- What @mlucy is proposing here is to remove protobuf, not to have an http server that get JSON and execute queries.
So instead of sending the serialized version of a JSON object, we just send the raw JSON object.
@mlucy would be able to tell you more about that though.
This (and the Ruby driver implementation) are in next. I'm not convinced there aren't bugs, but I'm hoping developer use will help catch them. I'm going to open new issues for the Python and JS implementations.
not sure if ur planning on doing the php driver for this one or hoping somoen else wll do it but if there any docs for how to do this i can try to get this setup and going? and if someone lets me know how to compile for this one i am willing to run it on my dev stack.
@wojons I would definitely do it, but feel free to give it a try yourself if you don't want to wait so long. It should be rather easy in case of the PHP driver, because it already uses an abstract representation that is converted to a protocol buffer only before sending the query over the wire. @mlucy: Are you planning to write documentation for the protocol?
The easiest way to do this right now would probably be to use the Ruby driver to generate protobufs, and put a printf either on the server (in json_shim.cc) or in the driver (in net.rb in dispatch) to see what JSON it generates.
Activity
mlucy commentedon Jan 16, 2014
Also, as part of this we may finally want to move off of cJSON on the server.
mlucy commentedon Jan 24, 2014
OH! Also, if we have a JSON representation for ReQL:
r.evaland make @mglukhovsky buy us a cake.wojons commentedon Jan 30, 2014
I think if its in before or for the LTS would be a big thing. If it comes after LTS people are going to build there apps maybe build more community drivers that would follow protobufs and then be at a disadvantage. When you say json api do you mean how the json will be formed and it will be the same underline protocol or both things will change.
mlucy commentedon Jan 30, 2014
I mean "you won't need protobufs to talk to the server any more". The format of the JSON document you send will probably map pretty closely to the current format of the protobuf you send. (I think we may also support protobufs for a few versions as a deprecated feature so that people's drivers don't immediately break.)
wojons commentedon Jan 30, 2014
I know this sounds really dumb but i know some languages have there own serialization format which can be faster for them then it is to use things like json. I think php just calles it serialization and python has pickle. I guess it would be a lot to support all of them but may be much faster in some languages then there existing json implantation.
orthecreedence commentedon Feb 13, 2014
Question: are you talking about completely replacing the protobuf API on the server with a JSON API, or are you referring to the Ruby drivers specifically here?
mlucy commentedon Feb 13, 2014
@orthecreedence -- I think the current plan is for the server to support both a protobuf API and a JSON API for a few versions, with the protobuf API marked as deprecated. The protobuf API would then be removed at some point in the future.
orthecreedence commentedon Feb 13, 2014
Got it, just checking. Thanks!
colprog commentedon Feb 13, 2014
The high CPU usage problem of protobuf serialization/deserialization is really a problem for my node.js app. I've recently came across this: https://github.com/kentonv/capnproto. have you guys considered using this to replace protobuf?
coffeemug commentedon Feb 13, 2014
To be honest protobufs made us a bit jaded. It's a well-supported library from Google that's broadly adopted, and it sucks. Before we switch to another library we'd have to test the living hell out of it, which is a lot effort. Alternatively we can just pick json which we know works, is supported everywhere, and is very fast. That seems like a path of least resistance that we know will work.
wojons commentedon Feb 13, 2014
@coffeemug I totally agree but think its better to try other things before going with json also should still test the living hell out of json. I think thrift is pretty good. And if you want messaging have heard great things about zeromq.
coffeemug commentedon Feb 13, 2014
@wojons 👍
wojons commentedon Feb 13, 2014
Regardless I love rethink and will test any random branch you guys need some anayalitics engine to test.
neumino commentedon Feb 13, 2014
@colprog did you use the C++ backend with node.js?
It's pretty fast with https://npmjs.org/package/node-protobuf
27 remaining items
jcspencer commentedon Mar 29, 2014
The only question I have about this change is will authentication change at all? As HTTP allows the use of many authentication specs.
neumino commentedon Mar 29, 2014
@JamesS237 -- What @mlucy is proposing here is to remove protobuf, not to have an http server that get JSON and execute queries.
So instead of sending the serialized version of a JSON object, we just send the raw JSON object.
@mlucy would be able to tell you more about that though.
srh commentedon Mar 29, 2014
No. Unless I'm missing something about the data explorer. The JSON API does not use HTTP.
jcspencer commentedon Mar 29, 2014
Oh, okay.
coffeemug commentedon Apr 7, 2014
This is going to be part of the first sprint. @mlucy agreed to get this merged by the end of the week.
coffeemug commentedon Apr 7, 2014
Also talked to @Tryneus -- he agreed to get an implementation of this for the drivers into code review by the end of the week.
mlucy commentedon Apr 7, 2014
This (and the Ruby driver implementation) are in next. I'm not convinced there aren't bugs, but I'm hoping developer use will help catch them. I'm going to open new issues for the Python and JS implementations.
wojons commentedon Apr 7, 2014
@danielmewes
not sure if ur planning on doing the php driver for this one or hoping somoen else wll do it but if there any docs for how to do this i can try to get this setup and going? and if someone lets me know how to compile for this one i am willing to run it on my dev stack.
danielmewes commentedon Apr 7, 2014
@wojons I would definitely do it, but feel free to give it a try yourself if you don't want to wait so long. It should be rather easy in case of the PHP driver, because it already uses an abstract representation that is converted to a protocol buffer only before sending the query over the wire. @mlucy: Are you planning to write documentation for the protocol?
neumino commentedon Apr 7, 2014
:+1 for some docs -- If you could comment here, it would be pretty cool -- rethinkdb/docs#24
mlucy commentedon Apr 7, 2014
Opened an issue for that: #2225 . I'll try to get to it soon.
A brief summary for anyone who wants to get started:
So:
The easiest way to do this right now would probably be to use the Ruby driver to generate protobufs, and put a printf either on the server (in json_shim.cc) or in the driver (in net.rb in
dispatch) to see what JSON it generates.AtnNn commentedon Apr 7, 2014
@mlucy The ruby driver has
to_pb. Can you also add a workingto_json?mlucy commentedon Apr 7, 2014
mlucy commentedon Apr 7, 2014
So, my example was actually incorrect; I forgot to put the arguments into an array together.