Tech
A missing ORDER BY cost us Thousands in API calls
In 2022, I fixed one of the most expensive one-line bugs we've shipped.
The fix was this:
- Area.all()
+ Area.query().orderBy('id')
That's it.
A missing SQL ORDER BY was causing identical requests to generate different Redis cache keys.
The application worked. Redis worked. MySQL worked.
But our Google Maps API bill had climbed to around €3,500 per year.
The context
I'm the co-founder and CTO of MyCater , a B2B catering marketplace.
One of the t...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to