|
-
Mar 30th, 2010, 12:16 AM
#1
Thread Starter
Hyperactive Member
Building a scaleable php application
I've build several php sites, but so far all of them was aimed at being hosted on a single server (shared and dedicated alike).
I'm curious about how one should go ahead to build a php application that can be mirrored across servers (globally).
For instance, one thing that comes to my mind is that one cannot be sure the next request from a user will be served by the same server. So session won't be working (I've read somewhere one can have a session server though, but let's assume that won't be available).
Any readings, articles, tips and pointers on this?
-
Mar 30th, 2010, 07:17 AM
#2
Re: Building a scaleable php application
One solution for the session problem is to have a central shared database which all servers use. Setup the web application to store sessions in the database rather than the default file system method.
As for the files/scripts you can use a version control system like subversion to manage changes across all servers. The other option for this is to just manually upload the files and manually manage changes on all servers but obviously this doesn't look attractive if you have many servers.
-
Mar 30th, 2010, 07:30 AM
#3
Re: Building a scaleable php application
if the web farm is setup and configured correctly, updating the files to a staging location should allow it to be picked up and replicated across the entire farm... but it depends on how it is setup.
As for the end user and sessions... usually what you'll pass around is an ID of some sort. The data related to it is persisted in a database. when a page is accessed, the data is loaded from the database, the page processes, and necessary change in the data is saved back to the data, and the page processing ends and is rendered to the user. That's why on some sites, you'll see things like www.thisisyoursite.com?userid=78569765&sessionID=485674309785043560340 as you go from page to page. The session itself is being persisted on a backend somewhere.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|