At 06:01 PM 6/11/00 -0700, Perrin Harkins wrote:
>On Sun, 11 Jun 2000, Gunther Birznieks wrote:
> > 1. Session management. Because servlets are multi-threaded they have easy,
> > quick access to a shared memory pool. All the locking and shared
> > persistence code used in Apache::Session is rendered moot by the shared
> > memory Java model.
>
>Unless you use a cluster of servers for load balancing and high
>availability, in which case you're right back where you started and you
>need the Java equivalent of Apache::Session::DBI.  I imagine someone has
>written one in one of the many servlet runners out there.
>
>- Perrin

1) Many load balancers actually recognize this and do provide some load 
balancing on IP address. This is definately not perfect of course (when you 
have ISP proxies like AOL)... and then when a machine goes down, it's just 
tough luck that the user has to get redirected and relogin or do whatever 
for the session.

2) On the flip side of that, Java has commercial products that handle this 
type of shared persistence -- one that comes to mind is Gemstone. Even so, 
there are a lot of things about Java that make creating a session 
persistence engine "easier".

For example, you could easily have a middleware java session persistence 
engine which is actually keeping all of the stuff in RAM, but then running 
a low-level thread to write stuff out to a database as it changes. Plus 
keeping a socket open to each servlet engine that it wants to let know a 
change in the real session made.

It's very very difficult to do the same type of architectures in Perl that 
you can do with Java precisely because Perl is not a multi-threaded 
language and never will be as robust in that area -- even if Perl becomes 
robust in this area, the modules will have to be written to support this as 
well.

Anyway, all languages have their advantages and disadvantages, but in cases 
such as session handling, Java Servlets wins out big time.

Apache::Session is awesome for Perl, But take a look at all the hoops that 
Jeffrey has to go through to maintain it and the code inside. It's a tough 
piece of code because it is a matter of sharing a persistent session data 
amongst a whole bunch of processes that don't know anything about anyone else.

And even then.

Programmers of Apache::Session still have to remember to do stuff like 
manually set a timestamp or flush out the session data to disk if a 
reference to a reference in a swizzled data structure is changed becuase 
there is no way for the TIE interface to recognize it. These complexities 
are simply non-issues in Java Servlets because of the in-memory aspect.

Anyway, I am not saying it is bad, Apache::Session is great! But it's 
definately hampered by Perl's architecture.

Later,
    Gunther

__________________________________________________
Gunther Birznieks ([EMAIL PROTECTED])
Extropia - The Web Technology Company
http://www.extropia.com/

Reply via email to