SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
SQL Server Service Broker
Scale out by Reliable Messaging
• Scalability – what does Scale Out means?
• Sharding
• Problems of sharding
• How does Service Broker help?
Agenda
• Is the ability of a system to handle growing
amount of work in a capable manner
• or its ability to be enlarged to accommodate
that growth
http://en.wikipedia.org/wiki/Scalability
Scalability
• Scale up – scale vertically
• Scale out – scale horizontally
Scalability Methods
• means vertically
• add resources to a single node in a system
– CPU
– memory
– storage
– etc
Scaling Up
• means horizontally
• add more nodes to a system
• in databases that’s called Sharding
• Microsoft used another term in SQL Azure -
Federations
Scaling Out
• Twitter Gizzard -
https://github.com/twitter/gizzard
• written in Scala
Sharding Frameworks
Sharding involves two technologies:
• Partitioning
• Replication
Sharding
• Data is divided into chunks
• Stored across computers
• Each chunk is small enough that we can
manipulate and query efficiently
User = “Denis” User = “Eva”
Partitioning
• multiple copies of data are stored across
several machines
• efficiently responds to tons of queries
• resilient to failures
User = “Denis”
User = “Eva”
User = “Denis”
User = “Eva”
Replication
Besides Scaling Out:
• Disaster Recovery strategies have You to make
database backups
• Replicated shards are working copies
• Need a new backup? Replicate a new Shard!
Benefits of Sharding
• Yes! Sharding is difficult!
• We have to think of how to partition our data
correctly
• How to ensure that all copies of data are
consistent?
• Write conflicts – no guarantee that operations
will apply in order
Are there any Problems?
• “Shared Nothing Architecture”
• no ongoing need to retain shared access
between shards
• each Shard can live in a totally separate
– instance
– database server
– data center
– continent
Design Principle
• Orders table is partitioned by Region
• Orders references to Users
• Users is not partitioned, it is replicated
• How to maintain Users in a consistent state?
Users (not partitioned)
Orders [Region = “US”]
Users (not partitioned)
Orders [Region = “Russia”]
Partitioning Problem
Wall Statuses
User [Name = “Denis”]
Wall Statuses
User [Name = “Eva”]
Front-End
POST
Denis writes a new Status
GET
We should see that status
on Eva’s wall
How do we get Denis’ statuses?
Facebook Sample
Wall Statuses
User [Name = “Denis”]
Wall Statuses
User [Name = “Eva”]
Front-End
POST
Denis writes a new Status
POST
Duplicate the status?
No benefit from Shards then! Wrong!
Possible Solution 1
Wall Statuses
User [Name = “Denis”]
Wall Statuses
User [Name = “Eva”]
Front-End
POST
Denis writes a new Status
GET
Gets a user data
No benefit from Shards then! Wrong!
Possible Solution 2
Wall Statuses
User [Name = “Denis”]
Wall Statuses
User [Name = “Eva”]
Front-End
POST
Denis writes a new Status
POST
Propogate the status
GET
All OK
Real Solution
• custom application which reads from one
Shard and writes to the others
• add all Shards as Linked servers, write stored
procedures to write a new record to each
remote server
• SQL Server Service Broker
Possible Technologies
• allows Internal and External processes to send
and receive guaranteed asynchronous
messages
• messages are sent to Queues in the same
database, same instance, same server,
another database, another instance, remote
server
Service Broker
the largest known implementation is in MySpace
• 440 SQL Server instances
• over 1,000 databases
• 1 Petabyte of data (1 million gigabytes)
Performance:
• 5,000 messages/second in Labs
• 18,000 messages/second in MySpace
Implementations
• Always Transactional
• Asynchronous
• Queued
• All messages are in XML format
• Routing
• Multicast messages in SQL Server 2012
Advantages
• No Administration Tools – not a lack - no at all
• Queue is a Table in database – index
fragmentation when we cannot empty queue
• complicated T-SQL syntax and object model
Disadvantages
• Message Types
• Contracts
• Queues
• Services
• Routes
• Activation
• Remote Service Bindings
• Dialog Conversation
• Conversation Groups
Service Broker Concepts
• Dialog Security – between two Services
– encrypts messages in a dialog conversation
– provides the remote authorization
• Transport Security
– establishes an authenticated network connection
between two Databases
Service Broker Security
• Enable Service Broker at Database level
ALTER DATABASE SampleDatabase
SET ENABLE_BROKER;
GO
• Always enable Service Broker in MSDB system database in each SQL Server
instance
• Enable SQL Server to communicate to another instance at Database level
ALTER DATABASE SampleDatabase
SET TRUSTWORTHY ON;
GO
SQL Server Configuration
• Create Send Message type
CREATE MESSAGE TYPE NewUserRequest
VALIDATION = WELL_FORMED_XML;
• Create Receive Message Type
CREATE MESSAGE TYPE NewUserResponse
VALIDATION = WELL_FORMED_XML;
Message Types
• create Contract between two services
CREATE CONTRACT NewUserContract (
NewUserRequest SENT BY INITIATOR,
NewUserResponse SENT BY TARGET
);
Service Contracts
CREATE QUEUE NewUserReceiveQueue
WITH STATUS = ON,
ACTIVATION (
PROCEDURE_NAME = OnReceiveNewUser,
MAX_QUEUE_READERS = 5,
Execute AS 'dbuser‘
) ;
CREATE QUEUE NewUserSendQueue
WITH STATUS = ON;
Queues
• Service will be listening for messages in a queue and react
only on those which apply to the spicified contract
CREATE SERVICE NewUserSendService
ON QUEUE NewUserSendQueue (
[NewUserContract]
);
CREATE SERVICE NewUserReceiveService
ON QUEUE NewUserReceiveQueue (
[NewUserContract]
);
Services
Sender:
• begins a transaction
• begins a dialog conversation from
NewUserSendService to NewUserReceiveService
• sends one or more XML messages to that dialog
• commits a transaction
• Waits for a Reply message
• Processes Reply messages when arrived
Sending a Messgae
Receiver (Target):
• when a new message is delivered to Receiver's
NewUserReceiveQueue the OnReceiveNewUser stored
procedure is activated by Service Broker
• Stored procedure begins a transaction
• receives messages out of the NewUserReceiveQueue
queue
• sends Reply messages
• ends a dialog conversation
• Do what you want with that message
• commits a transaction
Receiving a Message

