We migrated over 100 million World War Heroes player accounts from two separate game platforms - iOS and Android - into a single shared server. The databases had overlapping IDs in every table, and the social graph meant we couldn't move users one by one. We needed under two hours of planned downtime, the ability to roll back, and a way for QA to test on real production data before release.
This article covers how we solved it using Postgres logical replication with a custom middleware layer that transforms data on the wire. You'll see how we handled the ID offset scheme across regions, the business logic edge cases we didn't expect, and what went wrong on release night, and how the merge unexpectedly changed matchmaking quality.
Our game, WWH, runs on both iOS and Android. For historical reasons, these two platforms always had completely separate backend infrastructure - separate servers, separate databases, separate everything. At some point we decided to merge both platforms into a single server with one shared player pool.
Each platform had 11 databases per region, with game data on the main cluster and statistics on a separate one. Three regions: EU, NA and AS. Around 50 tables total per platform. Total data volume: 4.8 TB on the largest EU server alone, over 9 TB combined. Everything ran on Postgres 13.
Every entity in every table on both platforms had overlapping primary keys. User ID 1 on iOS is a different person than user ID 1 on Android, and the same goes for clan IDs, item IDs, weapon IDs, transaction IDs - everything.
Source link







