RE: [PHP-DEV] serializing references, almost without modifications

From: Date: Thu, 20 Jul 2000 10:58:25 +0000
Subject: RE: [PHP-DEV] serializing references, almost without modifications
Groups: php.dev 
Request: Send a blank email to php-dev+get-25200@lists.php.net to get a copy of this message
Hi David See also my post, respone to waldschrott... It is possible I have a different understanding of what we are referring to as saving state, given that the thread started off as serializing references. However, to continue with my understanding: > >Actually, it doesnt make sense in a stateful application since you, at any >given time, should know the state of the application, hence not HAVING the >need for saving and/or restoring a state except for that one time where you >start/close the application. Does that resemble PHP -- yes it does, it has >to save/restore whenever it gets started/stopped, it just (generally) has >much less properties than a non-web application. > >I don't -- at all -- se why it could possibly be dangerous, but if you'd >care to elaborate, and maybe give some concrete examples rather than all >this vagueness, that be highly appreciated. > OK. My understanding of what we have been talking about so far: Simple example. PHP script creates an XML parser, reads in an XML file, sends first 10 records off to browser, serializes its state, save it, script exits. On the next call from the browser, we restore the state from the previous session, send off the next 10 records, serialize state, save, exit. And so on till finished. My problems with that are: Serializing, or saving, its state means saving where we are in a particular process for a particular client. 1000 clients mean 1000 states, 100,000 clients mean 100,000 states. (If we are talking about saving a reference to the parser in memory and keeping that, the problem is exacerbated). No way is this scaleable. If the client does not return, we have a state that is saved somewhere, that will need to be clean up. This requires someway of tracking and monitoring connections, with all its associated overhead, and safely cleaning up afterwards. If I have totally misunderstood the situation, my aplogies. A couple of years ago I had a large project creating an MTS application under WinNT. I had the hardest time persuading the programmers that MTS is designed around stateless objects, and that they had to think in a different way about their application. The Web is a very similar sort of stateless network, that is its power. It is the only way to remain scaleable from 1 client to millions. cheers -- jalal --

« previous php.dev (#25200) next »