Contenu connexe

Tendances

High availability solutions bakostech
High availability solutions bakostechHigh availability solutions bakostech
High availability solutions bakostechViktoria Bakos
 
Distributed database
Distributed databaseDistributed database
Distributed databasesanjay joshi
 
Understanding and building big data Architectures - NoSQL
Understanding and building big data Architectures - NoSQLUnderstanding and building big data Architectures - NoSQL
Understanding and building big data Architectures - NoSQLHyderabad Scalability Meetup
 
What is a database server and client ?
What is a database server and client ?What is a database server and client ?
What is a database server and client ?Open E-School
 
24 Hours Of Exchange Server 2007 (Part 1 Of 24)
24 Hours Of Exchange Server 2007 (Part 1 Of 24)24 Hours Of Exchange Server 2007 (Part 1 Of 24)
24 Hours Of Exchange Server 2007 (Part 1 Of 24)Harold Wong
 
24 Hours Of Exchange Server 2007 (Part 8 Of 24)
24 Hours Of Exchange Server 2007 (Part 8 Of 24)24 Hours Of Exchange Server 2007 (Part 8 Of 24)
24 Hours Of Exchange Server 2007 (Part 8 Of 24)Harold Wong
 
24 Hours Of Exchange Server 2007 (Part 3 Of 24)
24 Hours Of Exchange Server 2007 (Part 3 Of 24)24 Hours Of Exchange Server 2007 (Part 3 Of 24)
24 Hours Of Exchange Server 2007 (Part 3 Of 24)Harold Wong
 
What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)Amit Nirala
 
Mule database connector
Mule database connectorMule database connector
Mule database connectorD.Rajesh Kumar
 
SOA with NServiceBus 20130124
SOA with NServiceBus 20130124SOA with NServiceBus 20130124
SOA with NServiceBus 20130124Sean Farmar
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service BusPavel Revenkov
 
Web Server And Database Server
Web Server And Database ServerWeb Server And Database Server
Web Server And Database ServerMahbubur Rahman
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overviewRaveendra Bhat
 
Securing Your MongoDB Deployment
Securing Your MongoDB DeploymentSecuring Your MongoDB Deployment
Securing Your MongoDB DeploymentMongoDB
 

Tendances (20)

