his is a story about rescuing a not-so-old system from the legacy architecture design which no longer suits its global requirements.

What and Why

In the summer of 2017, we started to design and build a system that imports and administrates business data in the main business region, then ships the data as a suite of microservice API endpoints and batch file feeds to the global markets.

The database choice was PostgreSQL and the whole infrastructure is on AWS. Since Aurora PostgreSQL didn’t came into being until right before the project start, the database solution was designed to use RDS PostgreSQL with same- and cross-region replicas.

In the main market’s AWS region, the master instance serves write traffic coming from importing upstream data and admin applications, one replica serves in-region API read traffic, while another replica serves all regions’ batch read traffic. In each overseas market, one replica was created to serve that market’s API read traffic.

Image for post

As time went by, the system has been rolled out to three overseas markets. The fourth is supposed to come early next year, when we hit a wall:

RDS only supports up to five replicas, no matter same- or cross-region. (_source)

#database #cloud #aws #postgresql #developer

Migrate PostgreSQL on AWS from RDS to Aurora
1.85 GEEK