Company
Date Published
Author
Billy Ceskavich
Word count
1408
Language
English
Hacker News points
None

Summary

Knock, a company providing APIs for integrating notifications into products, faced performance bottlenecks in their Amazon Aurora PostgreSQL database, primarily due to expensive transactions being lumped under a single COMMIT statement in Amazon RDS Performance Insights. To address this, Knock modified their Elixir PostgreSQL driver, Postgrex, to prepend SQL comments to COMMIT statements, thereby allowing the Performance Insights to enumerate individual transactions. This approach enabled Knock to identify and prioritize which transactions were causing the most database load, leading them to batch transaction creations and consider migrating some data to other datastores. The company has observed no negative performance impact from this modification, has made it a permanent feature, and is considering discussing this change with Ecto maintainers for potential upstream integration. Knock's experience with SQL comment injection to gain granular insights into transaction performance could benefit others facing similar database challenges.