4 ms·
When the authentication info needs to be used with servers in different location of the world, JWT is better. Getting the session info from a redis server or so
by chmike 10y ago
When the authentication info needs to be used with servers in different location of the world, JWT is better. Getting the session info from a redis server or something equivalent isn't free. Deciphering a JWT token may be faster. So, the most appropriate method depends on the use case.
If all the servers are in one location, a random byte sequence as session id key with cached info is the most simple, compact and efficient.
- jjawssd 10y agoOr you can use read only Redis replication and keep your architecture pretty much the same https://redis.io/topics/replication https://redis.io/topics/replication
- daenney 10y agoWhat happens when that replication breaks? Can people still log in? Can you still validate their sessions? Or are you going to have an outage in a geographical region?