Introduction to Multi-Tenant Architecture

Learn how to create websites with similar functionality yet different UIs and maintain them across one shared code base using Multi-Tenant Website Architecture.

Have you ever built multiple websites that have similar core functionality but really differ only in a few ways, such as layout and UI? This can be costly and time consuming. Instead of copying and pasting code, giving it different namespaces, and then setting each to a different site name, I will discuss an architecture concept referred to as Multi-Tenant Websites, which helps improve upon the scenario I just mentioned. These websites allow developers to create a multitude of sites with slight discrepancies, while maintaining a shared code-base and appearing different to the end-user. I will go into the main concepts that the Multi-Tenant Architecture Utilizes and show some examples of these.



Tenants



The first piece to start with is having a table in your database to map each tenant (NOTE: When I refer to "Tenant," this term can be used interchangeable with "Website" to limit confusion) to an ID. For this case, a simple Database Table with an Identity column and name of the tenant as shown in Figure 1 will be enough.


Figure 1: Table Containing List of Tenants using the website.

This Table will allow you to Map all tenant specific data to its proper tenant.



App URL and App Settings



This next piece is the most critical concept to successfully differentiate websites from each other sharing the same code base and, in most cases, the same database. From the first section, you might wonder how you determine which tenant is active as a user is navigating to its respective site. Well, you can utilize the URL string and create a mapping table of all the possible URLs for the web server and relate it to its corresponding tenant ID (I will demonstrate the mapping later on in the article). Figure 2 illustrates the table used for the mapping.

Read the Rest of this Article at Developer.com

Related Articles
- Java Standardization Request 168
As an IT professional, it is likely that you have heard portal buzz words including JSR 168 and WSRP. But if you are like many, you may not understand the differences or the benefits of these complementary portal standards.
- Highly Effective Datacenters
- Pattern Summaries: Chain of Responsibility
- Component Architecture-Based Applications
- Service Oriented Architecture
- Portal Development Factory
- Enterprise Java Application Architecture and Design
- GlassFish ESB V2 for SOA Tooling
Regional Articles
- Introduction to Multi-Tenant Architecture Alabama
- Introduction to Multi-Tenant Architecture Alaska
- Introduction to Multi-Tenant Architecture Arizona
- Introduction to Multi-Tenant Architecture Arkansas
- Introduction to Multi-Tenant Architecture California
- Introduction to Multi-Tenant Architecture Colorado
- Introduction to Multi-Tenant Architecture Connecticut
- Introduction to Multi-Tenant Architecture DC
- Introduction to Multi-Tenant Architecture Delaware
- Introduction to Multi-Tenant Architecture Florida
- Introduction to Multi-Tenant Architecture Georgia
- Introduction to Multi-Tenant Architecture Hawaii
- Introduction to Multi-Tenant Architecture Idaho
- Introduction to Multi-Tenant Architecture Illinois
- Introduction to Multi-Tenant Architecture Indiana
- Introduction to Multi-Tenant Architecture Iowa
- Introduction to Multi-Tenant Architecture Kansas
- Introduction to Multi-Tenant Architecture Kentucky
- Introduction to Multi-Tenant Architecture Louisiana
- Introduction to Multi-Tenant Architecture Maine
- Introduction to Multi-Tenant Architecture Maryland
- Introduction to Multi-Tenant Architecture Massachusetts
- Introduction to Multi-Tenant Architecture Michigan
- Introduction to Multi-Tenant Architecture Minnesota
- Introduction to Multi-Tenant Architecture Mississippi
- Introduction to Multi-Tenant Architecture Missouri
- Introduction to Multi-Tenant Architecture Montana
- Introduction to Multi-Tenant Architecture Nebraska
- Introduction to Multi-Tenant Architecture Nevada
- Introduction to Multi-Tenant Architecture New Hampshire
- Introduction to Multi-Tenant Architecture New Jersey
- Introduction to Multi-Tenant Architecture New Mexico
- Introduction to Multi-Tenant Architecture New York
- Introduction to Multi-Tenant Architecture North Carolina
- Introduction to Multi-Tenant Architecture North Dakota
- Introduction to Multi-Tenant Architecture Ohio
- Introduction to Multi-Tenant Architecture Oklahoma
- Introduction to Multi-Tenant Architecture Oregon
- Introduction to Multi-Tenant Architecture Pennsylvania
- Introduction to Multi-Tenant Architecture Rhode Island
- Introduction to Multi-Tenant Architecture South Carolina
- Introduction to Multi-Tenant Architecture South Dakota
- Introduction to Multi-Tenant Architecture Tennessee
- Introduction to Multi-Tenant Architecture Texas
- Introduction to Multi-Tenant Architecture Utah
- Introduction to Multi-Tenant Architecture Vermont
- Introduction to Multi-Tenant Architecture Virginia
- Introduction to Multi-Tenant Architecture Washington
- Introduction to Multi-Tenant Architecture West Virginia
- Introduction to Multi-Tenant Architecture Wisconsin
- Introduction to Multi-Tenant Architecture Wyoming
Related Articles
- Java Standardization Request 168
As an IT professional, it is likely that you have heard portal buzz words including JSR 168 and WSRP. But if you are like many, you may not understand the differences or the benefits of these complementary portal standards.
- Highly Effective Datacenters
- Pattern Summaries: Chain of Responsibility
- Component Architecture-Based Applications
- Service Oriented Architecture
- Portal Development Factory
- Enterprise Java Application Architecture and Design
- GlassFish ESB V2 for SOA Tooling

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML