Reducing Unnecessary Database and AI Requests in AmanisesReducing Unnecessary Database and AI Requests in Amanises
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
I was trying to improve latency in Amanises.
The database wasn't actually the only problem.
Amanises is built with Next.js, Hono, Cloudflare Workers, and AI, so a single user action can end up going through quite a few things:
→ API request → Database → AI processing → Response → Back to the client
I started tracing the request flow instead of looking at each part separately.
And I found something pretty simple: some requests were doing work they didn't actually need to do.
Some database calls could be avoided. Some data could be reused instead of fetched again. And some AI flows could be handled more efficiently instead of triggering another request every time.
So I started moving the logic around and reducing unnecessary calls.
The result: fewer database calls per request, less repeated fetching, and fewer extra AI requests. The app feels noticeably snappier.
The interesting part was that I didn't need some huge optimization. I just needed to stop doing unnecessary work.
That's probably my biggest takeaway from this:
Performance isn't always about making things faster. Sometimes it's about asking: "Do I need to do this at all?"
Still building Amanises, but these changes made the request flow a lot cleaner and gave me a much better understanding of how the app behaves once Next.js, Hono, Workers, databases, and AI all start talking to each other.
If your app feels slow and you can't figure out why, DM me, happy to take a look.
What's the most unnecessary work you've found hiding in your own app?
More of my work: unainr.vercel.app
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started