Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Dev Link2009 Multi Tenancy Beyond The Whiteboard Chris Hefley


Published on

Multi-Tenancy: Beyond the Whiteboard. Presentation from Devlink 2009, Nashville, TN, Chris Hefley

See sample project at

Published in: Technology, Design
  • Be the first to comment

Dev Link2009 Multi Tenancy Beyond The Whiteboard Chris Hefley

  1. 1. Multi-Tenancy: Beyond the Whiteboard<br />Chris Hefley, Bandit Software<br />Blog:<br />Email:<br />Twitter: @indomitablehef<br />
  2. 2. Multi-Tenancy<br />
  3. 3. The Big Decision<br />Database Per Tenant<br />Schema Per Tenant<br />Tenant Id per Row<br />Tenant as Aggregate Root<br />
  4. 4. Other Considerations<br />The Url<br /> (<br /> (<br /> (<br /> (<br />Data access<br />ORM<br />Dynamic SQL<br />Stored Procedures<br />
  5. 5. Design Goals<br />Agnostic<br />Secure<br />Maintainable<br />
  6. 6. Design Patterns: Repository<br />Domain Model<br />public class Person {…}<br />Repository (PersonRepository)<br />repository.Find(PersonQuery q) {…return Person}<br />repository.Remove(Person p) {}<br />respostory.Add(new Person {…})<br />repository.ListByProject(Project p) {…return List&lt;Person&gt;}<br />Data Access Layer<br />dao.RetrieveOne(Dictionary&lt;string,object&gt; parameters)<br />dao.Delete(person.Id) <br />dao.SaveOrUpdate(Person p)<br />dao.RetrieveAll( Dictionary&lt;string,object&gt; parameters)<br />
  7. 7. Repository as Boundary<br />Your Application “Knows Nothing”<br />Repository<br />Effectively adds:<br />“WHERE TenantId =“<br />To every set of criteria passed on to the data layer<br />
  8. 8. Design Patterns: DI/IOC<br />
  9. 9. Inversion of Control<br />
  10. 10. Inversion of Control<br />
  11. 11. First Benefit: Testing<br />
  12. 12. But wait, there’s more!<br />
  13. 13. SokMunkae Data Model<br />Organization<br />User<br />Project<br />Task<br />