{"id":64585,"date":"2024-08-29T09:09:50","date_gmt":"2024-08-29T03:39:50","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=64585"},"modified":"2024-08-29T09:53:48","modified_gmt":"2024-08-29T04:23:48","slug":"unlocking-business-potential-leveraging-google-clouds-serverless-architecture-for-scalable-growth","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/unlocking-business-potential-leveraging-google-clouds-serverless-architecture-for-scalable-growth\/","title":{"rendered":"Unlocking Business Potential: Leveraging Google Cloud\u2019s Serverless Architecture for Scalable Growth"},"content":{"rendered":"<p><span style=\"color: #000000;\">Modern businesses are under constant pressure to innovate, scale, and deliver exceptional user experiences. Traditional server-based infrastructures often struggle to keep up with these demands, leading to increased costs, operational inefficiencies, and missed opportunities. <\/span><\/p>\n<p><span style=\"color: #000000;\">Google Cloud\u2019s serverless architecture offers a transformative solution, enabling businesses to focus on growth and innovation without the burdens of managing underlying infrastructure. In this blog, we will explore how leveraging Google Cloud\u2019s serverless services can unlock new business potential, drive scalability, and fuel long-term success.<\/span><\/p>\n<h2><strong><span style=\"color: #000000;\">Problem Statement<\/span><\/strong><\/h2>\n<p><span style=\"color: #000000;\">Many organizations are increasingly challenged by the need to maintain and scale their infrastructure efficiently. Traditional server-based architectures require substantial investments in hardware, software, and skilled personnel to manage and monitor servers. This not only drives up operational costs but also diverts focus from core business objectives. The rigidity of such architectures often leads to inefficient scaling, where resources are either over-provisioned, resulting in wasted costs, or under-provisioned, causing degraded performance during peak demands. This inefficiency hampers the speed of deploying new features and responding to market demands, putting organizations at a competitive disadvantage.<\/span><\/p>\n<h2><strong><span style=\"color: #000000;\">Solution:<\/span><\/strong><\/h2>\n<p><span style=\"color: #000000;\">GCP&#8217;s serverless offerings, including Cloud Functions and Cloud Run, provide a solution to these challenges by abstracting the underlying infrastructure. This allows businesses to focus on delivering application functionality while automatically handling scalability, availability, and infrastructure management.<\/span><\/p>\n<h3><strong><span style=\"color: #000000;\">Google Cloud Functions<\/span><\/strong><\/h3>\n<p><span style=\"color: #000000;\">Cloud Functions is GCP&#8217;s event-driven serverless compute service that allows you to run code in response to events. It supports various programming languages and is ideal for building lightweight, single-purpose functions that respond to HTTP requests, cloud storage changes, or other triggers.<\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <strong>Use Cases<\/strong>: Real-time file processing, webhooks, data transformation, and more.<\/span><br \/>\n<span style=\"color: #000000;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <strong>Benefits<\/strong>: Quick deployment, automatic scaling, integrated monitoring, and logging.<\/span><\/p>\n<h5><\/h5>\n<p>&nbsp;<\/p>\n<h4><strong><span style=\"color: #000000;\">Comparison of Cloud Functions: 1st Gen vs. 2nd Gen:<\/span><\/strong><\/h4>\n<table style=\"border-collapse: collapse; width: 83.7051%; height: 192px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 18.6897%; height: 24px; text-align: center;\">\n<h6><strong><span style=\"color: #000000;\">Feature<\/span><\/strong><\/h6>\n<\/td>\n<td style=\"width: 36.8322%; height: 24px; text-align: center;\">\n<h6><strong><span style=\"color: #000000;\">Cloud Functions (1st gen-old)<\/span><\/strong><\/h6>\n<\/td>\n<td style=\"width: 40.1362%; height: 24px; text-align: center;\">\n<h6><strong><span style=\"color: #000000;\">Cloud Functions (2nd gen-new)<\/span><\/strong><\/h6>\n<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 18.6897%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Image registry<\/span><\/td>\n<td style=\"width: 36.8322%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Container Registry or Artifact Registry<\/span><\/td>\n<td style=\"width: 40.1362%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Artifact Registry only<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 18.6897%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Request timeout<\/span><\/td>\n<td style=\"width: 36.8322%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Up to 9 minutes<\/span><\/td>\n<td style=\"width: 40.1362%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Up to 60 minutes for HTTP-triggered functions; Up to 9 minutes for event-triggered functions<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 18.6897%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Instance size<\/span><\/td>\n<td style=\"width: 36.8322%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Up to 8GB RAM with 2 vCPU<\/span><\/td>\n<td style=\"width: 40.1362%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Up to 16GiB RAM with 4 vCPU<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 18.6897%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Concurrency<\/span><\/td>\n<td style=\"width: 36.8322%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">1 concurrent request per function instance<\/span><\/td>\n<td style=\"width: 40.1362%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Up to 1000 concurrent requests per function instance<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 18.6897%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Traffic splitting<\/span><\/td>\n<td style=\"width: 36.8322%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Not supported<\/span><\/td>\n<td style=\"width: 40.1362%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Supported<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 18.6897%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Event types<\/span><\/td>\n<td style=\"width: 36.8322%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Direct support for events from 7 sources<\/span><\/td>\n<td style=\"width: 40.1362%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Support for any event type supported by Eventarc, including 90+ event sources via Cloud Audit Logs<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 18.6897%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">CloudEvents<\/span><\/td>\n<td style=\"width: 36.8322%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Supported only in Ruby, .NET, and PHP runtimes<\/span><\/td>\n<td style=\"width: 40.1362%; height: 24px; text-align: center;\"><span style=\"color: #000000;\">Supported in all language runtimes<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3><strong><span style=\"color: #000000;\">Google Cloud Run<\/span><\/strong><\/h3>\n<p><span style=\"color: #000000;\">Cloud Run is a fully managed computing platform that automatically scales stateless containers. It offers more flexibility than Cloud Functions, allowing you to run any application packaged as a container, whether it be a microservice, web application, or background job.<\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<strong>Use Cases<\/strong>: Microservices architecture, RESTful APIs, backend services.<\/span><br \/>\n<span style=\"color: #000000;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<strong>Benefits<\/strong>: Supports any language and framework, deploys directly from a container image, integrates with GCP&#8217;s suite of services.<\/span><\/p>\n<h2><strong><span style=\"color: #000000;\">Selecting the Right Serverless Solution for Your Needs<\/span><\/strong><\/h2>\n<p><span style=\"color: #000000;\">Both Cloud Functions and Cloud Run are capable of scaling from zero to accommodate high demand, but the best choice depends on your specific requirements for simplicity and flexibility.<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">Opt for Cloud Functions if you need a straightforward, event-driven setup where the infrastructure details, such as web server configurations and language runtimes, are managed for you. This option is ideal for tasks that involve integrating services, handling lightweight processes, or managing real-time events without extensive customization.<\/span><\/li>\n<li><span style=\"color: #000000;\">Choose Cloud Run if your application requires greater control over the environment, such as selecting specific web servers or customizing runtime settings. Cloud Run is well-suited for more complex applications, including those that utilize a microservices architecture or need to operate within specific container environments. It offers the flexibility of container-based deployment while still providing managed scalability and infrastructure oversight.\n<p><\/span><\/li>\n<\/ul>\n<h2><strong><span style=\"color: #000000;\">Setup Serverless Application on GCP<\/span><\/strong><\/h2>\n<h3><span style=\"color: #000000;\">Cloud Functions :-<\/span><\/h3>\n<p><span style=\"color: #000000;\"><strong>1-<\/strong> Go to your GCP account.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>2-<\/strong> Select your project, where you want to deploy your serverless application.<\/span><\/p>\n<div id=\"attachment_64577\" style=\"width: 635px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-64577\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-64577\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-11.45.46\u202fAM-1024x528.png\" alt=\"first point\" width=\"625\" height=\"322\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-11.45.46\u202fAM-1024x528.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-11.45.46\u202fAM-300x155.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-11.45.46\u202fAM-768x396.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-11.45.46\u202fAM-1536x793.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-11.45.46\u202fAM-2048x1057.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-11.45.46\u202fAM-624x322.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-64577\" class=\"wp-caption-text\">console view<\/p><\/div>\n<p><span style=\"color: #000000;\"><strong>3-<\/strong> Need to enable the Cloud Functions, Cloud Build, Artifact Registry, Cloud Run, Logging, and Pub\/Sub APIs.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63685\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.46.04\u202fPM-1024x462.png\" alt=\"2\" width=\"625\" height=\"282\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.46.04\u202fPM-1024x462.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.46.04\u202fPM-300x135.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.46.04\u202fPM-768x346.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.46.04\u202fPM-624x281.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.46.04\u202fPM.png 1508w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"color: #000000;\"><strong>4-<\/strong> Open the Cloud Functions Overview page<\/span><\/p>\n<div id=\"attachment_63684\" style=\"width: 635px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-63684\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63684\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.47.44\u202fPM-1-1024x513.png\" alt=\"3\" width=\"625\" height=\"313\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.47.44\u202fPM-1-1024x513.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.47.44\u202fPM-1-300x150.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.47.44\u202fPM-1-768x385.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.47.44\u202fPM-1-1536x770.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.47.44\u202fPM-1-2048x1026.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.47.44\u202fPM-1-624x313.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63684\" class=\"wp-caption-text\">Cloud Functions Overview page<\/p><\/div>\n<p><span style=\"color: #000000;\"><strong>5-<\/strong> Click the Create function.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>6 &#8211;<\/strong> Name your function, for example, function-1-demo, and also select the Region,where you will be required to deploy<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>7-<\/strong> In the HTTPS field under Trigger, leave Require authentication selected. This is the default setting.<\/span><\/p>\n<p><em><span style=\"color: #000000;\"><strong>Note :-<\/strong> The other option allows unauthenticated invocations, to reach the function without authentication. This is useful for testing, but it is not recommended to use this setting in production unless we are creating a public API or website.<\/span><\/em><\/p>\n<div id=\"attachment_63682\" style=\"width: 635px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-63682\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63682\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.55.27\u202fPM-1-1024x816.png\" alt=\"5\" width=\"625\" height=\"498\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.55.27\u202fPM-1-1024x816.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.55.27\u202fPM-1-300x239.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.55.27\u202fPM-1-768x612.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.55.27\u202fPM-1-1536x1225.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.55.27\u202fPM-1-2048x1633.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-12.55.27\u202fPM-1-624x498.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63682\" class=\"wp-caption-text\">creating the function<\/p><\/div>\n<p><span style=\"color: #000000;\"><strong>8-<\/strong> Select \u201cNEXT\u201d and on the next page select the \u201cinline editor \u201d and \u201cRuntime\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>9-<\/strong> Now deploy the function by clicking on \u201cDeploy\u201d<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63669\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.01.20\u202fPM-1024x712.png\" alt=\"12\" width=\"625\" height=\"435\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.01.20\u202fPM-1024x712.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.01.20\u202fPM-300x209.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.01.20\u202fPM-768x534.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.01.20\u202fPM-1536x1069.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.01.20\u202fPM-2048x1425.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.01.20\u202fPM-624x434.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"color: #000000;\"><strong>10-<\/strong> While the function is being deployed, the icon next to it is a small spinner. After the function finishes deploying, the spinner turns to a green check mark.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-64584\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-12.16.14\u202fPM-1024x404.png\" alt=\"monitoring view\" width=\"625\" height=\"247\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-12.16.14\u202fPM-1024x404.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-12.16.14\u202fPM-300x118.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-12.16.14\u202fPM-768x303.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-12.16.14\u202fPM-1536x606.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-12.16.14\u202fPM-2048x808.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/08\/Screenshot-2024-08-26-at-12.16.14\u202fPM-624x246.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"color: #000000;\"><strong>11-<\/strong> Open the Testing tab &#8211;&gt; Scroll down to the CLI test command field &#8211;&gt; click Run in Cloud Shell<\/span><br \/>\n<span style=\"color: #000000;\">The curl command is displayed in a cloud shell window at the bottom of your screen. Now it will be prompted to authorize cloud shell.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>12-<\/strong> To execute the curl command that is displayed in your Cloud Shell window, press &#8216;Return&#8217;.<\/span><\/p>\n<p><span style=\"color: #000000;\">Your &#8220;Hello world&#8221; message is displayed<\/span><\/p>\n<div id=\"attachment_63676\" style=\"width: 635px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-63676\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63676\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.08.02\u202fPM-1024x685.png\" alt=\"8\" width=\"625\" height=\"418\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.08.02\u202fPM-1024x685.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.08.02\u202fPM-300x201.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.08.02\u202fPM-768x514.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.08.02\u202fPM-1536x1028.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.08.02\u202fPM-2048x1371.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-1.08.02\u202fPM-624x418.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63676\" class=\"wp-caption-text\">output<\/p><\/div>\n<h3><strong><span style=\"color: #000000;\">Cloud Run<\/span><\/strong><\/h3>\n<p><span style=\"color: #000000;\">For example, we will set up a simple node.js application. <\/span><span style=\"color: #000000;\">Open your cloud shell by following the below steps.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>1-<\/strong> Initialize the Project directory and files of node.js<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>2- <\/strong>Create app.js file<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63672\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.43.37\u202fPM-1024x615.png\" alt=\"9\" width=\"625\" height=\"375\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.43.37\u202fPM-1024x615.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.43.37\u202fPM-300x180.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.43.37\u202fPM-768x461.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.43.37\u202fPM-624x375.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.43.37\u202fPM.png 1486w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63677\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.07\u202fPM-1024x352.png\" alt=\"10\" width=\"625\" height=\"215\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.07\u202fPM-1024x352.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.07\u202fPM-300x103.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.07\u202fPM-768x264.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.07\u202fPM-624x215.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.07\u202fPM.png 1396w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"color: #000000;\"><strong>3-<\/strong> Create Dockerfile<\/span><\/p>\n<div id=\"attachment_63678\" style=\"width: 635px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-63678\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63678\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.44\u202fPM-1024x468.png\" alt=\"11\" width=\"625\" height=\"286\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.44\u202fPM-1024x468.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.44\u202fPM-300x137.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.44\u202fPM-768x351.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.44\u202fPM-624x285.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.44.44\u202fPM.png 1480w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63678\" class=\"wp-caption-text\">Dockerfile<\/p><\/div>\n<p><span style=\"color: #000000;\"><strong>4-<\/strong> Build and push the image to Google Container registry<\/span><\/p>\n<div id=\"attachment_63674\" style=\"width: 635px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-63674\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63674\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.38.24\u202fPM-1024x257.png\" alt=\"12\" width=\"625\" height=\"157\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.38.24\u202fPM-1024x257.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.38.24\u202fPM-300x75.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.38.24\u202fPM-768x193.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.38.24\u202fPM-1536x385.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.38.24\u202fPM-2048x514.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.38.24\u202fPM-624x157.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63674\" class=\"wp-caption-text\">pushing to registry<\/p><\/div>\n<p><span style=\"color: #000000;\"><strong>5-<\/strong> Deploy to CloudRun<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63679\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.57.11\u202fPM-1024x721.png\" alt=\"13\" width=\"625\" height=\"440\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.57.11\u202fPM-1024x721.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.57.11\u202fPM-300x211.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.57.11\u202fPM-768x541.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.57.11\u202fPM-1536x1082.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.57.11\u202fPM-2048x1442.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.57.11\u202fPM-624x439.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"color: #000000;\">The Service URL is provided in the shell, copy the URL and paste into the browser you will be able to see the node.js application running<\/span><\/p>\n<div id=\"attachment_63680\" style=\"width: 635px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-63680\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-63680\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.59.36\u202fPM-1024x319.png\" alt=\"19\" width=\"625\" height=\"195\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.59.36\u202fPM-1024x319.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.59.36\u202fPM-300x94.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.59.36\u202fPM-768x239.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.59.36\u202fPM-1536x479.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.59.36\u202fPM-624x195.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/07\/Screenshot-2024-07-31-at-2.59.36\u202fPM.png 1912w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-63680\" class=\"wp-caption-text\">final_output<\/p><\/div>\n<h3><strong><span style=\"color: #000000;\">Monitor and Scale<\/span><\/strong><\/h3>\n<p><span style=\"color: #000000;\">Use GCP&#8217;s monitoring tools, such as Stackdriver Logging and Monitoring, to track performance and troubleshoot issues. Both Cloud Functions and Cloud Run automatically scale based on incoming traffic, ensuring that your application remains responsive under varying loads.<\/span><\/p>\n<h2><strong><span style=\"color: #000000;\">Conclusion<\/span><\/strong><\/h2>\n<p><span style=\"color: #000000;\">Serverless architecture on GCP Cloud Functions and Cloud Run provides an effective solution to the challenges of managing and scaling infrastructure. By abstracting the underlying infrastructure, GCP enables developers to focus on delivering value through code, without the need for extensive operational overhead. Whether you&#8217;re handling simple event-driven tasks or deploying complex microservices, GCP&#8217;s serverless offerings are a robust solution for modern cloud-native applications.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modern businesses are under constant pressure to innovate, scale, and deliver exceptional user experiences. Traditional server-based infrastructures often struggle to keep up with these demands, leading to increased costs, operational inefficiencies, and missed opportunities. Google Cloud\u2019s serverless architecture offers a transformative solution, enabling businesses to focus on growth and innovation without the burdens of managing [&hellip;]<\/p>\n","protected":false},"author":1529,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":42},"categories":[2348],"tags":[1892,6362,5939],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/64585"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1529"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=64585"}],"version-history":[{"count":13,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/64585\/revisions"}],"predecessor-version":[{"id":64761,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/64585\/revisions\/64761"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=64585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=64585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=64585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}