Farming PHP Preview

Even though issue 03.05 is not out yet, I am already deep in thought about my next article for International PHP Magazine. I’m planning to tap my experience architecting and building scalable web server farms for PHP/MySQL applications to bring you an overview of the issues involved. Combined with the forthcoming issue on Enterprise PHP Coding Standards, this should flesh out some of my thinking and experience implementing PHP solutions for business-critical applications.

Some of the issues I’m considering tackling in my “Farming PHP” article include:

  • Load Balancing versus Round-Robin DNS
  • Web Log Aggregation
  • Separating the PHP and SQL layers via a private network:
    • Configuring multiple interfaces
    • Naming the network via /etc/hosts
    • Hardening the network
  • Leveraging MySQL master/slave replication:
    • For failover using heartbeat
    • To offload read-only reporting
    • For backup
    • For local read-only operations
  • Offloading periodic operations to a separate server
  • Offloading mail sending operations to a separate server using Mail_Queue
  • Dealing with PHP sessions in a distributed environment
  • “Sticky” load balancing sessions
  • Dealing with file uploads in a distribtued environment
  • Separating the backroom/admin functionality from the public-facing app.
  • Pushing files to the farm:
    • Similarities to a compiled model
    • Establishing homogeneous user/group permissions and root trust
    • Setting up incremental, periodic file push when necessary
    • Optional encoding
    • Maintaining versioning on source code for possible rollback
  • Using shared filesystems
  • Modifying existing applications and packages to run on the farm
  • The importance of coding standards in a farmed environment
  • The three primary benefits of farming and tradeoffs involved with different approaches:
    • Redundancy
    • Scalability
    • Mantainability

Sound interesting? Stay tuned for more as I flesh out my thinking, prepare diagrams, and otherwise sift through my experiences bringing best-practice scalability to the powerhouse web development combination of PHP and MySQL.