Yeah, I've recently been denormalising our prod DB from a design decision made in 2011 (every auditable entity has a creation / soft deletion entry in the auditlog table) because after 14 years, that auditlog table is fucking huuuuge, and when customers are hitting our API to retrieve appointments, they're getting response times of up to 40 seconds because the ORM is doing like five left joins to the massive table just to populate creation / deletion dates in the entities represented in the response.
And that table is so large, there's no chance of running a query in the DB (MySQL sadly) to denormalise the tables joining to it.
So I ended up dumping the denormalised data from Snowflake into an S3 bucket that a Kafka Connect source connector was watching, then writing a script that consumed the Kafka topic and ran updates at the rate of 1 million/hour.
And it terrifies me that this was the easiest way to do this.
View all comments
Show parent comment
1
u/BroBroMate Oct 14 '25
Yeah, I've recently been denormalising our prod DB from a design decision made in 2011 (every auditable entity has a creation / soft deletion entry in the
auditlogtable) because after 14 years, that auditlog table is fucking huuuuge, and when customers are hitting our API to retrieve appointments, they're getting response times of up to 40 seconds because the ORM is doing like five left joins to the massive table just to populate creation / deletion dates in the entities represented in the response.And that table is so large, there's no chance of running a query in the DB (MySQL sadly) to denormalise the tables joining to it.
So I ended up dumping the denormalised data from Snowflake into an S3 bucket that a Kafka Connect source connector was watching, then writing a script that consumed the Kafka topic and ran updates at the rate of 1 million/hour.
And it terrifies me that this was the easiest way to do this.