High availability solutions bakostech
High availability solutions bakostechHigh availability solutions bakostech
High availability solutions bakostech
 
Distributed database
Distributed databaseDistributed database
Distributed database
 
Understanding and building big data Architectures - NoSQL
Understanding and building big data Architectures - NoSQLUnderstanding and building big data Architectures - NoSQL
Understanding and building big data Architectures - NoSQL
 
Types of server
Types of serverTypes of server
Types of server
 
What is a database server and client ?
What is a database server and client ?What is a database server and client ?
What is a database server and client ?
 
24 Hours Of Exchange Server 2007 (Part 1 Of 24)
24 Hours Of Exchange Server 2007 (Part 1 Of 24)24 Hours Of Exchange Server 2007 (Part 1 Of 24)
24 Hours Of Exchange Server 2007 (Part 1 Of 24)
 
24 Hours Of Exchange Server 2007 (Part 8 Of 24)
24 Hours Of Exchange Server 2007 (Part 8 Of 24)24 Hours Of Exchange Server 2007 (Part 8 Of 24)
24 Hours Of Exchange Server 2007 (Part 8 Of 24)
 
24 Hours Of Exchange Server 2007 (Part 3 Of 24)
24 Hours Of Exchange Server 2007 (Part 3 Of 24)24 Hours Of Exchange Server 2007 (Part 3 Of 24)
24 Hours Of Exchange Server 2007 (Part 3 Of 24)
 
What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)
 
Mule database connector
Mule database connectorMule database connector
Mule database connector
 
Client Server Architecture ppt
Client Server Architecture pptClient Server Architecture ppt
Client Server Architecture ppt
 
SOA with NServiceBus 20130124
SOA with NServiceBus 20130124SOA with NServiceBus 20130124
SOA with NServiceBus 20130124
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service Bus
 
Web Server And Database Server
Web Server And Database ServerWeb Server And Database Server
Web Server And Database Server
 
Apache ActiveMQ
Apache ActiveMQApache ActiveMQ
Apache ActiveMQ
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
 
Securing Your MongoDB Deployment
Securing Your MongoDB DeploymentSecuring Your MongoDB Deployment
Securing Your MongoDB Deployment
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
About HTTP and REST
About HTTP and RESTAbout HTTP and REST
About HTTP and REST
 
Mdb dn 2016_11_ops_mgr
Mdb dn 2016_11_ops_mgrMdb dn 2016_11_ops_mgr
Mdb dn 2016_11_ops_mgr
 

Similaire à SQL Server Service Broker Scales Out Messaging

Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationAndrew Siemer
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETFernando G. Guerrero
 
數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣Amazon Web Services
 
MySQL Security in a Cloudy World
MySQL Security in a Cloudy WorldMySQL Security in a Cloudy World
MySQL Security in a Cloudy WorldDave Stokes
 
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseModern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseEric Bragas
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Mydbops
 
Slide presentation pycassa_upload
Slide presentation pycassa_uploadSlide presentation pycassa_upload
Slide presentation pycassa_uploadRajini Ramesh
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETFernando G. Guerrero
 
Scalability in cloud applications
Scalability in cloud applicationsScalability in cloud applications
Scalability in cloud applicationsRadu Vunvulea
 
Supporting architecture office 365 on windows azure
Supporting architecture office 365 on windows azure  Supporting architecture office 365 on windows azure
Supporting architecture office 365 on windows azure Jethro Seghers
 
Supporting architecture office 365 on windows azure
Supporting architecture office 365 on windows azure  Supporting architecture office 365 on windows azure
Supporting architecture office 365 on windows azure Jethro Seghers
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that growGibraltar Software
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the DatabaseMichaela Murray
 
The Future of Database Development
The Future of Database DevelopmentThe Future of Database Development
The Future of Database DevelopmentSteve Jones
 
CV-Kumar_TAM
CV-Kumar_TAMCV-Kumar_TAM
CV-Kumar_TAMKumar R
 
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου ΙστούManolis Vavalis
 
Simplify Your Database Migration to AWS | AWS Public Sector Summit 2016
Simplify Your Database Migration to AWS | AWS Public Sector Summit 2016Simplify Your Database Migration to AWS | AWS Public Sector Summit 2016
Simplify Your Database Migration to AWS | AWS Public Sector Summit 2016Amazon Web Services
 
NoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseNoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseBrant Burnett
 

Similaire à SQL Server Service Broker Scales Out Messaging (20)

Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregation
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
 
數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣
 
MySQL Security in a Cloudy World
MySQL Security in a Cloudy WorldMySQL Security in a Cloudy World
MySQL Security in a Cloudy World
 
MSSQL SERVER
MSSQL SERVERMSSQL SERVER
MSSQL SERVER
 
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseModern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops
 
Where should I be encrypting my data?
Where should I be encrypting my data? Where should I be encrypting my data?
Where should I be encrypting my data?
 
Slide presentation pycassa_upload
Slide presentation pycassa_uploadSlide presentation pycassa_upload
Slide presentation pycassa_upload
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
 
Scalability in cloud applications
Scalability in cloud applicationsScalability in cloud applications
Scalability in cloud applications
 
Supporting architecture office 365 on windows azure
Supporting architecture office 365 on windows azure  Supporting architecture office 365 on windows azure
Supporting architecture office 365 on windows azure
 
Supporting architecture office 365 on windows azure
Supporting architecture office 365 on windows azure  Supporting architecture office 365 on windows azure
Supporting architecture office 365 on windows azure
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that grow
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
 
The Future of Database Development
The Future of Database DevelopmentThe Future of Database Development
The Future of Database Development
 
CV-Kumar_TAM
CV-Kumar_TAMCV-Kumar_TAM
CV-Kumar_TAM
 
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
 
Simplify Your Database Migration to AWS | AWS Public Sector Summit 2016
Simplify Your Database Migration to AWS | AWS Public Sector Summit 2016Simplify Your Database Migration to AWS | AWS Public Sector Summit 2016
Simplify Your Database Migration to AWS | AWS Public Sector Summit 2016
 
NoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseNoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using Couchbase
 

Plus de Sperasoft

особенности работы с Locomotion в Unreal Engine 4
особенности работы с Locomotion в Unreal Engine 4особенности работы с Locomotion в Unreal Engine 4
особенности работы с Locomotion в Unreal Engine 4Sperasoft
 
концепт и архитектура геймплея в Creach: The Depleted World
концепт и архитектура геймплея в Creach: The Depleted Worldконцепт и архитектура геймплея в Creach: The Depleted World
концепт и архитектура геймплея в Creach: The Depleted WorldSperasoft
 
Опыт разработки VR игры для UE4
Опыт разработки VR игры для UE4Опыт разработки VR игры для UE4
Опыт разработки VR игры для UE4Sperasoft
 
Организация работы с UE4 в команде до 20 человек
Организация работы с UE4 в команде до 20 человек Организация работы с UE4 в команде до 20 человек
Организация работы с UE4 в команде до 20 человек Sperasoft
 
Gameplay Tags
Gameplay TagsGameplay Tags
Gameplay TagsSperasoft
 
Data Driven Gameplay in UE4
Data Driven Gameplay in UE4Data Driven Gameplay in UE4
Data Driven Gameplay in UE4Sperasoft
 
Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks Sperasoft
 
The theory of relational databases
The theory of relational databasesThe theory of relational databases
The theory of relational databasesSperasoft
 
Automated layout testing using Galen Framework
Automated layout testing using Galen FrameworkAutomated layout testing using Galen Framework
Automated layout testing using Galen FrameworkSperasoft
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft
 
Sperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on AndroidSperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on AndroidSperasoft
 
Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015Sperasoft
 
Effective Мeetings
Effective МeetingsEffective Мeetings
Effective МeetingsSperasoft
 
Unreal Engine 4 Introduction
Unreal Engine 4 IntroductionUnreal Engine 4 Introduction
Unreal Engine 4 IntroductionSperasoft
 
JIRA Development
JIRA DevelopmentJIRA Development
JIRA DevelopmentSperasoft
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchSperasoft
 
MOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JSMOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JSSperasoft
 
Quick Intro Into Kanban
Quick Intro Into KanbanQuick Intro Into Kanban
Quick Intro Into KanbanSperasoft
 
ECMAScript 6 Review
ECMAScript 6 ReviewECMAScript 6 Review
ECMAScript 6 ReviewSperasoft
 
Console Development in 15 minutes
Console Development in 15 minutesConsole Development in 15 minutes
Console Development in 15 minutesSperasoft
 

Plus de Sperasoft (20)

