if you use gRPC, why do you use it instead of raw TCP packets with binary data and then deserialise? what's the benefit?
@srikanthkandarpАй бұрын
gRPC is an application level Protocol and TCP is a network layer protocol. Hence anything that goes to Network layer requires data to be in bytes hence serialization and deserialization.
@ordinaryggАй бұрын
@@srikanthkandarp you are right, basically it's just ser-ze-de-ze layer, does it broke if you change schema on server and client starts receiving different data?
@srikanthkandarpАй бұрын
@@ordinarygg Yeah, at the application layer, the gRPC protocol ensures pre-flight checks for the type of RPC (the method that the client is going to call), then checks with the server to verify if the schema is correct, and responds accordingly based on the request and response schema.
@ordinaryggАй бұрын
@@srikanthkandarp ouch, so to change or add new field that mobile app for example will use with v1 (no new field) and v2 (new field), you need to force update user app, and canary deployment of containers also blocked. What the benefits then? speed?
@jinushaunАй бұрын
@@ordinarygg Benefit: It's not JSON or XML. But yes, adding new fields or deprecating old fields is a pain in gRPC. In practice, everyone just ends up making all fields optional and the client has to check if a specific field it need exists, and ignore fields it no longer uses.