❔ Will this operation be expensive or not?
During a request, I'm checking whether a user is currently suspended or not. So during each request I'm hitting the database and getting the user It just feel like this is not the right way?
5 Replies
nah, it's fine
odds are your database and app are co-located, so the latency isn't gonna be a huge deal
if you OBSERVE performance issues with this, due to request volume, then you just add a caching layer
Yeah the app and database are co-located. Will I need to live in my car though? Is it going to be expensive money wise 🤣 😁
no idea, honestly
Totally fine, your user id column is certainly indexed, the lookup will be super fast - can always add caching later if you have millions of requests or something
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.