gRPC for web applications with millions of users

98 views
Skip to first unread message

Sankar

unread,
Dec 2, 2022, 9:06:34 AM12/2/22
to golang-nuts
Hi,

I have used gRPC for some simple applications, where the server is in Golang and the client is also another golang application. I have primarily worked in the backend and have done a lot of gRPC communication among the backend services using the likes of gRPC streams and golang.

Now for the first time, I am trying to implement a web application. The client apps will be done in react-native. So I was thinking of using the javascript gen code for the client libraries.

However I read from some blogposts, when I searched for how to use gRPC in javascript, I read that gRPC cannot be used for consumer facing applications and is only fit for backend applications. I read that grpc streaming will not work with Browser based applications.

Also I read that gRPC will not scale if there are millions of user requests coming from browsers. I am sure that gRPC can handle a lot of backend volume, but I have not used with a lot of parallel connections. 

So I wanted to ask, if gRPC is used by any consumer facing applications, where the backend  is done in Go and the front end is done in some form of javascript framework, with a few million users.

Any feedback, suggestions, links, etc. on this topic are also welcome.

Thanks.

Brian Candler

unread,
Dec 2, 2022, 11:46:41 AM12/2/22
to golang-nuts
Just checking that you came across this already?
gRPC can't be implemented natively in browsers. You can sending something gRPC-like and then convert it back to gRPC at the server.  But for bi-directional streaming, I think you need to look at Websockets or Server-Sent Events.

Sean Liao

unread,
Dec 2, 2022, 12:21:51 PM12/2/22
to golang-nuts

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/15748f24-acfa-4061-8174-a03a894713c0n%40googlegroups.com.

robert engels

unread,
Dec 2, 2022, 3:29:22 PM12/2/22
to Sean Liao, golang-nuts

Christian Stewart

unread,
Dec 2, 2022, 5:11:30 PM12/2/22
to robert engels, Sean Liao, golang-nuts
Hi all,

I've built a streaming RPC library compatible with grpc Protobuf service definitions that can do bidirectional streaming to the web browser over any AsyncIterable channel, currently using WebSockets but can also use Message channel to webassembly and other messaging approaches.


As far as I know, it's the only library capable of doing browser -> server streaming currently, as neither twirp nor grpc-web support this.

Best regards,
Christian Stewart 

Reply all
Reply to author
Forward
0 new messages