{"id":980,"date":"2025-12-18T07:27:34","date_gmt":"2025-12-18T07:27:34","guid":{"rendered":"https:\/\/www.rajeshkumar.xyz\/blog\/?p=980"},"modified":"2025-12-18T07:27:34","modified_gmt":"2025-12-18T07:27:34","slug":"rest-to-grpc-google-api-gateway-vs-aws-api-gateway","status":"publish","type":"post","link":"https:\/\/www.rajeshkumar.xyz\/blog\/rest-to-grpc-google-api-gateway-vs-aws-api-gateway\/","title":{"rendered":"REST to gRPC: Google API Gateway Vs AWS API Gateway"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Google API Gateway supports REST \u2192 gRPC transcoding out of the box.<\/strong><br><strong>AWS API Gateway does NOT provide equivalent REST \u2192 gRPC transcoding out of the box.<\/strong><br><strong>On AWS, you must add a translation layer (Envoy or grpc-gateway) to achieve the same behavior.<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s the core conclusion of the spike.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">What \u201cout of the box\u201d really means (important)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Google Cloud API Gateway<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">GCP API Gateway:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Accepts <strong>REST\/JSON<\/strong><\/li>\n\n\n\n<li>Reads <strong>proto descriptors<\/strong><\/li>\n\n\n\n<li>Applies <strong>HTTP mapping rules<\/strong><\/li>\n\n\n\n<li>Converts JSON \u2192 <strong>Protobuf<\/strong><\/li>\n\n\n\n<li>Sends <strong>gRPC over HTTP\/2<\/strong><\/li>\n\n\n\n<li>Returns HTTP responses<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udc49 <strong>You do not deploy or manage a gateway service.<\/strong><br>The transcoder is <strong>managed by Google<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s exactly what your Terraform is doing today:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Upload proto descriptors<\/li>\n\n\n\n<li>Define <code>http_mapping_rules<\/code><\/li>\n\n\n\n<li>Point to <code>grpcs:\/\/...a.run.app<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">No extra pods. No custom gateway.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">AWS API Gateway<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">AWS API Gateway:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Is primarily a <strong>REST \/ HTTP API gateway<\/strong><\/li>\n\n\n\n<li>Can proxy <strong>HTTP<\/strong> and integrate with <strong>Lambda<\/strong><\/li>\n\n\n\n<li>Can <em>proxy<\/em> gRPC in limited scenarios<\/li>\n\n\n\n<li><strong>Does not read proto descriptors<\/strong><\/li>\n\n\n\n<li><strong>Does not transcode JSON \u2192 Protobuf<\/strong><\/li>\n\n\n\n<li><strong>Does not map REST paths to gRPC methods<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udc49 There is <strong>no native feature<\/strong> in AWS API Gateway equivalent to GCP\u2019s gRPC transcoding.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So if a browser sends:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">DELETE \/v1\/user\n<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">AWS API Gateway <strong>has no idea<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>which gRPC method to call<\/li>\n\n\n\n<li>how to encode the request<\/li>\n\n\n\n<li>how to produce Protobuf<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">What you must do in AWS instead<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Because ALB and AWS API Gateway don\u2019t do transcoding, you add <strong>one explicit translation layer<\/strong>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">REST client\n   \u2193\nALB or AWS API Gateway\n   \u2193\nEnvoy OR grpc-gateway   \u2190 <span class=\"hljs-keyword\">this<\/span> replaces GCP API Gateway\u2019s transcoder\n   \u2193\ngRPC service\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Envoy \/ grpc-gateway:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>reads the <strong>proto<\/strong><\/li>\n\n\n\n<li>converts REST \u2192 Protobuf<\/li>\n\n\n\n<li>sends a proper gRPC request<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Why AWS designed it this way (context)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is not a \u201cmissing feature\u201d by accident.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>AWS tends to keep <strong>infrastructure layers simpler<\/strong><\/li>\n\n\n\n<li>Advanced protocol translation is expected to live in:\n<ul class=\"wp-block-list\">\n<li>Envoy<\/li>\n\n\n\n<li>application gateways<\/li>\n\n\n\n<li>service mesh (App Mesh)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">GCP chose to <strong>productize gRPC transcoding<\/strong> inside API Gateway.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Different philosophies.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">One sentence you can safely say in the workshop<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u201cIn GCP, REST-to-gRPC transcoding is a managed feature of API Gateway.<br>In AWS, there is no equivalent managed feature, so we need to run a translator such as Envoy or grpc-gateway in front of our gRPC services.\u201d<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">That statement is <strong>technically correct<\/strong> and defensible.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Practical recommendation (final)<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For <strong>AWS + EKS + ALB<\/strong>, the closest equivalent to GCP API Gateway is:\n<ul class=\"wp-block-list\">\n<li><strong>Envoy with gRPC-JSON transcoder<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>grpc-gateway is a valid alternative when you prefer code-generated gateways.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>Google API Gateway supports REST \u2192 gRPC transcoding out of the box.AWS API Gateway does NOT provide equivalent REST \u2192&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"series":[],"class_list":["post-980","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/980","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/comments?post=980"}],"version-history":[{"count":1,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/980\/revisions"}],"predecessor-version":[{"id":981,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/980\/revisions\/981"}],"wp:attachment":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/media?parent=980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/categories?post=980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/tags?post=980"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/series?post=980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}