Re: Questions from a ColdFusion Developer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rob,

Thanks for responding. :) I have more questions. I hope that's okay. :)

You said:
"Share nothing" refers to the PHP philosophy of not tying any data
sharing system to the engine itself. 
In this way developers are free to create applications in such a way that if they need more power, they can just add more computers.
-----
I guess I'm a little confused, by this and by what Jochem originally posted. I'm not sharing data between different computers within the application (if that makes sense). In other words, of course all my data (in this case inventory data) is in a MySQL table, and so multiple users could be accessing the data simultaneously. The session variable only serves to store (for display purposes, really) the results of the users last search. I also maintain a $_SESSION["LoggedIn"] variable to keep track of whether the user has access in this session.

You said:
This becomes a much more difficult issue when a program holds private data in memory that requires a specific way to access it. For instance if you stored some kind of application variable in memory (a la ColdFusion, Java, ASP) then this value would not be normally transparent to other computers without some kind of synchronization system to transfer it around.
----
Perhaps I'm being dense (it wouldn't be the first time), or maybe a bit unimaginative, but I can't think of an instance where while a user is logged into an app and using it, that another computer (besides the web server, database server and the client machine), would need to have access to that data.
Are you referring to "state" here? Or.... well other than passing data around between browser windows, I'm not really sure what you mean. I'd love it if you could find the time to expand on that.

You Said:
Using the share nothing philosophy such data doesn't generally exist, and if it does, then it is stored in a database. Databases are a better system for such data since they were designed for heterogeneous external access and quite handily solve the race condition and deadlock issues.
---
Typically I think of the session variable scope as a way to preserve state. Are you suggesting that state be preserved by dumping information down to and then reading it again from a database? For example my session variable which indicates the user has successfully logged in...

In speaking of *large* scale applications I suppose I might be able to see where you'd want something different than the session superglobal since the more users you have accessing the app and using that scope, the more memory it's taking up on the server. I thought cookies might be used in such cases.  I don't usually use cookies, because ColdFusion has an configuration option of storing session data in the system registry (windows version obviously)... which alleviates the problem of running out of memory via the session scope.

Have I completely missed your point? :)

Thanks again,
Chris
Robert Cummings <robert@xxxxxxxxxxxxx> wrote: On Wed, 2005-12-14 at 20:50, Christopher Jordan wrote:
>
> When you said:
> 
>     "...the strength and simplicity of PHP stem from the decision to make/keep
>     PHP a 'share nothing'  architecture."
> 
> What did you mean, by that? I've not heard of this "share nothing"
> idea. What is the idea of "share nothing" and why is it a strength?
> I'd like to understand so if I'm doing something ass-backwards
> (read: inefficiently), that I can change what I'm doing.

"Share nothing" refers to the PHP philosophy of not tying any data
sharing system to the engine itself. In this way developers are free to
create applications in such a way that if they need more power, they can
just add more computers. This becomes a much more difficult issue when a
program holds private data in memory that requires a specific way to
access it. For instance if you stored some kind of application variable
in memory (a la ColdFusion, Java, ASP) then this value would not be
normally transparent to other computers without some kind of
synchronization system to transfer it around. Then you run into race
condition and deadlock issues. Using the share nothing philosophy such
data doesn't generally exist, and if it does, then it is stored in a
database. Databases are a better system for such data since they were
designed for heterogeneous external access and quite handily solve the
race condition and deadlock issues. That said, you can also use database
replication so that multiple databases servers have an image of the same
database, thus allowing even the database server to scale horizontally.
So how does this relate to your mom and pop requirements... it doesn't
really *lol*, but if you ever create something that becomes the next
Google, it might just scale to a server farm of thousands of computers.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'




			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux