Main target of the project is to create SaaS system, where company can register and got it own portal for operations running on the same codebase but with own domain like <orgname>.mainsystem.com.
Company administrator can manage content/settings for the company and manage users (CRUD operations with enable/disable).
Company users can login with their details and use company portal.
To control all companies in the system global admin role was added with its own portal. Global admin can control and manage all companies in the system (CRUD operations and enable/disable) and all users within companies.
Can also manage system settings.
To be able support high loading system was designed as MS Azure Cloud Service with dynamic scalability.
Second important requirement for the system was ability to separate data for different organizations and effectively use SQL Server resources in MS Azure.
For this purpose Azure elastic database pool was used with horizontal scaling (own database for the each company).
This feature was implemented using shard manager and multiple shards for companies.
To create new company it will be necessary create new database in the pool, then new shard, register shard with shard manager and then generate whole database structure in new database.
This was implemented using background task as Worker Role with messaging with main web thread using Azure Service Bus.
To manage whole system from global admin portal cross-database T-SQL queries was implemented.
Web-part of the system was done using asp.net mvc, Entity Framework for data access and Identity Framework for user authorization/authentication.
Shard manager with multiple shards
Cross-database T-SQL queries
Worker Role background task using Azure Service Bus