Company
Date Published
Author
Armin Ulrich
Word count
1021
Language
English
Hacker News points
None

Summary

The article describes a slow query that led to a cascading failure in the `placid.app` SaaS application, which generates creatives at scale. The query calculated a user's credit balance and was triggered by API endpoints handling creative generation, causing thousands of concurrent slow queries due to high throughput requests. The developer identified the issue by analyzing monitoring data and error logs with tools like Sentry, and fixed it within 10 minutes. To prevent similar issues in the future, the application has optimized the query by storing partial credit balance aggregations and implemented fallback strategies to prevent repeated database hits after failures.