« DynamoDB replica to MySQL

December 15, 2017 • ☕️ 1 min read

DynamoDB might not be good for everyone, but after almost six months of usage at Labrador I am so far pretty happy with it.

I often hear that one of the downsides of Dynamo is querying: indeed, you will need to design your keys carefully but you can also copy the data over a second store to run ‘traditional’ aggregations.

That’s what we did, we evolve constantly a dynamo NoSQL schema, but we propagate certain fields and their data(which are more stable) downstream to a MySql database.

That way we can query and run reports (we use the excellent Redash) on MySQL, if you can afford it you can propagate the data over to Redshift, or now AWS made things even simpler and you can run Aurora Serverless.

The code is pretty straightforward, a Lambda listens to the DynamoDB stream and runs the necessary SQL to Create/Update/Delete the data in the MySQL database.