Git Product home page Git Product logo

wingtipticketssaas-multitenantdb's Introduction

Wingtip Tickets SaaS - Multi-Tenant Database

Sample multi-tenant SaaS application and management scripts built on SQL Database using a sharded multi-tenant database model. This is one of three versions of the application available that differ in the tenancy model used in the database layer.

Versions of Wingtip Tickets SaaS apps

Looking for one of the other SaaS app patterns? Learn more about the Standalone application and Database per tenant versions.

Wingtip Tickets SaaS app

The Wingtip Tickets app is a simple event listing and ticketing SaaS app, where each venue is a tenant with events, ticket prices, customers, and ticket sales. The app, together with the management scripts and tutorials, showcases an end-to-end SaaS scenario. This includes provisioning tenants, monitoring and managing performance, schema management and cross-tenant reporting and analytics, all at scale. This application is functionally identical across all three versions.

Sharded multi-tenant SaaS pattern

The sharded multi-tenant database model used in this sample enables tenant data to be distributed across sharded databases which can each contain any number of tenants. This sample explores the potential to use a mix of databases with many tenants and databases with only a single tenant. Databases containing large numbers of tenants are configured as stand-alone databases with the appropriate performance level (DTUs) for their aggregate workload. While databases with only a single tenant can be standalone databases or hosted in elastic pools where the elastic pool is assigned the appropriate eDTU level for the aggregate workload of all the databases in the pool.

Using this mixed approach, databases with many tenants can be used to host less active tenants, while databases with a single tenant can be used to host more frequently used databases, or databases that need greater isolation and potentially individual management. This management flexibility is achieved without needing to change the application. In general, multi-tenant databases can have the lowest per-tenant cost, traded off against lower levels of tenant isolation. Multi-tenant databases might be used to host tenants that are trialing a service, perhaps at no or little charge, while databases with a single tenant might host tenants on paying plans or those paying a premium price. Tenants in their own database benefit from greater database isolation, enabling improved security, better performance isolation that allows per-tenant performance monitoring and management, including the option to use elastic database pools to share resources across a group or databases.

An additional catalog database holds the mapping between tenants and their databases, regardless of number of tenants per database. This mapping is managed using the Shard Map Management features of the Elastic Scale Client Library.

Get started

The basic application when installed includes three pre-defined venues in a single multi-tenant database. The application is installed in your Azure subscription under a single ARM resource group. To uninstall the application, delete the resource group from the Azure Portal.

Management scripts are provided to allow you to explore many management scenarios, including adding tenants and moving tenants into isolated databases.

NOTE: if you install the application you will be charged for the Azure resources created. Actual costs incurred are based on your subscription offer type but are nominal if the application is not scaled up unreasonably and is deleted promptly after you have finished exploring the tutorials.

More information about the sample app can be found in the associated tutorials.

Also available in the Documentation folder in this repo is an overview presentation that provides background, explores alternative database models for multi-tenant apps, and walks through several of the SaaS patterns at a high level. There is also a demo script you can use with the presentation to give others a guided tour of the app and several of the patterns.

To deploy the app to Azure, click the link below. Deploy the app in a new resource group, and provide a short user value that will be appended to several resource names to make them globally unique. Your initials and a number is a good pattern to use.

After deployment completes, launch the app by browsing to http://events.wingtip-mt.USER.trafficmanager.net, substituting USER with the value you set during deployment.

IMPORTANT: If you download and extract the repo or Learning Modules from a zip file, make sure you unblock the .zip file before extracting. Executable contents (scripts, dlls) may be blocked by Windows when zip files are downloaded from an external source and extracted.

To avoid scripts from being blocked by Windows:

  1. Right click the zip file and select Properties.
  2. On the General tab, select Unblock and select OK.

License

Microsoft Wingtip SaaS sample application and tutorials are licensed under the MIT license. See the LICENSE file for more details.

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

wingtipticketssaas-multitenantdb's People

Contributors

ajlam avatar anumjs avatar ayoolubeko avatar billgib avatar ddove avatar dhruvanmurthy avatar karwoskij avatar meyergm avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar mikewo avatar msftgits avatar ninarn avatar rakshith076 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wingtipticketssaas-multitenantdb's Issues

Where can I find these deployment files in Storage Account ? not part of the deployment scripts ?

Where can I find these files in Storage Account ?

  1. tenants1.bacpac
  2. wingtipcatalogdb.bacpac
  3. basetenantdb.bacpac
  4. eventsAppPackage.zip

Variables
"tenantDatabaseStorageUri": "https://erlwtdemoresourcestemp.blob.core.windows.net/erlwtdemoresourcestemp/multitenant/tenants1.bacpac",
"catalogDatabaseStorageUri": "https://erlwtdemoresourcestemp.blob.core.windows.net/erlwtdemoresourcestemp/wingtipcatalogdb.bacpac",
"baseTenantDatabaseStorageUri": "https://erlwtdemoresourcestemp.blob.core.windows.net/erlwtdemoresourcestemp/multitenant/basetenantdb.bacpac",
"wtpEventsAppTrafficManagerUniqueDnsName": "[concat('events.wingtip','-',variables('multiTenantSuffix'),'.',variables('lowerCaseUser'))]",
"wtpEventsApp": "[concat('events-wingtip-',variables('multiTenantSuffix'),'-',variables('lowerCaseUser'))]",
"wtpEventsAppPackageUri": "https://erlwtdemoresourcestemp.blob.core.windows.net/erlwtdemoresourcestemp/multitenant/eventsAppPackage.zip"

Exceptions:
The ImportExport operation failed because of invalid storage credentials. (Code: 45613, Target: /subscriptions/5f0186be-2385-4882-a8d1-bf94d35bda26/resourceGroups/testrg/providers/Microsoft.Sql/servers/tenants1-mt-umesherl/databases/tenants1/extensions/Import)

The ImportExport operation failed because of invalid storage credentials. (Code: 45613, Target: /subscriptions/5f0186be-2385-4882-a8d1-bf94d35bda26/resourceGroups/testrg/providers/Microsoft.Sql/servers/catalog-mt-umesherl/databases/tenantcatalog/extensions/Import)

The ImportExport operation failed because of invalid storage credentials. (Code: 45613, Target: /subscriptions/5f0186be-2385-4882-a8d1-bf94d35bda26/resourceGroups/testrg/providers/Microsoft.Sql/servers/catalog-mt-umesherl/databases/basetenantdb/extensions/Import)

Start generating load on the tenant databases doesn't work

When I run ...\Learning Modules\Utilities\Demo-LoadGenerator.ps1 then this script opens another PowerShell session where the load generator runs.

Then script tries find package Microsoft.Azure.SqlDatabase.ElasticScale.Client.dll but it launch (you can see attached image):

captura

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.