Multi Tenancy


Multi tenant apps
=================
Single Intance Apps - Sales Force
Customized Apps - 
 - Labratory Information
 - E Commerce
 - SharpPoint
 - CRM
 - ERP
SKUs
 - Basic
 - Pro
 - Enterprise
 - $$$$$$$$$$
 
System Behaviors
================
Data Entry
Reporting
Workflow
Valiation
Scheduling
  
 
Behavior customization
======================
Policy & Rule Management
Language of Constraint
 
// BAD: exec usp_CreateLead ....
// * Versioning
// * Maintainability
 
// Bad: leadService = new WebSerivce("http://...");
// * impacts app developments
// * falacies of distriuted computing
// * versioning
// * depencies on customized version
// * configuration
 
 
// Option: bus.Publish(new CreateLead());
// * configuration
// * distribution
// * hosted endpoint
// * easy versioning
// * no chance of breaking existing impl.
 
// BAD!
  string result = leadService.Create(...);
  //result = "<createLead><name>...</name></createLead>"
  tenantCustomizatons.NewLead(ref result);
  leadService.Save(result);
 
 
// conerns
* how do we test customizations?
* how do we debug?
* how do we deploy?
* how do we handle errors? 0xE1230812 is BAD!!!
* how do we handle configuration?
* how do we Xyz where xyz is development practice.
 
 
 
leadService.Create(...);
 
container per customer?
 
Customize UI
=============
Composable UI
License token tree?
changing UI dynamically
 
// UI Application Block
 
Templates
 - easy to write
 - easy to manage
 
 - easy to get into "templates as the hammer"
 
/scripts
  /core
  /tenants
    /northwind
      /contact
        /contact.js
        /contact.view.js
        /contact.new.js
        /contact.edit.js
        /templates
          /erp.contact.id.html.snippet
 
Data customization options
==========================
 
select * from contacts c
join leads l on c.leadid = l.id
where c.tenantid = 'northwind'
 
-- go away and don't change the data
create table customers
(
  id guid primary key,
  name string not null
)
 
 
-- limited extensability
create table customers
(
  id guid primary key,
  name string not null,
  custom1 string null,
  custom2 string null,
  custom3 string null,
  custom4 string null,
  custom5 int null,
  custom6 int null,
  custom7 int null,
  custom8 datetime null
)
 
-- recursive extensability
create table Rules
(
  id,
  type,
  val1big,
  val2big,
  val3small,
  val4small
)
 
 
-- xml
create table customers
(
  id guid primary key,
  name string not null,
  extension xml
)
 
-- extension table
create table customers
(
  id guid primary key,
  name string not null
)
 
create table northwind.customers
(
  id guid primary key,
)
 
 
-- custom table
 
create table customers
(
  id guid primary key,
  name string not null,
  is_justin_angry bool
)