Number of queries to check user in the Standard

Asked

Viewed 57 times

1

I have a system of user authentication, where do I use the API sentinel in the Laravel 5.2.

When I do the Check_user() in the middleware to see if the user is logged in and has access to the route, he makes a check of 5 queries in the bank, among them:

  • if the user is logged in
  • permission
  • if active
  • Throttle, etc..

It would be heavy for the system to do this check every reloaded page?

Observing: each query is leading: 2ms

  • I think in this case you should trust the library developer. I think if you worry too much about microtimization, it generates a lot of mischief and crazy in your code. It’s always good to use resources such as caches and the like (Laravel has plenty).

  • Just to enrich the discussion, you should also study the library handbook you are using in your projects at the level of knowledge.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.