spring-security-jwt icon indicating copy to clipboard operation
spring-security-jwt copied to clipboard

Why did you load UserDetails from database?

Open TranNgocKhoa opened this issue 5 years ago • 2 comments

Hello,

I see that to get UserDetails information, you call a service method that get these information from database. Is there any reason for that? Because each request comes, server will make a call to database. This will consume a lot of resources.

Thank you!

TranNgocKhoa avatar Nov 05 '19 10:11 TranNgocKhoa

Definitely not a good idea to load the user from the db. it is like having a bike and but walking on foot.

Oualitsen avatar Aug 31 '21 16:08 Oualitsen

Hello,

Did you find any solutions for this? Because I'm doing the same and you are right it's not a good idea to hit database with every request.

Amit-Chavda avatar Aug 06 '22 05:08 Amit-Chavda