Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building a multi-region routing system with Cloudflare Workers

We serve customers primarily in Australia, but we are now expanding to the USA. The timeline for launch is less than 2 months. This is now a race against time to design a multi-region routing system that fits all of our needs. Here is the story. Background Almost all of our customers were based in Oceania. We run our Kubernetes Cluster on GCP in Australia. Go microservices, federated GraphQL,…

Building a multi-region routing system with Cloudflare Workers

A company primarily serving customers in Australia is expanding to the USA, requiring a multi-region routing system. The timeline for this project is less than two months. To address this challenge, the company evaluated several options to ensure a seamless user experience across both regions.

Initially, the team considered sharding data by region, but this approach presented challenges, as it could lead to confusion when a user's account was not found or required ambiguous pagination. Instead, they decided to keep a unified dataset across regions, which would allow for easier data sharing and a better user experience.

The company needed to ensure that logged-in users were served from their own region, while logged-out users were routed geographically. This meant that account managers and administrators should be able to access both regions with a single account. The team also had to consider the sharing of teaching materials across regions, as geographic location may not always accurately reflect a user's actual location.

After evaluating various solutions, the team settled on Cloudflare Workers as the best option. By using Cloudflare Workers, the company can create a custom API gateway that allows them to route traffic based on user location. This solution provides the company with full control over routing logic and simplifies the process of extending the system as needed. Additionally, Cloudflare Workers are inexpensive, with a low cost for request handling and generous CPU time allocation.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Wednesday 2 September →