Results 1 to 3 of 3

Thread: Building a scaleable php application

  1. #1

    Thread Starter
    Hyperactive Member Krokonoster's Avatar
    Join Date
    Jan 2010
    Location
    Cape Town
    Posts
    448

    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?


  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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.
    Chris

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width