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.
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. The messaging application could then be any kind of application so a Java application or Python or whatever was suitable for that particular functionality with its own seperate database shard.
Is this a good approach?
Modularise
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 JSON-RPC or something.
Some quick tips:
If you want your websites to scale you have to go by the mantra:
!Cache, cache, cache! with for example APC, memcached, redis.