Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>Modularise</h2> <blockquote> <p>My thought was to modularise out everything into seperate services with their own interfaces. So for example messaging would have a messaging interface that might have send and getMessages() as methods and then the PHP web app would simply query this interface through soap or curl or something like that</p> </blockquote> <p>I like the idea of separating every in service modules(good coding principle). I don't like the part about SOAP :(. I think it is way to complex. I would go for something like <a href="http://en.wikipedia.org/wiki/JSON-RPC" rel="nofollow noreferrer">JSON-RPC</a> or something.</p> <h2>Some quick tips:</h2> <blockquote> <p>My team and I are in the middle of developing an application which needs to be able to handle pretty heavy traffic. Not facebook level but in the future I would like to be able to scale to that without massive code re-writes.</p> </blockquote> <ul> <li>Like the others also hinted I would advice you to look at <a href="http://highscalability.com/" rel="nofollow noreferrer">High Scalability blog</a>.</li> <li>First focus on the front-end using <a href="http://developer.yahoo.com/yslow/" rel="nofollow noreferrer">YSlow</a> / google <a href="http://code.google.com/speed/page-speed/" rel="nofollow noreferrer">page speed</a>. This optimization are easy to implement and can give you significantly boosts. A quote from the Yslow webpage:</li> </ul> <blockquote> <p>80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key to faster pages.</p> </blockquote> <ul> <li>I would also advice you to have a look at <a href="http://developers.facebook.com/news.php?story=358&amp;blog=1" rel="nofollow noreferrer">HipHop</a> for php which converts your php code to C code which was a huge boost for facebook. A quote from the article:</li> </ul> <blockquote> <p>With HipHop we've reduced the CPU usage on our Web servers on average by about fifty percent, depending on the page. Less CPU means fewer servers, which means less overhead</p> </blockquote> <ul> <li>I guess another big/easy improvement if not already setup is to use APC(opcode cache) to cache your compiled code. This will give you a huge boost(not necessary for the parts converted to HipHop).</li> <li><p>If you want your websites to scale you have to go by the mantra: </p> <blockquote> <p><a href="http://www.infoq.com/news/2008/06/ram-is-disk" rel="nofollow noreferrer">RAM is the new Disk</a></p> </blockquote> <p><strong>!Cache, cache, cache!</strong> with for example APC, <a href="http://memcached.org/" rel="nofollow noreferrer">memcached</a>, <a href="http://redis.io/" rel="nofollow noreferrer">redis</a>.</p></li> <li>First profile your PHP code then optimize low hanging fruit. I found this <a href="http://www.niallkennedy.com/blog/2006/07/rasmus-lerdorf-php-web20.html" rel="nofollow noreferrer">audio</a> file from Rasmus Lerdorf really useful. When reading the blog post you will find a lot of good tips to improve performance.</li> <li>Also I would consider moving away from the relation database in favor of for example <a href="http://cassandra.apache.org/" rel="nofollow noreferrer">Cassandra</a>. This is a move which I see a lot of big players do recently(for example twitter, digg, facebook, reddit). You will have to go in a complete different mindset this way, but my bet is this will totally be worth the effort.</li> <li><a href="http://decafbad.com/blog/2008/07/04/queue-everything-and-delight-everyone" rel="nofollow noreferrer">Queue everything and delight every one</a> with for example <a href="http://kr.github.com/beanstalkd/" rel="nofollow noreferrer">beanstalkd</a>, <a href="http://www.danga.com/gearman/" rel="nofollow noreferrer">gearman</a> or google app engine's <a href="http://code.google.com/appengine/docs/python/taskqueue/" rel="nofollow noreferrer">taskqueue</a>.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload