Any use of using Hazelcast instead of MongoDB to store user sessions / keys?

We run an instance of mongodb to store data in collections, no problems with it, and mongo is our main data warehouse.

Today we are going to develop Oauth2 product support and should store user sessions (security key, access token, etc.), and the access token should be checked on the authentication server only after a certain timeout so that not every request will wait for authentication by the authentication server. The first request for a secure resource (creation) must always be authenticated against the authentication server. Any subsequent request will be checked internally (cache) and checks the internal timeout, and only if expired, another request will be issued to the authentication server.

To solve these requirements, we need to introduce some kind of distributed cache, store (with TTL support) user sessions, etc., expire based on ttl ... i wrote about it above.

Two options:

  • storing a user’s session in a carousel and sharing it on all application servers is an excellent choice to save all user sessions on the eviction map.
  • store user sessions in MongoDb - and do the same.

Do you see any benefits of using Hazelcast instead of storing temporary data inside Mongo ? What significant performance improvements do you know?

I am new to Hazelcast , so I don’t know about all the killer features.

+5
source share
2 answers

Disclaimer: I am the founder of Hazelcast ...

  • Hazelcast is much simpler and simplicity matters.
  • Hazelcast ( Java). nosql .
  • Hazelcast . JSON . java-.
  • Java- . ; .
  • . " , ".
  • Hazelcast , , , , , .. , / ... :)
+16

Hazelcast - , , MongoDB . Java, .

, github. Maven.

+2

All Articles