Deployment of Cloud Load Balancing between Regions in the USA and Europe for global high availability and intelligent traffic distribution based on user proximity and location

Gabriel Varaljay
3 min readDec 27, 2023

--

As a Cloud Specialist, I undertook an ambitious project titled “Deployment of Cloud Load Balancing between Regions in the USA and Europe for Global High Availability and Intelligent Traffic Distribution.” This project was pivotal in simulating a load-balancing solution for a service akin to Netflix, dubbed “Kidflix,” focusing on two principal regions: the USA and Finland-Europe.

Project Rationale

The essence of this project was to craft a 100% Serverless architecture that guarantees high global availability. The architecture was strategically placed across two continents, ensuring that, in the event of a failover, the application remains seamlessly accessible. This setup was crucial for Kidflix, as it aimed to maintain continuous service regardless of regional disruptions.

Technical Approach

The project’s cornerstone was intelligent traffic distribution. The objective was to direct users to the geographically nearest home page, thereby reducing load time and enhancing user experience. This approach promised efficiency and optimised resource utilisation across different regions.

Project Steps and Commands

Step 1: Creating Two Serverless NEGs

For Finland:

gcloud compute network-endpoint-groups create sneg-appkidsflixfinland --region=europe-north1 --network-endpoint-type=serverless --cloud-run-service=appkidsflixfinland

For the USA:

gcloud compute network-endpoint-groups create sneg-appkidsflixusa --region=us-central1 --network-endpoint-type=serverless --cloud-run-service=appkidsflixusa

Step 2: Creating the Global Backend Service

gcloud compute backend-services create kidsflix-backend-global --global

Step 3: Adding Serverless NEGs to the Backend Service

For Finland:

gcloud compute backend-services add-backend kidsflix-backend-global --global --network-endpoint-group=sneg-appkidsflixfinland --network-endpoint-group-region=europe-north1

For the USA:

gcloud compute backend-services add-backend kidsflix-backend-global --global --network-endpoint-group=sneg-appkidsflixusa --network-endpoint-group-region=us-central1

Step 4: Creating a URL Map for Incoming Requests

gcloud compute url-maps create lb-kidsflix-global --default-service kidsflix-backend-global

Step 5: Creating the Target HTTP(S) Proxy

gcloud compute target-http-proxies create lb-kidsflix-httpproxy --url-map=lb-kidsflix-global

Step 6: Reserving an IP Address for the Load Balancer

gcloud compute addresses create kidsflix-global-ip --ip-version=IPV4 --global

Step 7: Creating a Global Forwarding Rule

gcloud compute forwarding-rules create kidsflix-frontend-global --address=kidsflix-global-ip --target-http-proxy=lb-kidsflix-httpproxy --global --ports=80

Testing and Verification

To validate the effectiveness of this load-balancing solution, I used NordVPN to simulate locations in Canada and the UK. This testing phase was crucial in demonstrating the seamless regional switching between the US and Finland endpoints. The accompanying screenshots vividly illustrate how the system intelligently redirects traffic based on simulated geographical locations.

Conclusion

This project was a testament to my capabilities as a Cloud Specialist. It showcased my proficiency in deploying a robust, serverless architecture that caters to global accessibility and intelligent traffic distribution.

--

--

Gabriel Varaljay
Gabriel Varaljay

Written by Gabriel Varaljay

Multi-Cloud & DevOps | AWS | Microsoft Azure | Google Cloud | Oracle Cloud | Linux | Terraform | digital problem solver