22
Multi-tenancy with MVC3 and Entity Framework -By Lasantha Bandara

Multi tenancy with mvc3 and entity framework

Embed Size (px)

DESCRIPTION

How to implement a Multi-Tenant web application using Asp.net MVC3 and Entity Framework.

Citation preview

Page 1: Multi tenancy with mvc3 and entity framework

Multi-tenancy with MVC3 and Entity Framework

-By Lasantha Bandara

Page 2: Multi tenancy with mvc3 and entity framework

What is a Tenant? Literally

“A person who occupies land or property rented from a landlord”

Page 3: Multi tenancy with mvc3 and entity framework

Is there any better example than Exilesoft…?

Page 4: Multi tenancy with mvc3 and entity framework

Is there any better example than Exilesoft…?

Moota

Page 5: Multi tenancy with mvc3 and entity framework

Is there any better example than Exilesoft…?

Moota

Pro-Account

Page 6: Multi tenancy with mvc3 and entity framework

They are Tenants of Exilesoft…

Moota

Pro-Account

Exilesoft

Page 7: Multi tenancy with mvc3 and entity framework

Same situation applies to the cloud based software applications. In SaaS (Software as a Service) Model Most of the web applications are SaaS – But

not Multi-Tenant…! Multi-Tenant Examples,

Highrise Jira YaY

In these systems, organizations make their accounts and they are provided a look and feel of their own ‘Home’

Page 8: Multi tenancy with mvc3 and entity framework

Why this is so important?

Data is vital for some businesses.

Should be able to isolate data among tenants in SaaS model.

If we provide it…. We have Competitive Advantage.

Page 9: Multi tenancy with mvc3 and entity framework

That implies…

Data Architecture is the most significant factor in a Multi Tenant Application.

Page 10: Multi tenancy with mvc3 and entity framework

We can identify 3 different architectures at present…

Separate DB – Separate Schema Shared DB – Separate Schema Shared DB – Shared Schema

Page 11: Multi tenancy with mvc3 and entity framework

Separate DB – Separate Schema

Extendibility with tenant specific requirements Easy Backup High Cost Suitable for Medical and Banking applications

in spite of high cost

Page 12: Multi tenancy with mvc3 and entity framework

Shared DB – Separate Schema

Separate set of tables for each tenant in same DB

Extendible and easy to implement Suitable if No. of Tenants < 100 Low cost than the previous one

Page 13: Multi tenancy with mvc3 and entity framework

Shared DB – Shared Schema

Lowest Cost Additional development effort Less security Each row contains tenant Id Suitable for a huge cluster of tiny tenants

Page 14: Multi tenancy with mvc3 and entity framework

Choosing an approach

Cost Based

Page 15: Multi tenancy with mvc3 and entity framework

Security

Shared Isolated

Page 16: Multi tenancy with mvc3 and entity framework

Tenant Attributes

Page 17: Multi tenancy with mvc3 and entity framework

Regularity Consideration(legal requirements of companies)

Skills set of development team

etc…

Page 18: Multi tenancy with mvc3 and entity framework

In YayCRM we have invented a model that is supported all those architectures

You can,- distribute databases in a server

farm- expand and shrink the number of databases- move tenants among databases

Page 19: Multi tenancy with mvc3 and entity framework

Tenant Databases

Metadata Database

Client Application Server

Structure of a

simple Multi-Tenant

Application

Page 20: Multi tenancy with mvc3 and entity framework

This is Yay

Model

Page 21: Multi tenancy with mvc3 and entity framework

Let’s go to demo…

Page 22: Multi tenancy with mvc3 and entity framework