Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improbable-eng/grpc-web vs grpc/grpc-web? #199

Closed
nhooyr opened this issue Jun 4, 2018 · 22 comments
Closed

improbable-eng/grpc-web vs grpc/grpc-web? #199

nhooyr opened this issue Jun 4, 2018 · 22 comments

Comments

@nhooyr
Copy link

nhooyr commented Jun 4, 2018

Whats the difference between https://github.com/grpc/grpc-web and this?

@dchenk
Copy link

dchenk commented Aug 1, 2018

I’d like to know also if it’d be smart to not duplicate efforts but have all of us develop the grpc/grpc-web project.

@johanbrandhorst
Copy link
Contributor

There's quite a long and illustrious history between the two projects, but basically it comes down to slightly different design decisions at the start of the project.

This project uses TypeScript and the npm ecosystem to implement and publish an npm module that can be used with other projects. The backend proxy is written in Go, which is an accessible language to most developers. It's easy to deploy and super easy to integrate with existing Go gRPC servers.

The grpc/grpc-web project was started internally at Google at about the same time as this was, and they chose to build their project on the Google Closure Compiler base. Their backend proxy was originally implemented as a C++ NGINX module, but recently has been released also as an Envoy plugin. Very recently they've considered releasing the library as an npm module as well.

I encourage you to read Improbable's blog post announcing the project but as a summary:

improbable-eng/grpc-web:

  • TypeScript client
  • npm library grpc-web-client
  • Go backend proxy
  • Go backend library wrapper proxy
  • Supports client-side and bi-directional streaming via websockets

grpc/grpc-web:

  • JS client
  • Google Closure library
  • NGINX/Envoy backend proxy
  • Supports unary and server side streaming only

All of this is further complicated by the fact that even though both sides agree on a spec, apparently neither of the clients is compatible with the others proxy.

Personally, I've used the Improbable library and extensively, and I can't see it not being a future proof way of consuming grpc-web, as I expect both clients and proxies to converge on a single compatible protocol long term.

@nhooyr
Copy link
Author

nhooyr commented Aug 5, 2018

Wohoo #162 (comment) 🎊

So does this mean they both use the same protocol now or that its different but they now have support for this lib's protocol?

@johanbrandhorst
Copy link
Contributor

I don't know how or why they were incompatible, but it seems at least gRPC/gRPC-Web has tested their client against this proxy. It still only supports unary calls but it's a step in the right direction. I think it should make users more confident that they can choose to use this repos client and proxy now (for bidi streaming for example) and be able to change to the official client later.

@johanbrandhorst
Copy link
Contributor

This issue is more a matter of documentation, so I will leave it open for anyone to add my comments (or their own) to the README.

@gregkeys
Copy link

gregkeys commented Sep 20, 2018

I'm new to gRPC; if I understand this thread properly does this mean that improbable's version of gRPC-web does not work with Envoy? does the improbable go proxy scale? Does is cluster? does it provide a single endpoint for the client to connect to or do you need to run a proxy per service?

My goal is to use web components on the front end that match up to gRPC based micro services on the backend so that we basically have microservices on both the front and back, Im trying to sort out how to get everyone talking to each other.

@johanbrandhorst
Copy link
Contributor

  1. The improbable client has (to my knowledge) not been thoroughly tested against the Envoy proxt gRPC web implementation.
  2. It scales as well as any other Go service, the improbable proxy is available both as a go package and as a standalone proxy.
  3. See Feature/js refactor #2.

Sounds like you should evaluate both this and the official client and proxy to see what works for you. See my other comments in this issue for more information.

@johanbrandhorst
Copy link
Contributor

johanbrandhorst commented Oct 19, 2018

Just to follow up, I've done some preliminary testing of the Improbable and grpc-web clients in https://github.com/johanbrandhorst/grpc-web-compatibility-test and for simple use cases both are compatible with each other. For things like bidirectional streaming or application/grpc-web+text there are some incompatibilities though. More information will be forthcoming.

@johanbrandhorst
Copy link
Contributor

I'll bump this thread when it's ready :)

@sandersaares
Copy link
Contributor

But idk if this isn't already fixed with grpc_proxy of nginx.

I can confirm the nginx grpc_proxy implementation does not come with grpc-web support. Here's the nginx work item for grpc-web support: https://trac.nginx.org/nginx/ticket/1536

@johanbrandhorst
Copy link
Contributor

I'm pleased to finally be able to share my blog post on grpc-web: https://grpc.io/blog/state-of-grpc-web. I hope that should cover most of the questions.

@maxn0d3x
Copy link

maxn0d3x commented Feb 21, 2019

grpc/grpc-web is going to support Bidi streaming, Typescript/Angular and Websocket, Proxy, Non-Binary Message Encoding, Non-Closure compiler support as well
Check it out : https://github.com/grpc/grpc-web/blob/master/ROADMAP.md
Seems like Official grpc/grpc-web project is more "Official" and more powerful in nature.

I am just a newbie of grpc world, and wanna know which side I should dig in first ?Can I use both of them and switch between them depending on my circumstance?

@maxn0d3x
Copy link

maxn0d3x commented Mar 1, 2019

grpc/grpc-web is going to support Bidi streaming, Typescript/Angular and Websocket, Proxy, Non-Binary Message Encoding, Non-Closure compiler support as well
Check it out : https://github.com/grpc/grpc-web/blob/master/ROADMAP.md
Seems like Official grpc/grpc-web project is more "Official" and more powerful in nature.

I am just a newbie of grpc world, and wanna know which side I should dig in first ?Can I use both of them and switch between them depending on my circumstance?

Looks like grpc/grpc-web folks are working on it slowly...
I may support this project more than that. !
Keep it up men! 👍

@buckhx
Copy link

buckhx commented Mar 11, 2019

We've used this project for a few internal projects and evaluated it vs grpc/grpc-web for a major public project. One of our requirements is server side rendering and the configurable transport of this project allowed us to do that.

For reference grpc/grpc-web does not look to support server side rendering grpc/grpc-web#453 (comment)

@lostsequence
Copy link

Can I use wrapped server to handle grpc requests from backend clients written in go ?
Because my test golang clients stated to return nil, when I use wrapped grpc server.
Guess I need to use proxy, if I want to handle backend and frontend grpc requests.

@johanbrandhorst
Copy link
Contributor

@lostsequence you can support both gRPC-Web and gRPC requests on the same port, yes.

@lostsequence
Copy link

@lostsequence you can support both gRPC-Web and gRPC requests on the same port, yes.

And to do that I should use proxy, because if I will use grpcweb.WrapServer() and http.Server it will handle only gRPC-Web requests. I understood correctly?

@johanbrandhorst
Copy link
Contributor

No, you can keep using grpcweb.WrapServer, but you need a traffic splitting handler: https://github.com/johanbrandhorst/grpcweb-example/blob/adfc1a47f9f002b1fd84eeec810af3ba3cac7473/main.go#L123

@jackielii
Copy link

This blog post summarise it well: https://grpc.io/blog/state-of-grpc-web/

@nhooyr
Copy link
Author

nhooyr commented Nov 22, 2019

Going to close as it has been a long time and I'm not sure if this is relevant anymore.

@nhooyr nhooyr closed this as completed Nov 22, 2019
@sanathkumarbs
Copy link

sanathkumarbs commented Feb 6, 2023

@johanbrandhorst Are there plans to update the https://grpc.io/blog/state-of-grpc-web/ with latest updates and support from grpc/grpc-web vs imporbable-eng? Thanks!

@johanbrandhorst
Copy link
Contributor

Hi @sanathkumarbs, unfortunately, I don't have much control over their blog so I don't think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants