Suppose there is a third-party application which offers GRPC services with authentication. You want to use these services in your web application. So you will basically use that service behind the curtains with just a few simple conversions (e.g. time is denoted in seconds in third-party, but you want hours on your side). See below 2 approaches for such infrastructure:
- Send http requests from web client to backend, then on backend side make all necessary conversions, prepare GRPC request, send it through the vendor and convert it back to http response.
- Send GRPC requests from web client and also make all necessary conversions on web frontend side. In this case backend will be like gateway from web client and the vendor.
Which one you consider the better design and why?