SlideShare a Scribd company logo
1 of 18
Multi-Tenant Approach
Perfectial, LLC
info@perfectial.com
What is multi-tenancy ?
Multi-tenancy is an architecture in which a single instance of a software
application serves multiple customers.
Each customer is called a TENANT.
Tenants may be given the ability to customize some parts of the application,
such as color of the user interface (UI) or business rules, but they cannot
customize the application's code.
A software-as-a-service (SaaS) provider, for example, can run one instance
of its application on one instance of a database and provide web access to
multiple customers. In such a scenario, each tenant's data is isolated and
remains invisible to other tenants.
Multi-tenant data approaches
• Separate database
• Separate schema
• Partitioned (discriminator) data
• Data sharding
Separate database
Computing resources and application code are generally shared between all
the tenants on a server, but each tenant has its own set of data that remains
logically isolated from data that belongs to all other tenants.
Separate schema
Shared Database, Separate Schemas
This approach involves housing multiple
tenants in the same database, with each
tenant having its own set of tables that
are grouped into a schema created
specifically for the tenant.
Partitioned data
Shared Database, Shared Schema
In this approach, all tenants share the same set of
tables, and a Tenant ID associates each tenant with
the rows that it owns.
Data sharding
Sharding is a type of database partitioning that separates very large
databases the into smaller, faster, more easily managed parts called data
shards. The word shard means a small part of a whole.
Technically, sharding is a synonym for horizontal partitioning. In practice, the
term is often used to refer to any database partitioning that is meant to make
a very large database more manageable.
Simple example is splitting a customer database geographically. Customers
located on the East Coast can be placed on one server, while customers on
the West Coast can be placed on a second server.
Long story short: Sharding is basically the process of distributing tables into
different servers in order to balance the load equally.
SQL Azure Federations
Federations in Windows Azure SQL Database (SQL Database) are a way to
achieve greater scalability and manage capacity limitations in the database
tier of your application.
One or more tables within a database are horizontally partitioned across
multiple databases called federation members. This type of horizontal
partitioning is often referred to as ‘sharding’.
Federations structure
Federation Root Database
The federation root database is a SQL Azure database that contains metadata
about the federations.
CREATE DATABASE [fedRoot] COLLATE French_CI_AS (MAXSIZE = 100 GB, EDITION = 'business')
Any federations you create will inherit the properties of the root database.
Federation
The federation is where you define the data type (e.g., Customer ID, Product
ID) you’ll shard on.
CREATE FEDERATION <FederationName>(<DistributionKeyName> <DistributionType> RANGE)
<FederationName> is the name of the federation
<DistributionKeyName> is the name for the distribution key, and
<DistributionType> is the distribution data type that data will be sharded on.
The valid distribution data types are:
- int
- bigint
- uniqueidentifier
- varbinary (up to 900)
Federation member
The federation member is the shard (i.e., the database containing a specific
range of information). By default, a created federation contains one
federation member with a range of low to high (containing all the data).
Connect to federation member:
USE FEDERATION <federation_name>(<distribution_name> = value) WITH FILTERING={ON|OFF}, RESET
Connect to Root:
USE FEDERATION ROOT WITH RESET
Split federation
The ALTER FEDERATION is used to split a federation member and to drop a
federation member.
ALTER FEDERATION <FederationName> SPLIT AT (<DistributionKeyName>=<splitpoint>)
Drop federation
The ALTER FEDERATION is used to split a federation member and to drop a
federation member.
ALTER FEDERATION <FederationName> DROP AT ([LOW|HIGH] <DistributionKeyName> = <value>)
Creating a federation and a
federated table
CREATE FEDERATION CustomerFederation(cust_id BIGINT RANGE)
GO
USE FEDERATION CustomerFederation(cust_id=1) WITH RESET, FILTERING=OFF
GO
CREATE TABLE [dbo].[Customer](
[CustomerID] [bigint] NOT NULL,
[Title] [nvarchar](8) NULL,
[FirstName] [nvarchar](50) NOT NULL,
[LastName] [nvarchar](50) NOT NULL,
[CompanyName] [nvarchar](128) NULL,
[EmailAddress] [nvarchar](50) NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_Customer_CustomerID] PRIMARY KEY CLUSTERED
(
[CustomerID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)FEDERATED ON (cust_id=CustomerID)
GO
Table types
• Federated
Federated tables contain the data that is federated across each federation
member. When the federation member is split, this data is distributed among
the two new federation members. A federated table is created by appending
FEDERATED ON to a CREATE TABLE statement.
• Reference
Reference tables are normal tables existing in each federation member and
their contents are copied to the new federation members formed when an
existing federation member is split.
• Common
Common tables are normal tables existing in the root database. They would
be typically be used for application data that does not need to be present in
each federation member.
Dynamic Management Views
There are various DMVs to support the management and use of SQL Azure
Federations:
• sys.federations
• sys.federation_members
• sys.federation_distributions
• sys.federation_member_distributions
• sys.federation_history
• sys.federation_member_history
• sys.federation_distribution_history
• sys.federation_member_distribution_history
• …
Perfectial, LLC
http://perfectial.com
info@perfectial.com

More Related Content

What's hot

Building a Scalable Architecture for web apps
Building a Scalable Architecture for web appsBuilding a Scalable Architecture for web apps
Building a Scalable Architecture for web appsDirecti Group
 
What is Virtualization and its types & Techniques.What is hypervisor and its ...
What is Virtualization and its types & Techniques.What is hypervisor and its ...What is Virtualization and its types & Techniques.What is hypervisor and its ...
What is Virtualization and its types & Techniques.What is hypervisor and its ...Shashi soni
 
Microsoft Azure Cloud Services
Microsoft Azure Cloud ServicesMicrosoft Azure Cloud Services
Microsoft Azure Cloud ServicesDavid J Rosenthal
 
Virtualization in cloud computing ppt
Virtualization in cloud computing pptVirtualization in cloud computing ppt
Virtualization in cloud computing pptMehul Patel
 
Implementation levels of virtualization
Implementation levels of virtualizationImplementation levels of virtualization
Implementation levels of virtualizationGokulnath S
 
Migration into a Cloud
Migration into a CloudMigration into a Cloud
Migration into a CloudDivya S
 
Module 5-cloud computing-SECURITY IN THE CLOUD
Module 5-cloud computing-SECURITY IN THE CLOUDModule 5-cloud computing-SECURITY IN THE CLOUD
Module 5-cloud computing-SECURITY IN THE CLOUDSweta Kumari Barnwal
 
Multi-tenancy In the Cloud
Multi-tenancy In the CloudMulti-tenancy In the Cloud
Multi-tenancy In the Cloudsdevillers
 
Scalability and Reliability in the Cloud
Scalability and Reliability in the CloudScalability and Reliability in the Cloud
Scalability and Reliability in the Cloudgmthomps
 
Disaster Recovery using AWS -Architecture blueprints
Disaster Recovery using AWS -Architecture blueprintsDisaster Recovery using AWS -Architecture blueprints
Disaster Recovery using AWS -Architecture blueprintsHarish Ganesan
 
Microsoft Cloud Computing
Microsoft Cloud ComputingMicrosoft Cloud Computing
Microsoft Cloud ComputingDavid Chou
 

What's hot (20)

What is Virtualization
What is VirtualizationWhat is Virtualization
What is Virtualization
 
Cloud Computing: Virtualization
Cloud Computing: VirtualizationCloud Computing: Virtualization
Cloud Computing: Virtualization
 
Failover cluster
Failover clusterFailover cluster
Failover cluster
 
What is Multi-Tenant Architecture ?
What is Multi-Tenant Architecture ?What is Multi-Tenant Architecture ?
What is Multi-Tenant Architecture ?
 
Building a Scalable Architecture for web apps
Building a Scalable Architecture for web appsBuilding a Scalable Architecture for web apps
Building a Scalable Architecture for web apps
 
What is Virtualization and its types & Techniques.What is hypervisor and its ...
What is Virtualization and its types & Techniques.What is hypervisor and its ...What is Virtualization and its types & Techniques.What is hypervisor and its ...
What is Virtualization and its types & Techniques.What is hypervisor and its ...
 
Microsoft Azure Cloud Services
Microsoft Azure Cloud ServicesMicrosoft Azure Cloud Services
Microsoft Azure Cloud Services
 
Virtualization in cloud computing ppt
Virtualization in cloud computing pptVirtualization in cloud computing ppt
Virtualization in cloud computing ppt
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Platform as a Service (PaaS)
Platform as a Service (PaaS)Platform as a Service (PaaS)
Platform as a Service (PaaS)
 
Implementation levels of virtualization
Implementation levels of virtualizationImplementation levels of virtualization
Implementation levels of virtualization
 
Migration into a Cloud
Migration into a CloudMigration into a Cloud
Migration into a Cloud
 
Hypervisor
HypervisorHypervisor
Hypervisor
 
Module 5-cloud computing-SECURITY IN THE CLOUD
Module 5-cloud computing-SECURITY IN THE CLOUDModule 5-cloud computing-SECURITY IN THE CLOUD
Module 5-cloud computing-SECURITY IN THE CLOUD
 
Multi-tenancy In the Cloud
Multi-tenancy In the CloudMulti-tenancy In the Cloud
Multi-tenancy In the Cloud
 
Cloud Computing Architecture
Cloud Computing ArchitectureCloud Computing Architecture
Cloud Computing Architecture
 
Scalability and Reliability in the Cloud
Scalability and Reliability in the CloudScalability and Reliability in the Cloud
Scalability and Reliability in the Cloud
 
Disaster Recovery using AWS -Architecture blueprints
Disaster Recovery using AWS -Architecture blueprintsDisaster Recovery using AWS -Architecture blueprints
Disaster Recovery using AWS -Architecture blueprints
 
Security As A Service In Cloud(SECaaS)
Security As A Service In Cloud(SECaaS)Security As A Service In Cloud(SECaaS)
Security As A Service In Cloud(SECaaS)
 
Microsoft Cloud Computing
Microsoft Cloud ComputingMicrosoft Cloud Computing
Microsoft Cloud Computing
 

Similar to Multi-Tenant Approach

Windows Azure SQL Database Federations
Windows Azure SQL Database FederationsWindows Azure SQL Database Federations
Windows Azure SQL Database FederationsNeil Mackenzie
 
Sql azure federations
Sql azure federations Sql azure federations
Sql azure federations Pavel Tsukanov
 
Microsoft SQL Azure - Scaling Out with SQL Azure Whitepaper
Microsoft SQL Azure - Scaling Out with SQL Azure WhitepaperMicrosoft SQL Azure - Scaling Out with SQL Azure Whitepaper
Microsoft SQL Azure - Scaling Out with SQL Azure WhitepaperMicrosoft Private Cloud
 
Data Virtualization Primer -
Data Virtualization Primer -Data Virtualization Primer -
Data Virtualization Primer -Kenneth Peeples
 
Database Management System (DBMS) | Computer Science
Database Management System (DBMS) | Computer ScienceDatabase Management System (DBMS) | Computer Science
Database Management System (DBMS) | Computer ScienceTransweb Global Inc
 
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloudKoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloudTobias Koprowski
 
Azure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full CourseAzure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full CoursePiyush sachdeva
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaLucas Jellema
 
CirrusDB Offerings
CirrusDB OfferingsCirrusDB Offerings
CirrusDB OfferingsAshok Sami
 
PPT SQL CLASS.pptx
PPT SQL CLASS.pptxPPT SQL CLASS.pptx
PPT SQL CLASS.pptxAngeOuattara
 
Exploring Microsoft Azure Infrastructures
Exploring Microsoft Azure InfrastructuresExploring Microsoft Azure Infrastructures
Exploring Microsoft Azure InfrastructuresCCG
 
Domain logic patterns of Software Architecture
Domain logic patterns of Software ArchitectureDomain logic patterns of Software Architecture
Domain logic patterns of Software ArchitectureShweta Ghate
 
NoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to CouchbaseNoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to CouchbaseMohammad Shaker
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement systemFaisalGhffar
 
Introduction To Sql Services
Introduction To Sql ServicesIntroduction To Sql Services
Introduction To Sql Servicesllangit
 

Similar to Multi-Tenant Approach (20)

Windows Azure SQL Database Federations
Windows Azure SQL Database FederationsWindows Azure SQL Database Federations
Windows Azure SQL Database Federations
 
Sql azure federations
Sql azure federations Sql azure federations
Sql azure federations
 
Microsoft SQL Azure - Scaling Out with SQL Azure Whitepaper
Microsoft SQL Azure - Scaling Out with SQL Azure WhitepaperMicrosoft SQL Azure - Scaling Out with SQL Azure Whitepaper
Microsoft SQL Azure - Scaling Out with SQL Azure Whitepaper
 
Data Virtualization Primer -
Data Virtualization Primer -Data Virtualization Primer -
Data Virtualization Primer -
 
dvprimer-concepts
dvprimer-conceptsdvprimer-concepts
dvprimer-concepts
 
Database Management System (DBMS) | Computer Science
Database Management System (DBMS) | Computer ScienceDatabase Management System (DBMS) | Computer Science
Database Management System (DBMS) | Computer Science
 
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloudKoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
 
dvprimer-architecture
dvprimer-architecturedvprimer-architecture
dvprimer-architecture
 
Azure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full CourseAzure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full Course
 
Pptofdistributeddb
PptofdistributeddbPptofdistributeddb
Pptofdistributeddb
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas Jellema
 
Stretch db sql server 2016 (sn0028)
Stretch db   sql server 2016 (sn0028)Stretch db   sql server 2016 (sn0028)
Stretch db sql server 2016 (sn0028)
 
Scaling apps using azure cloud services
Scaling apps using azure cloud servicesScaling apps using azure cloud services
Scaling apps using azure cloud services
 
CirrusDB Offerings
CirrusDB OfferingsCirrusDB Offerings
CirrusDB Offerings
 
PPT SQL CLASS.pptx
PPT SQL CLASS.pptxPPT SQL CLASS.pptx
PPT SQL CLASS.pptx
 
Exploring Microsoft Azure Infrastructures
Exploring Microsoft Azure InfrastructuresExploring Microsoft Azure Infrastructures
Exploring Microsoft Azure Infrastructures
 
Domain logic patterns of Software Architecture
Domain logic patterns of Software ArchitectureDomain logic patterns of Software Architecture
Domain logic patterns of Software Architecture
 
NoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to CouchbaseNoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to Couchbase
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
Introduction To Sql Services
Introduction To Sql ServicesIntroduction To Sql Services
Introduction To Sql Services
 

Recently uploaded

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Multi-Tenant Approach

  • 2. What is multi-tenancy ? Multi-tenancy is an architecture in which a single instance of a software application serves multiple customers. Each customer is called a TENANT. Tenants may be given the ability to customize some parts of the application, such as color of the user interface (UI) or business rules, but they cannot customize the application's code. A software-as-a-service (SaaS) provider, for example, can run one instance of its application on one instance of a database and provide web access to multiple customers. In such a scenario, each tenant's data is isolated and remains invisible to other tenants.
  • 3. Multi-tenant data approaches • Separate database • Separate schema • Partitioned (discriminator) data • Data sharding
  • 4. Separate database Computing resources and application code are generally shared between all the tenants on a server, but each tenant has its own set of data that remains logically isolated from data that belongs to all other tenants.
  • 5. Separate schema Shared Database, Separate Schemas This approach involves housing multiple tenants in the same database, with each tenant having its own set of tables that are grouped into a schema created specifically for the tenant.
  • 6. Partitioned data Shared Database, Shared Schema In this approach, all tenants share the same set of tables, and a Tenant ID associates each tenant with the rows that it owns.
  • 7. Data sharding Sharding is a type of database partitioning that separates very large databases the into smaller, faster, more easily managed parts called data shards. The word shard means a small part of a whole. Technically, sharding is a synonym for horizontal partitioning. In practice, the term is often used to refer to any database partitioning that is meant to make a very large database more manageable. Simple example is splitting a customer database geographically. Customers located on the East Coast can be placed on one server, while customers on the West Coast can be placed on a second server. Long story short: Sharding is basically the process of distributing tables into different servers in order to balance the load equally.
  • 8. SQL Azure Federations Federations in Windows Azure SQL Database (SQL Database) are a way to achieve greater scalability and manage capacity limitations in the database tier of your application. One or more tables within a database are horizontally partitioned across multiple databases called federation members. This type of horizontal partitioning is often referred to as ‘sharding’.
  • 10. Federation Root Database The federation root database is a SQL Azure database that contains metadata about the federations. CREATE DATABASE [fedRoot] COLLATE French_CI_AS (MAXSIZE = 100 GB, EDITION = 'business') Any federations you create will inherit the properties of the root database.
  • 11. Federation The federation is where you define the data type (e.g., Customer ID, Product ID) you’ll shard on. CREATE FEDERATION <FederationName>(<DistributionKeyName> <DistributionType> RANGE) <FederationName> is the name of the federation <DistributionKeyName> is the name for the distribution key, and <DistributionType> is the distribution data type that data will be sharded on. The valid distribution data types are: - int - bigint - uniqueidentifier - varbinary (up to 900)
  • 12. Federation member The federation member is the shard (i.e., the database containing a specific range of information). By default, a created federation contains one federation member with a range of low to high (containing all the data). Connect to federation member: USE FEDERATION <federation_name>(<distribution_name> = value) WITH FILTERING={ON|OFF}, RESET Connect to Root: USE FEDERATION ROOT WITH RESET
  • 13. Split federation The ALTER FEDERATION is used to split a federation member and to drop a federation member. ALTER FEDERATION <FederationName> SPLIT AT (<DistributionKeyName>=<splitpoint>)
  • 14. Drop federation The ALTER FEDERATION is used to split a federation member and to drop a federation member. ALTER FEDERATION <FederationName> DROP AT ([LOW|HIGH] <DistributionKeyName> = <value>)
  • 15. Creating a federation and a federated table CREATE FEDERATION CustomerFederation(cust_id BIGINT RANGE) GO USE FEDERATION CustomerFederation(cust_id=1) WITH RESET, FILTERING=OFF GO CREATE TABLE [dbo].[Customer]( [CustomerID] [bigint] NOT NULL, [Title] [nvarchar](8) NULL, [FirstName] [nvarchar](50) NOT NULL, [LastName] [nvarchar](50) NOT NULL, [CompanyName] [nvarchar](128) NULL, [EmailAddress] [nvarchar](50) NULL, [ModifiedDate] [datetime] NOT NULL, CONSTRAINT [PK_Customer_CustomerID] PRIMARY KEY CLUSTERED ( [CustomerID] ASC )WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) )FEDERATED ON (cust_id=CustomerID) GO
  • 16. Table types • Federated Federated tables contain the data that is federated across each federation member. When the federation member is split, this data is distributed among the two new federation members. A federated table is created by appending FEDERATED ON to a CREATE TABLE statement. • Reference Reference tables are normal tables existing in each federation member and their contents are copied to the new federation members formed when an existing federation member is split. • Common Common tables are normal tables existing in the root database. They would be typically be used for application data that does not need to be present in each federation member.
  • 17. Dynamic Management Views There are various DMVs to support the management and use of SQL Azure Federations: • sys.federations • sys.federation_members • sys.federation_distributions • sys.federation_member_distributions • sys.federation_history • sys.federation_member_history • sys.federation_distribution_history • sys.federation_member_distribution_history • …