How does SessionValidationScheduler work with distributed applications?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How does SessionValidationScheduler work with distributed applications?

emmeblm
Hi there,

We are implementing some session logic with Shiro and MySql (until CouchBase is ready for us). We need to erase session data from the database periodically and SessionValidationScheduler seems pretty good for it.

Our application is being deployed in Docker behind a load balancer. We can have from 2 to 10 instances running at the same time in production. There is where questions arised about SessionValidationScheduler and its behavoiur with DA.

For performance reasons and in order to avoid concurrent conflicts, we don't wan't each instance of our application to run the session validation scheduler without control. But we can't seem to find any information about making it work properly with distributed applications, so we are looking for inputs on these, like good or bad experiences/knowledge with it.

Thanks,
Reply | Threaded
Open this post in threaded view
|

Re: How does SessionValidationScheduler work with distributed applications?

Brian Demers
You _could_ use something like Hazelcast and just set a TTL, and not worry about it ;)

But if you want to use a DB, and only want to have one service run the task.  You could always create a single purpose app to do that (a non web app that has uses the same Shiro configuration, with validation turned on)



On Wed, Jan 25, 2017 at 10:25 AM, emmeblm <[hidden email]> wrote:
Hi there,

We are implementing some session logic with Shiro and MySql (until CouchBase
is ready for us). We need to erase session data from the database
periodically and SessionValidationScheduler seems pretty good for it.

Our application is being deployed in Docker behind a load balancer. We can
have from 2 to 10 instances running at the same time in production. There is
where questions arised about SessionValidationScheduler and its behavoiur
with DA.

For performance reasons and in order to avoid concurrent conflicts, we don't
wan't each instance of our application to run the session validation
scheduler without control. But we can't seem to find any information about
making it work properly with distributed applications, so we are looking for
inputs on these, like good or bad experiences/knowledge with it.

Thanks,



--
View this message in context: http://shiro-user.582556.n2.nabble.com/How-does-SessionValidationScheduler-work-with-distributed-applications-tp7581469.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: How does SessionValidationScheduler work with distributed applications?

emmeblm
Hi Brian,

We cannot use Hazelcast. In fact, at first we thought about it, but, as I mentioned, we are about to get CouchBase ready (it took some time to be ready for us because of external forces). Couchbase fits better for us than a distributed cache like Hazelcast though. We do need to work for some time with this MySql database, it's pretty much the best option we have for several reasons now.

It doesn't seem like the best option for us to develop a whole new app and get it to prod environments with just this single and tiny responsibility. Separating authentication, session management and so on from our actual app whose responsibility is that one seems more like a hack to me.. But I would like to understand the reasons why you're suggesting this. Have you had problems having SessionValidationScheduler working in a distributed app before? Could you tell me more about this? :)

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: How does SessionValidationScheduler work with distributed applications?

Brian Demers
In reply to this post by emmeblm
I haven't heard of any issues with validating sessions across a cluster.  I mentioned having a separate service as an option but that depends a little on your architecture (micro services, scheduled process, etc)

-Brian

> On Jan 25, 2017, at 10:25 AM, emmeblm <[hidden email]> wrote:
>
> Hi there,
>
> We are implementing some session logic with Shiro and MySql (until CouchBase
> is ready for us). We need to erase session data from the database
> periodically and SessionValidationScheduler seems pretty good for it.
>
> Our application is being deployed in Docker behind a load balancer. We can
> have from 2 to 10 instances running at the same time in production. There is
> where questions arised about SessionValidationScheduler and its behavoiur
> with DA.
>
> For performance reasons and in order to avoid concurrent conflicts, we don't
> wan't each instance of our application to run the session validation
> scheduler without control. But we can't seem to find any information about
> making it work properly with distributed applications, so we are looking for
> inputs on these, like good or bad experiences/knowledge with it.
>
> Thanks,
>
>
>
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/How-does-SessionValidationScheduler-work-with-distributed-applications-tp7581469.html
> Sent from the Shiro User mailing list archive at Nabble.com.