Closed jaffee closed 2 years ago
relates somewhat to #641 and #666 as GRPC has streaming support.
I spent some time learning and exploring GRPC as a replacement for certain functions in the handler. The possible benefits of switching to GRPC initially looked very optomistic:
While GRPC is awesome, there were some things I learned that made me more weary of using it:
I published a branch that implements GetMaxSlices() as a GRPC function. Note that GetMaxSlices() requires an argument "Empty" because for some reason all RPC methods must take at least one argument.
In my opinion, the main benefits of using GRPC can be attained instead through handler improvements, yielding code that is easier to understand and modify, without adding a new configurable port to Pilosa server. Furthermore, GRPC-gateway is an imperfect solution to providing standard JSON/HTTP compatibility, so we'd still need to continue to maintain the existing handler code, and thereforce the net effect on the codebase would be an increase in code and complexity. The streaming support is a compelling reason to use GRPC, but can be replicated fairly easily using standard HTTP.
Maybe https://github.com/src-d/proteus could help with some of the concerns described.
I suggest not use grpc-gateway, since give you out of the box the HTTP handler, but is not very clean and not nice for sure.
One option could be, write the function handled and wrap it, with proteus and with a demuxer. having one handler for both endpoints.
I will love have GRPC support at pilosa.
That's interesting, @mcuadros. I haven't heard of proteus, but I will definitely take a close look at it. At first glance, it looks a lot more flexible than the official protobuf/grpc toolkit.
Thank you for your suggestion!
And maybe this https://github.com/twitchtv/twirp, can also help.
re-opening so we can explore these suggestions
blocked by #1093
I agree that grpc-gateway should not be used. Its old and really has been passed by much better approaches.
You should try this one: https://github.com/improbable-eng/grpc-web Its production battle teested.
Has webspckets now too :) https://github.com/improbable-eng/grpc-web/issues/167
And here is a great example of using it: https://github.com/johanbrandhorst/grpcweb-example Web demo: https://grpcweb.jbrandhorst.com/ As you can see its fast and can do basic duplex ( chat demo)
Its also using gopherjs for the frotn end with react.
@codysoyland commented on Tue May 30 2017
Description
GRPC is an RPC framework built on Protobuf and other technologies. It would be interesting to see how Pilosa would work over GRPC.
Success criteria (What criteria will consider this ticket closeable?)
Client and Server are modified to support GRPC and run queries. Usability and performance would be considered when deciding if we would like to support it long term.