Case study
From one data center to three continents
Users on four continents got the same service, with no big-bang migration.
Results at a glance
- 400k+ users served across North America, South America, Asia and Europe
- Lower network latency and better quality for distant users
- A move to the cloud with zero downtime
Cloud & infrastructure / Software architecture / Engineering leadership
Problem
The platform started in one data center. As the user base grew past 400,000 across North America, South America, Asia and Europe, distance itself became the problem: every session from the far side of an ocean paid for it in latency and quality.
I co-founded the company and ran engineering as CTO. The platform carried VoIP and cloud telecom services for underserved and underbanked communities, many of them immigrants, sold directly and through local resellers who ran their own businesses on our hosted platform. It was built on open-source VoIP with an in-house billing system, and it handled millions of dollars in transactions.
We built the first data center ourselves: racked the servers, ran the cabling, configured the routers and switches, and wrote the software. We planned it deliberately, with web, application and data as separate tiers for clarity, and that choice later made leaving possible.
Real-time voice is the hard case for distance. Audio that crosses an ocean twice arrives late and arrives damaged, and no amount of server capacity fixes latency. A data center also buys capacity in large, lumpy steps, while a startup’s revenue grows in small, uneven ones.
Constraints
- A small engineering team that also owned operations
- No downtime window: users were active in every time zone
- Real-time traffic, which a static CDN cannot hide
- Startup budget: capacity had to follow revenue
Architecture & approach
Keep one architecture and run it in three places. Each region carries the full web and application tier, users resolve to the nearest healthy region, and data replicates back to a primary. Regions went live one at a time, so every step could be rolled back.
- North America to Geo-location routing
- South America to Geo-location routing
- Asia to Geo-location routing
- Europe to Geo-location routing
- Geo-location routing to Region NA
- Geo-location routing to Region EU
- Geo-location routing to Region APAC
- Region NA to Primary data
- Region EU to Primary data
- Region APAC to Primary data
Key decisions
How should distant users reach the platform? 301-3.1
Voice can’t hide behind a cache, so a CDN would have sped up the parts users noticed least. A separate instance per market would have meant a forked codebase and a team split across it. Running the same architecture in each region kept one product and one team, and the clean tiers from the first data center moved as units.
Which path should a call’s audio take? 301-3.2
Geolocation from an IP address is an estimate, so the routing needed a sensible fallback for when it was wrong. As a single change it raised call quality for distant users and cut the bandwidth bill, because we stopped paying to haul audio across the world and back.
How should the migration run? 301-3.3
Users were active in every time zone, so there was never a quiet hour to cut over. Going one region at a time meant each step could be watched under real traffic and reversed if it misbehaved, at the cost of a longer project.
How it was delivered
Each region carried the full web and application tier. Users resolved to the nearest healthy region through geo-location DNS, and data replicated back to a primary. Regions went live one at a time, with customers on calls throughout and a way back at every step.
Media routing changed alongside the regions. We estimated each caller’s location from the source IP and steered the audio through the nearest appropriate media path instead of hairpinning it through a single site. Least-cost routing picked the cheapest carrier for each call, and we tuned it with call statistics so the cheapest route also had to deliver acceptable quality.
The team that built the platform also ran it, so the migration happened alongside day-to-day operations rather than as a separate project. Over the life of the company the team grew to more than 30 people, and the architecture grew with the customer base.
Outcome
- 400k+ users served across North America, South America, Asia and Europe
- Lower network latency and better quality for distant users
- A move to the cloud with zero downtime
- A lower cost structure: capacity followed revenue, and audio stopped crossing the world and back
- Multimillion-dollar growth and a successful acquisition
Technology
Multi-tier web & mobile application, Open-source VoIP (Asterisk, OpenSIPS, MediaProxy), In-house billing system, Least-cost routing, Data center design, Cloud regions (NA / EU / Asia), Geo-location DNS routing, Data replication
Lessons & tradeoffs
- Latency is a product feature. Users feel geography before they notice any new feature.
- Designing the first data center carefully made leaving it easier. Clean tiers moved as units.
- The best capacity decisions avoid consuming capacity in the first place.
Tradeoffs accepted
- Three regions took more operational attention than one site. We accepted that because capacity could follow revenue instead of leading it by a rack at a time.
- Replicating to one primary kept data consistent and easy to reason about, at the cost of writes from distant regions travelling further than reads.
- A staged rollout took longer than a single cutover. The extra time bought a way back at every step.