Posts: 76
Name: Nick Cousins
Location: Northern Ireland
|
That's a much bigger problem than just a little PHP function you're asking for there.
A hosted software service could be ANYTHING!
I have quite a bit of experience in writing SaaS applications with PHP - but there is no one magic trick to know I'm afraid.
There are many possible ways of implementing such a scheme, and it really does depend on what the software does. Key things to remember are to make the software as configurable as possible to make it easier to "clone" instances of it with different properties. You should make such software very secure too, if you're hosting client scripts you don't want them being able to talk to eachother on your server!
In my experience, designing something to work as SaaS involves writing an application which takes parameters to run it - and those parameters govern the application's behaviour and data.
For example, I was hired to create a "hosted website" system which could be used to publish a clone of a site, tailored to each customer's name and branding, and accessed by different domains. Each site could have a different colour scheme and logo, and use the customer's name in copy text.
Rather than create a "site" which could be copied into a folder, and build a new apache VHost each time, I made a single piece of software which read the domain being accessed, loaded it's configuration from a MySQL database and served custom content to the user.
This means when we find a bug or want to update everything, rather than patch 200 customer sites, I simply update my code and all of the sites are patched in one fell swoop.
When doing this, take into consideration the possible scale of your application and code with that in mind. This is when you need to look at perhaps multiple servers, load balancers, primary, secondary, tertiary and more DNS servers, cache servers, database replication.... the list goes on.
I'm not saying it's incredibly difficult to do - but it's not trivial!
__________________
Join Please login or register to view this content. Registration is FREE
Knowledge is power. Never underestimate the power of stupid people in large numbers.
Last edited by HandCoder; 12-06-2010 at 08:14 AM..
Reason: Typo
|