4 ms·
There is another pretty good solution for this that will allow your front end to stick with JSON and keep your backend as gRPC only which is to stick envoy in f
by mhoad 5y ago
There is another pretty good solution for this that will allow your front end to stick with JSON and keep your backend as gRPC only which is to stick envoy in front of the gRPC services and use a filter to translate between the two which is what you are already doing except you are doing gRPC-web to gRPC right now since gRPC in the browser isn’t currently possible but that should be changing hopefully before too long with technologies like WebTransport (https://web.dev/webtransport/ https://web.dev/webtransport/).
I’m only familiar with Google’s cloud stack but they have basically managed versions of this already in the form of their Cloud Endpoints and API Gateway products that will handle all of this for you out of the box. I can’t speak to AWS or others but like I said at the end of the day it’s really just an Envoy filter doing the heavy lifting.
But in short you can 100% write gRPC only backends but still expose a JSON / REST API and nobody has to know anything to do with gRPC and you can just wait for the browser technologies to catch up in the meantime and make the transition when you’re ready.