Session Theory - Multiple 4D Client Web Servers

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

Session Theory - Multiple 4D Client Web Servers

Justin Will
I am trying to theorize how sessions would be handled in the case of
multiple 4D Client computers serving web pages with a round-robin load
balancer.

I know that by default A4D stores sessions in memory, but in the case of
multiple 4D Client web servers I would think the sessions would have to be
stored in the database so that any client would have access to the session
info.  Now that just opens up a huge can of worms in my mind because which
4D Client's housekeeper process would manage the session timeouts etc.

Perhaps the best way to handle this would be to have 4D server house all of
the session data in memory and the client computers uses Get Process
Variable/Set Process Variable on the server.

I don't necessarily need multiple web servers yet, but I want to know that
I have it worked out and could move quickly in case a site I'm working
takes off.

Thanks
Justin


_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Session Theory - Multiple 4D Client Web Servers

Peter Jakobsson-2

> I am trying to theorize how sessions would be handled in the case of
> multiple 4D Client computers serving web pages with a round-robin load
> balancer.

Hi Justin

I’m quite interested in this as well. I work with a site that’s load balanced across 3 or 4 servers (each with Active4D running under 4D Client / Remote).

We just dealt with the problem by avoiding it. Most of the site runs sessionless. Certain functions kick off a session (like when a customer puts the first product into their basket). From that point on Apache directs all requests for that session to a single “master” server.

Obviously if you were running sessions for the entire site then you’d need to solve it more comprehensively, like having the load balancer randomly nominate a server to manage the entire lifetime of the session.

> Perhaps the best way to handle this would be to have 4D server house all of
> the session data in memory and the client computers uses Get Process
> Variable/Set Process Variable on the server.

That’s an interesting idea and one I hadn’t thought of. The big question would if does it create a bottleneck that offsets or cancels out the benefits of load balancing.

Peter

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Session Theory - Multiple 4D Client Web Servers

aparajita
Administrator
> Obviously if you were running sessions for the entire site then you’d need to solve it more comprehensively, like having the load balancer randomly nominate a server to manage the entire lifetime of the session.

That's the approach others have taken. Once a user is routed to a given server, they stay with that server.

Regards,

  Aparajita

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/