особенности работы с Locomotion в Unreal Engine 4
особенности работы с Locomotion в Unreal Engine 4особенности работы с Locomotion в Unreal Engine 4
особенности работы с Locomotion в Unreal Engine 4
 
концепт и архитектура геймплея в Creach: The Depleted World
концепт и архитектура геймплея в Creach: The Depleted Worldконцепт и архитектура геймплея в Creach: The Depleted World
концепт и архитектура геймплея в Creach: The Depleted World
 
Опыт разработки VR игры для UE4
Опыт разработки VR игры для UE4Опыт разработки VR игры для UE4
Опыт разработки VR игры для UE4
 
Организация работы с UE4 в команде до 20 человек
Организация работы с UE4 в команде до 20 человек Организация работы с UE4 в команде до 20 человек
Организация работы с UE4 в команде до 20 человек
 
Gameplay Tags
Gameplay TagsGameplay Tags
Gameplay Tags
 
Data Driven Gameplay in UE4
Data Driven Gameplay in UE4Data Driven Gameplay in UE4
Data Driven Gameplay in UE4
 
Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks
 
The theory of relational databases
The theory of relational databasesThe theory of relational databases
The theory of relational databases
 
Automated layout testing using Galen Framework
Automated layout testing using Galen FrameworkAutomated layout testing using Galen Framework
Automated layout testing using Galen Framework
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft talks: Android Security Threats
Sperasoft talks: Android Security Threats
 
Sperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on AndroidSperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft Talks: RxJava Functional Reactive Programming on Android
 
Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015
 
Effective Мeetings
Effective МeetingsEffective Мeetings
Effective Мeetings
 
Unreal Engine 4 Introduction
Unreal Engine 4 IntroductionUnreal Engine 4 Introduction
Unreal Engine 4 Introduction
 
JIRA Development
JIRA DevelopmentJIRA Development
JIRA Development
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
MOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JSMOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JS
 
Quick Intro Into Kanban
Quick Intro Into KanbanQuick Intro Into Kanban
Quick Intro Into Kanban
 
ECMAScript 6 Review
ECMAScript 6 ReviewECMAScript 6 Review
ECMAScript 6 Review
 
Console Development in 15 minutes
Console Development in 15 minutesConsole Development in 15 minutes
Console Development in 15 minutes
 

