I saw recently an article where we are using bidirectional streaming calls for exchanging business data and not only for uploading/downloading.
Then a question occurred to me: is this model viable in replacement of API backend to backend HTTP calls?
For example, if we check this:
A backend client could open a gRPC stream with other backend server when the service starts. Then when a front client call this service:
- The back end client sends a request to the other backend service (with an ID) and wait
- The other backend service callback the backend client with the response (and the same ID)
- Once the response is received from backend client, it answers to the frontend
Is this pattern could be faster than back-to-back HTTP call? Or is this idea completely dumb? Did someone already try this?