[KLUG Programming] PHP application & fault tolerance

Jamie McCarthy jamie at mccarthy.vg
Sun Aug 20 23:16:37 EDT 2006


phillip9 at hotmail.com (phillip hebenstreit) writes:

> I am thinking this would need to be done as a Java application,
> because of the fault tolerance requirements, since the Java could
> be running on the user's computer and would have logic that could
> direct it to a list of servers based on availability.  (or could
> this also be done with PHP?)

No, client-side Java is unnecessary to get that to work.  The way to
get high availability is to have redundant servers and load
balancers that do quick failover when a server dies.

But:

you're way, way overthinking high availability.  You don't need that
yet.  First you need an application.  Once it runs you will have to
change it so it actually does what you had in mind;  debug it; and
add the features you left off for the rough draft that turned out to
really be important after all.  At that point you will need to get
some users, which it turns out is hard.  Then you need to continue
improving the app while fixing stuff and doing business stuff at the
same time.

Then you need to get 10,000 users on your site every day.

THEN you need to START worrying about high availability.

Seriously:  running 3 webservers instead of 1 and having a load
balancer that fails over dead machines quickly is a piece of cake.
Any web-app sysadmin worth his or her paycheck can set that up in a
week or maybe an afternoon.  MySQL failover is a lot harder but
you're already talking replication so you're on the right track.

None of these is a problem you need to solve now.  Focus on what you
want to do, not the 40 minutes that your site's going to be down for
your users the first time you have to shut it down to upgrade its
RAM.  Go read this:

<http://www.37signals.com/svn/archives2/dont_scale_99999_uptime_is_for_walmart.php>

(or, if someone else in your org is telling you you need to be
worrying about high avail before you even decide whether your app
is running on the client or the server (!), make _them_ read it :)


Oh, and I would never recommend anyone use PHP for any project
larger than one person or six months.  If you're itching to get
started, use what you know I guess, but be prepared to rewrite it
when it gets out of hand.  If it can wait a few months for you to
learn a better tool, jump with both feet into perl, python (check
out Django), or Ruby on Rails...
-- 
  Jamie McCarthy
 http://mccarthy.vg/
  jamie at mccarthy.vg



More information about the Programming mailing list