Ridho Kurnia Putra

2025Akasha Wira International

API Authentication Cache

An ORM-level Redis layer in front of the auth table, cutting the repeated lookups every external API call was making.

The problem

Every external API call authenticated first, and every authentication hit the same small table through the ORM. The table was tiny and the answer barely changed, but the lookup ran on every single request, so the database spent a meaningful share of its time answering the same question.

Approach

A caching layer at the ORM level rather than in each caller.

Outcome

Repeated auth lookups stopped reaching PostgreSQL. The work happens once and is answered from memory afterwards.

All work