sourcefuse / loopback4-starter

Loopback 4 starter application. Multi-tenant architecture supported. Authentication, Authorization, Soft deletes, environment vars, Audit logs, included.
MIT License
158 stars 59 forks source link

Question: Alternatives to Redis #61

Closed Sheldonfrith closed 3 years ago

Sheldonfrith commented 3 years ago

I'm new to all this so bear with me. Just wondering why this project uses Redis to store revoked tokens, instead of the main SQL database? When implementing LB4 with auth for my apps I would prefer to only have to set up and manage one database, especially since I am completely unfamiliar with Redis. Has anyone implemented this project, or something similar, without Redis? How did you do it?

Thanks!

samarpan-b commented 3 years ago

Redis is only used to store revoked tokens and refresh tokens. Revoked tokens are added to redis when user logs out.

Sheldonfrith commented 3 years ago

Yes, I understand that, just wondering WHY (as opposed to just using the main database to store revoked tokens). Thanks.

samarpan-b commented 3 years ago

For performance @Sheldonfrith and also to avoid load on DB, as this would happen for every request.

Sheldonfrith commented 3 years ago

Thank you! That answers my question.