• LightSwitch Multi-tenancy – Introduction

    Posted Nov 7th, 2013 By in Cloud Computing, LightSwitch With | No Comments LightSwitch Multi-tenancy – Introduction

    It would appear that the top suggested topic on the PaulSPatterson.UserVoice.com site is the Automated Multi-tenant Applications topic. I kinda figured it would be a popular suggestion because it is one that I have been wanting to try for some time now.

    So, with that being said, I am going to create a proof-of-concept multi-tenancy solution using LightSwitch, and blog about it in the hopes that you can learn from what I do (and do not). Keep in mind that I just said I am going to create something. I have only just started investigating how to do this, and haven’t actually started anything yet.


    Before I hunker down with the low level stuff, it would help op define some scope for my proof-of-concept. I thought I’d brainstorm a bit and jot down a bit of a usage scenario to help me set some boundaries about what I am going to be doing.

    I am thinking of this as a usage scenario…

    • A person will navigate to a New Tenant registration System (web site).
    • The person will enter information about their organization, as well as information about their default tenant administrator user.
    • The System will save the new Tenant information, as well as create the default Tenant Administrator User.
    • The System will send an Email with a hyperlink containing unique new user registration confirmation code.
    • The User will open the email and navigate to the registration confirmation website using the URL in the email.
    • The System will inspect the confirmation code and activate the new User.
    • The System will then present the User with the login screen (for the LightSwitch application)
    • The user will enter their credentials and press the login button.
    • The System will evaluate the login credentials to authenticate the user.
    • The System will present the User with the home screen.
    • The System will perform data actions that are in the context of the Tenant that the User is for. No other Tenant data will be accessible to the user.

    Albeit there is some work to do for the registration system, but that is something that needs to happen anyway. But before I even start on that, I want to take a look at some high-level concepts that talk to multi-tenant architectures.

    Data Isolation

    One of the first articles I found, and arguably the most relevant to what I am trying to achieve, is this 2006 MSDN article titled  Multi-Tenant Data Architecture. The article talks about three approaches to managing multi-tenant data, which is essentially what I want to do.

    What I need to first determine is what degree of isolation I want to use for the data in my application. Do I need to have tenant data completely isolated from other tenant data, such as in separate databases, or can the data for each tenant reside within a shared environment?

    multi-tenant-approach-001(image source: Microsoft – http://msdn.microsoft.com/en-us/library/aa479086.aspx)

    Let’s have a bit of a discussion on this degree of isolation stuff.

    Separate Databases

    The first approach would be isolate the data by creating separate databases for each tenant. This would certainly provide for an easy way to logically separate the data for each tenant. To implement this approach, I would have to create functionality that provisions a new database for each new tenant registration. I would then have to engineer the LightSwitch client to dynamically connect to the appropriate database with each user log in. To me, this would require more maintenance work than I am willing and able to perform.

    Separate Schemas

    I suppose I could try and stick with one database and then create separate database schemas for each tenant, but how much different, really, is that to using separate databases? Yeah, I can take advantage of the fact that I am using just one database, however I still have the same scale application connectivity functionality and maintenance , for the most part anyway, as that of having the separate databases. So where am I better off on this one?

    Same Database

    How sharing all tenant data in one database, with one schema? Having a shared repository for all tenant data would certainly mitigate most of my concerns regarding database maintenance. The single database and schema would eliminate the need to have any requirement for dynamic data connections.

    LightSwitch has the flexibility to be able to apply row level filtering to data sources. This is a great feature that presents an excellent opportunity to abstract and contextualize  tenant data in the application. By applying filtering to the data, I should be able to serve up only the data the logged in user has access to.

    multi-tenant-approach-002(image source: Microsoft – http://msdn.microsoft.com/en-us/library/aa479086.aspx)

    My Approach

    Well, you can probably already tell which approach I am going to take with the creating of this prof-of-concept. I am going to use a single database, with a single schema. I am going to leverage row-level filtering to only allow users to work with the data for the tenant that the user is attached to.

    Having said that, here is what I intend to do:

    • Create a Tenant Registration system – an ASP.Net MVC web application
      • Create a user registration confirmation messaging system
      • Use an Azure SQL database as the data store
      • Use SendGrid for messaging
    • Build a LightSwitch application
      • Leverage row level filtering,
        • possibly use some kind of pattern so that the filtering is applied globally, rather than manually creating filters for each data entity.

    Well? How does all that sound? Let the journey begin!

  • Windows Azure Import Export Service

    Posted Nov 7th, 2013 By in Cloud Computing With | No Comments Windows Azure Import Export Service

    Whoa. This sounds to be a promising value add – the Windows Azure Import/Export Service. Essentially securely ship hard disk drives to a Windows Azure data center. Once received, Microsoft will transfer the data to your Azure storage account. This is a great opportunity to import and export massive amounts of data more effectively, rather than trying to chew up valuable bandwidth.

    Here are some resources that you can reference regarding this new service:

    I am curious how many organizations will take advantage of this feature.

  • Tyler Doerksen – Azure Websites vs Cloud Services

    Posted Nov 7th, 2013 By in Cloud Computing, Office 365 With | No Comments

    A big shout-out and thank you to Tyler Doerksen for his recent “Azure Websites vs Cloud Services” post. This was a very timely post because I’ve recently had a number of people asking me that very question.


    I encourage you to head on over to Tyler’s post for a fuller explanation of the major differences between Azure websites and cloud services. For a quick reference, here is the table that Tyler uses to demonstrate the differences:

    Scale Out to Multiple Instances Without Redeploy Yes Yes
    SSL Yes Yes
    Visual Studio Integration Yes Yes
    Deploy from TFS On-Prem or Online Yes Yes
    WebMatrix Support Yes No
    Fast Deployment Yes No
    Instances Share Content and Configuration Yes No
    Multiple Deployment Environments (Production and Staging) No Yes
    Network Isolation No Yes
    Support for Windows Azure Traffic Manager Preview No Yes
    Support for CDN No Yes
    Remote Desktop Access No Yes
    Execute Start-Up Tasks No Yes

    Thanks again Tyler!

  • The 2013 Fall Season

    Posted Oct 6th, 2013 By in Miscellaneous With | No Comments

    It’s been awhile since posting, so to kick things off again for the blog, here’s a summary of how the Fall 2013 season is shaping up.

    E-Town Festival

    A couple weeks ago I volunteered for the E-Town Festival. E-Town is a  “…conference where educators meet entrepreneurs, explorers meet economists, and evangelists meet entertainers … and together we challenge the future of everything“. My roles varied from greeting attendees and answering inquiries, to corralling vendors at the Capital Ideas sponsored food truck feast. All in all, it was a great experience where I was able to make a lot of new friends, professional contacts, and even rub shoulders and chat with the presenters.

    Edmonton .Net User Group

    The 2013-2014 season of the Edmonton .Net User Group (EDMUG) is shaping up to be a fun one. My role as both VP and Sponsorship Director sees me wearing few hats. Edmonton has a great .Net community, and each meeting brings out plenty of like minded technology professionals. I’ve already put my bid in to present three topics this year which will include the likes of LightSwitch, Azure, and PowerShell.

    Coding with a Conscience

    Coding with a Conscience is a group of like-minded developers who come together to help non-profits achieve success through technology. I am really excited to be a part of this. Our first journey will be one where we are going to be helping a wonderful organization named Free Footie. Created by Tim Adams, Free Footie  is a free after school soccer league for kids. The team of Coding with a Conscience volunteers are partnering with Tim to create tools that will help Free Footie support the administration and growth of the league.

    More LightSwitch

    Of course I am doing a lot of LightSwitch stuff. The blog has been a bit stale lately, and that’s only because of how heads-down I’ve been with learning and playing with new stuff. I have a number of ideas for LightSwitch based articles, and I’ll be making a more diligent effort to present those in the near future. Visual Studio 2013 is having some say in all this too. There is a lot of new features in VS2013 that are article worthy. I just don’t want to push an article out there too soon. Who knows what may change.

    Azure, Azure, and more Azure

    Over the past year I have been very deep into the Windows Azure world. I even went as far as signing up with other cloud services providers to do some comparisons – so that I could be more objective in what I have to say about Azure. Even after doing that, I have an even more evangelistic view of Azure today than I did a year ago. In fact, I’ll be presenting Azure at one, or probably more, EDMUG meetings this season.

    Visual Studio 2013

    Not sure if this is a fault, but I like to get my hands on and play with the latest/greatest development tools. Visual Studio is one of those. These past few months has seen me putting Visual Studio 2013 through it’s paces. As I move along with more LightSwitch articles, the content will likely be in the context of using Visual Studio 2013.


    My daytime gig has me re-inspired with a new found passion for SharePoint. We have seen a dramatic pick-up in SharePoint business, especially SharePoint 2013. Richard Bourke and Rob Pukanich are each SharePoint gurus. Their passion for SharePoint is infectious, and has me discovering some great and powerful features in the new SharePoint 2013 – something that is invaluable as I move along with my teaching escapades at the local polytechnic (NAIT).

    Other Stuff

    What else?

    Well, our oldest daughter, Alexandra, is continuing her studies at the University of Alberta. With this being her second year, she is starting to find what interests her and where her passions are. She really enjoys the arts; hence her blog and the 365 day challenge that she put herself on.

    Our youngest, Kaitlyn, is in grade 9 and with the community league basketball season under way, as well as the upcoming school team play, she is keeping us busy with car rides to practices and games.

    My wife Linda has been very busy with her photography business and her volunteering. I don’t know how she does it all. I could use some of that endless energy she seems to have.

    Coby seems to have his Fall all figured out. In fact, he’s already started on his planned activities…





  • Deconstructing Cloud by A. Bilobrk

    Posted Aug 27th, 2013 By in Book Review With | No Comments

    The steep learning curve to today’s cloud computing leaves many people scratching their heads, wondering what opportunities do exist with the cloud. If you are still unclear about what today’s cloud computing really means, then you need to read Deconstructing Cloud by Andrea Bilobrk.


    This eBook provides an objective and unbiased look at how the cloud is can transform the way your organization operates. For you c-level people out there, this should be a go to resource. Unlike most cloud computing books, this one is exceptionally easy to read and should be the first reference point for anyone wanting to demystify what cloud computing can do  for your business.


  • Page 5 of 33« First...«34567»102030...Last »

© Copyright Paul S Patterson - Please, no touchie. :)