{"id":1311,"date":"2022-11-25T14:18:23","date_gmt":"2022-11-25T14:18:23","guid":{"rendered":"https:\/\/www.muratyaman.co.uk\/blog\/?p=1311"},"modified":"2022-11-25T14:18:23","modified_gmt":"2022-11-25T14:18:23","slug":"achilles-heel-of-protocolbuffers-grpc","status":"publish","type":"post","link":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/2022\/11\/achilles-heel-of-protocolbuffers-grpc\/","title":{"rendered":"Achilles heel of ProtocolBuffers\/gRPC"},"content":{"rendered":"<p>Many #developers trip over #undefined and #null which are also the #achilles #heel of #ProtocolBuffers that #gRPC depends on. When I see that such #basic #problems are not solved properly, I cannot trust\/use a #tech #solution. #GraphQL is much better, much more #efficient and a lot more #developerFriendly \ud83d\ude09<\/p>\n<p>To give more context: it does NOT support optional fields. If you define a large input model with many attributes\/fields for an update action and you want to receive any combination of those attributes (almost all optional) that means you have to handle a really ugly large input with values that may or may not indicate an omitted attribute. It&#8217;s not a surprise that a value like -999999 may be your special value for a field to ignore! Other option is to provide full input object at all times that may lead to accidental data overrides\/loss on busy systems. Another option is to define many actions with small pieces of same input model, where you may end up 5 different versions of your update action!!!<\/p>\n<p>&#8220;#Optional #Fields And #Default #Values&#8221;<\/p>\n<p>Ref: https:\/\/developers.google.com\/protocol-buffers\/docs\/proto#optional<\/p>\n<p>Photo by Daniel Mingook Kim https:\/\/unsplash.com\/es\/@danielmingookkim<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many #developers trip over #undefined and #null which are also the #achilles #heel of #ProtocolBuffers that #gRPC depends on. When I see that such #basic #problems are not solved properly, I cannot trust\/use a #tech #solution. #GraphQL is much better, much more #efficient and a lot more #developerFriendly \ud83d\ude09 To give more context: it does NOT support optional fields. If you define a large input model with many attributes\/fields for an update action and you want to receive any combination of those attributes (almost all optional) that means you have to handle a really ugly large input with values that may or may not indicate an omitted attribute. It&#8217;s not a surprise that a value like -999999 may be your special value for a field to ignore! Other option is to provide full input object at all times that may lead to accidental data overrides\/loss on busy systems. Another option is to define many actions with small pieces of same input model, where you may end up 5 different versions of your update action!!! &#8220;#Optional #Fields And #Default #Values&#8221; Ref: https:\/\/developers.google.com\/protocol-buffers\/docs\/proto#optional Photo by Daniel Mingook Kim https:\/\/unsplash.com\/es\/@danielmingookkim<\/p>\n","protected":false},"author":2,"featured_media":1312,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[231],"class_list":["post-1311","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-grpc"],"_links":{"self":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1311"}],"version-history":[{"count":1,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1311\/revisions"}],"predecessor-version":[{"id":1313,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1311\/revisions\/1313"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/media\/1312"}],"wp:attachment":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}