Call for comments - RethinkDB wire protocol
rethinkdb.com
rethinkdb.com
You may want to make even your conceptually required fields optional.
As an example, if you tried to proxy a newer version of the protocol through an old proxy (assuming it's deserializing), unknown enumeration values for required fields could cause errors.
1. it's not efficient
2. we'd need to design a complete new protocol (keep in mind that you'd need to include query parameters) which for advanced query language like RQL is challenging
3. with a new protocol we'd need also versioning (for ensuring backward compatibility)
And the list is probably much longer.
alex @ rethinkdb
Looking at the github page, it seems all the names of things are still being transmitted as strings (of course), so "r.add(1,2)" is unlikely to be smaller decomposed into discrete items (each with at least a 1-byte pb tag overhead).
I'd think it'd be passing a main query string, with placeholders for parameters. "r.add(@a,@b)" or something, then have a parameter block where you can efficiently encode non-string parameters.
Basically, keep protocol buffers and the rest, just don't encode the syntax tree - let the server parse it.
It also makes it much easier for developers because the server can better detect errors and send more meaningful responses.
Having a data structure that represents a query in the first place is a pretty good idea.
Even better is being able to go back and forth between strings and data structures.
Would really appreciate anyone's questions or comments!