4 ms·
> A place I worked at recently insisted on JWTs despite being a monolith and calling the database on every API endpoint. JWTs are really nice because you can v
by hn_throwaway_99 3y ago
> A place I worked at recently insisted on JWTs despite being a monolith and calling the database on every API endpoint.
JWTs are really nice because you can validate things like roles and permissions just by validating the token signature. And there are much better ways to implement revocation lists than "calling the database on every API endpoint" (if that's what you were referring to). Since revocation lists are usually very small (depending on the nature of your app), it's often possible to just replicate them to in-memory data structures on your servers.
- the_gipsy 3y agoYou're right, but the parent probably meant accessing the DB for every request for stuff other than revocation.
- marcus_holmes 3y agoI did. Thanks :)
- ndriscoll 3y agoAssuming they don't manage to consolidate everything they need for a request into 1 query, one less query is still one less query. They might be cutting their db load in ~half if they had one auth query and one query for the action.