Share what you know with millions of people

Focus is the best place to turn what you know into remarkable content
×
0

Conversion of Web Applications to SAAS Model

Introduction

What are SOA and SAAS?

Service Oriented Architecture (SOA) is nothing but providing application service via single and robust application engine with the combination of single or multiple services.  Software as a Service (SAAS) is a service delivery model. One single application engine coordinates and communicates between various applications and providing service to the end user via web interface. Multiple instances of same application (or web site) can be delivered to end user based on user requirements and client application requests. For example, let’s consider two web sites www.site1.com and www.site2.com . Here assume that both web sites are project management web sites. Site1 requires its own user base and projects, which are completely different from site2. SAAS architect will design a project management web application in such a way that its application structure will help to store and retrieve data corresponding to site1 and site2. SAAS architect will take some more steps to give data security and data isolation based on application environment settings. Based on requirements, it’s possible to add or remove web site components to each web site from the core application pool. SAAS architecture and payment systems helping to maintain SLA (Service Level Agreement) for each web site under the service. I am going to explain you about various steps involved in creating a SAAS application.

 

Virtual Host

SAAS implementation requires few virtual hosts in the web server. I’m going to create two virtual hosts in my local windows machine via windows host and apache virtual host settings.

 

  • demo1.najeem.com
  • demo2.najeem.com

 

Make sure both document roots are pointing to same application folder.

 

  • D:\xampp\htdocs\saaspm

 

It will ensure demo1.najeem.com and demo2.najeem.com will load content from same directory, say D:\xampp\htdocs\saaspm, where I have copied my project management SAAS application. Htdocs is my apache server default root folder.

 

Analysis

Conversion Steps

My assumption is that you have a fully functional project management application in saaspm folder as mentioned earlier. Following are the conversion steps.

Create global site’s table (master)

Create a new table in saaspm database for global sites. This table has a minimal schema as follows (XML).

<collab>

  <!-- Table master -->

    <master>

        <globalid>101</globalid>

        <globalkey>3cc1224dcdb34dc16b24b24843714b06cbc30d4f</globalkey>

        <globaluser>demo1admin</globaluser>

        <globalpass>demo1pass</globalpass>

        <globalstatus>A</globalstatus>

        <globalurl>demo1.najeem.com</globalurl>

    </master>

    <master>

        <globalid>102</globalid>

        <globalkey>59b5093df9d6e465786829a3036878d80b716833</globalkey>

        <globaluser>demo2admin</globaluser>

        <globalpass>demo2pass</globalpass>

        <globalstatus>A</globalstatus>

        <globalurl>demo2.najeem.com</globalurl>

    </master>

</collab>

 

Create Bootstrap

Create a bootstrap file with the following code.

$g = new GlobalSite;

            $con = $g->Connection();

            echo 'Site ID is '. $g->siteID($_SERVER['HTTP_HOST'],$con);

 

Here I’m calling a custom class file that I have created for getting database connection and then global SiteID.

$_SERVER['HTTP_HOST'] will give the current web site domain name. siteID method will return unique global site ID (globalid) for that domain.

After all we have identified which domain is requesting the system resources. Based on the globalid, site specific information can be loaded or transferred to the requester.

Enhance Schema for SAAS

Since we are converting an existing application (saaspm) to SAAS model, we have to customize the database schema of application. There is only one additional field in the schema which is the globalid. Revised schema for table ‘users’ is as follows.

 

<collab>

  <!-- Table users -->

    <users>

        <id>1</id>

        <globalid>102</globalid>

        <name>najeem</name>

        <fullname>Administrator</fullname>

        <password>e10adc3949ba59abbe56e057f20f883e</password>

        <email>test@najeem.com</email>

        <admin>t</admin>

        <private>0</private>

        <guest>0</guest>

        <deleted>f</deleted>

        <locale>en</locale>

    </users>

</collab>

 

Similarly identify and modify tables that require ‘globalid’ for domain specific settings.

Code customization

In order to fit with new schema and resource isolation or filtering based on globalid (unique and domain specific), you have to enhance the sql queries through out the application.

A basic example is to change queries with proper ‘WHERE’ condition to account the globalid filtering.

Installation

After updating required SQL queries in application, it’s ready to port. If you want to install SAAS project management application in a new server, you can export the modified database and move the updated script files and do your configuration for global site. Create your SAAS admin interface.

Run Application

End User

End user can browse the web site as http://demo1.najeem.com or http://demo2.najeem.com . Session handling is based on individual domain and hence user from demo1 can’t login or access demo2 and vice versa.

Site Admin

Site admin can access project management admin section and manage his web site settings, users, projects etc. Site admin of demo1 can’t access demo2 as explained before.

SAAS Admin

SAAS application settings, components, modules, accessibility, payment etc can be managed from SAAS global admin. SAAS admin interface is a custom development or an enhanced admin interface of project management application. Here any additional functionality can be implemented for payment, SLA etc.

Global Settings

Global settings such as module management, theme management, price management, subscription management, payment settings, domain management, account management etc.

Module Management

Global admin can install and uninstall plug and play modules from this interface. Based on domain user’s subscription level, these modules are made available to those domains.

Theme management

Global admin can install and manage themes which are made available to domain users.

Pricing and Subscription

Module listing and pricing can be configured. Those domain users who require specific modules need to purchase and subscribe for a specific period.

SLA

No restrictions in subscription as will help to start / close account any time. Service Level Agreement specifies the Terms of service (TOS) and that will help the domain user to use the service.

Scalability

SAAS application has a centralized application engine and module repository. Module updates will directly affect all web sites. It will help to add new modules and expand application. Core application updates can be done centrally.

Security

Application security is centrally managed and domain specific security is maintained based on globalid. Apart from traditional web sites, SAAS application has limitations that domain user has no access to source of application.

Advantages

SAAS model has many advantages over traditional web applications.

  • SAAS provides one centralized application engine which is very easy to maintain
  • Domain user has no head ache of web site hosting and maintenance.
  • Domain user has flexible SLA to start or terminate service.
  • Very easy and less time consuming to set up a new web site in SAAS
  • SAAS reduces cost in a great extent.
  • Secure and powerful

Disadvantages

SAAS model has some disadvantages also there. A few disadvantages are here.

  • All web sites under the SAAS framework will go down if the central application goes down.
  • It consumes much higher bandwidth for all shared web sites.
  • It required load balancers and clustered servers to run the services.
  • Data is storing in 3rd party database and hence its marketability is suspicious.

 

Conclusion

SAAS application frameworks are one time investment for enterprises service provider. SAAS conversion of existing web applications will help to create deployment of new websites on the fly. Conversion to SAAS is very simple process of enhancing the application scripts and database schema. A few shell scripting will automate the domain registration and hosting of application based on SAAS model. SAAS has lot of advantages and few disadvantages. It’s advisable to go for SAAS as it provides low risk and cost, reliable and flexible SLA.

Disclosures and References

http://www.httpgain.com - Custom SAAS application by Najeem M Illyas

http://www.focus.com/briefs/information-technology/z-drupal-multi-site-implementation/ - Focus brief by Najeem M Illyas

Be the first to comment on this focus brief