Dernier

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Dernier (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

SQL Server Service Broker Scales Out Messaging

  • 1. SQL Server Service Broker Scale out by Reliable Messaging
  • 2. • Scalability – what does Scale Out means? • Sharding • Problems of sharding • How does Service Broker help? Agenda
  • 3. • Is the ability of a system to handle growing amount of work in a capable manner • or its ability to be enlarged to accommodate that growth http://en.wikipedia.org/wiki/Scalability Scalability
  • 4. • Scale up – scale vertically • Scale out – scale horizontally Scalability Methods
  • 5. • means vertically • add resources to a single node in a system – CPU – memory – storage – etc Scaling Up
  • 6. • means horizontally • add more nodes to a system • in databases that’s called Sharding • Microsoft used another term in SQL Azure - Federations Scaling Out
  • 7. • Twitter Gizzard - https://github.com/twitter/gizzard • written in Scala Sharding Frameworks
  • 8. Sharding involves two technologies: • Partitioning • Replication Sharding
  • 9. • Data is divided into chunks • Stored across computers • Each chunk is small enough that we can manipulate and query efficiently User = “Denis” User = “Eva” Partitioning
  • 10. • multiple copies of data are stored across several machines • efficiently responds to tons of queries • resilient to failures User = “Denis” User = “Eva” User = “Denis” User = “Eva” Replication
  • 11. Besides Scaling Out: • Disaster Recovery strategies have You to make database backups • Replicated shards are working copies • Need a new backup? Replicate a new Shard! Benefits of Sharding
  • 12. • Yes! Sharding is difficult! • We have to think of how to partition our data correctly • How to ensure that all copies of data are consistent? • Write conflicts – no guarantee that operations will apply in order Are there any Problems?
  • 13. • “Shared Nothing Architecture” • no ongoing need to retain shared access between shards • each Shard can live in a totally separate – instance – database server – data center – continent Design Principle
  • 14. • Orders table is partitioned by Region • Orders references to Users • Users is not partitioned, it is replicated • How to maintain Users in a consistent state? Users (not partitioned) Orders [Region = “US”] Users (not partitioned) Orders [Region = “Russia”] Partitioning Problem
  • 15. Wall Statuses User [Name = “Denis”] Wall Statuses User [Name = “Eva”] Front-End POST Denis writes a new Status GET We should see that status on Eva’s wall How do we get Denis’ statuses? Facebook Sample
  • 16. Wall Statuses User [Name = “Denis”] Wall Statuses User [Name = “Eva”] Front-End POST Denis writes a new Status POST Duplicate the status? No benefit from Shards then! Wrong! Possible Solution 1
  • 17. Wall Statuses User [Name = “Denis”] Wall Statuses User [Name = “Eva”] Front-End POST Denis writes a new Status GET Gets a user data No benefit from Shards then! Wrong! Possible Solution 2
  • 18. Wall Statuses User [Name = “Denis”] Wall Statuses User [Name = “Eva”] Front-End POST Denis writes a new Status POST Propogate the status GET All OK Real Solution
  • 19. • custom application which reads from one Shard and writes to the others • add all Shards as Linked servers, write stored procedures to write a new record to each remote server • SQL Server Service Broker Possible Technologies
  • 20. • allows Internal and External processes to send and receive guaranteed asynchronous messages • messages are sent to Queues in the same database, same instance, same server, another database, another instance, remote server Service Broker
  • 21. the largest known implementation is in MySpace • 440 SQL Server instances • over 1,000 databases • 1 Petabyte of data (1 million gigabytes) Performance: • 5,000 messages/second in Labs • 18,000 messages/second in MySpace Implementations
  • 22. • Always Transactional • Asynchronous • Queued • All messages are in XML format • Routing • Multicast messages in SQL Server 2012 Advantages
  • 23. • No Administration Tools – not a lack - no at all • Queue is a Table in database – index fragmentation when we cannot empty queue • complicated T-SQL syntax and object model Disadvantages
  • 24. • Message Types • Contracts • Queues • Services • Routes • Activation • Remote Service Bindings • Dialog Conversation • Conversation Groups Service Broker Concepts
  • 25. • Dialog Security – between two Services – encrypts messages in a dialog conversation – provides the remote authorization • Transport Security – establishes an authenticated network connection between two Databases Service Broker Security
  • 26. • Enable Service Broker at Database level ALTER DATABASE SampleDatabase SET ENABLE_BROKER; GO • Always enable Service Broker in MSDB system database in each SQL Server instance • Enable SQL Server to communicate to another instance at Database level ALTER DATABASE SampleDatabase SET TRUSTWORTHY ON; GO SQL Server Configuration
  • 27. • Create Send Message type CREATE MESSAGE TYPE NewUserRequest VALIDATION = WELL_FORMED_XML; • Create Receive Message Type CREATE MESSAGE TYPE NewUserResponse VALIDATION = WELL_FORMED_XML; Message Types
  • 28. • create Contract between two services CREATE CONTRACT NewUserContract ( NewUserRequest SENT BY INITIATOR, NewUserResponse SENT BY TARGET ); Service Contracts
  • 29. CREATE QUEUE NewUserReceiveQueue WITH STATUS = ON, ACTIVATION ( PROCEDURE_NAME = OnReceiveNewUser, MAX_QUEUE_READERS = 5, Execute AS 'dbuser‘ ) ; CREATE QUEUE NewUserSendQueue WITH STATUS = ON; Queues
  • 30. • Service will be listening for messages in a queue and react only on those which apply to the spicified contract CREATE SERVICE NewUserSendService ON QUEUE NewUserSendQueue ( [NewUserContract] ); CREATE SERVICE NewUserReceiveService ON QUEUE NewUserReceiveQueue ( [NewUserContract] ); Services
  • 31. Sender: • begins a transaction • begins a dialog conversation from NewUserSendService to NewUserReceiveService • sends one or more XML messages to that dialog • commits a transaction • Waits for a Reply message • Processes Reply messages when arrived Sending a Messgae
  • 32. Receiver (Target): • when a new message is delivered to Receiver's NewUserReceiveQueue the OnReceiveNewUser stored procedure is activated by Service Broker • Stored procedure begins a transaction • receives messages out of the NewUserReceiveQueue queue • sends Reply messages • ends a dialog conversation • Do what you want with that message • commits a transaction Receiving a Message