473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

WCF and Service Broker Architecture

Lets say I have a number of web servers that all feed data to a common SQL
Server database, which processes and sends to a master SQL Server. I am
looking at a solution that involves Service Broker at the higher levels and
that all works fine. My question is: what is the recommended way to get data
from the web server to the first-tier Service Broker? I've done a lot of
searching and reading and have not found any definitive answers. But my
ideas are:

1) Write directly to the database from the web server.
I don't really like this solution because it violates the concepts OO design
and abstraction. It also doesn't give me any assurances that the data gets
moved, other than maybe some logging. It also shifts alot of the processing
onto IIS, which I would like to be as "light" as possible, simply servicing
requests.
2) Write to a local queue managed managed by a WCF service hosted in a
Windows Service.
This gives me some abstraction, but also adds some layers that may be
unnecessary. And, if I'm not mistaken, it forces me to use a local MSMQ if I
want to make sure that the messages are durable. And there is still the
question of writing to the queue - seems like I still need to do this from
the IIS hosted web application or use memory-mapping or something. Maybe
someone could elaborate on this one.
3) Install SQL Express on the web servers and use Service Broker all the way
up the line.
This seems a bit of a hack to me - to install SQL Express on the web
servers - but would work. Also, does anyone know how this impacts licensing;
is it really truly free to install Express anywhere, even if its 50-100 web
servers?

Beyond the options above, what is the recommended way to traverse that first
segment to Service Broker if one needs durable messages? What if volatile
messages are okay - should it be done a different way? I feel pretty
comfortable with Service Broker once it gets the initial data - my issue is
getting the data in the pipeline to start.

Thanks
K
Mar 19 '07 #1
4 8127
How does you middle tier normally talk to the database? If it uses TSQL
over normal SQL Client or OLEDB connections then this is the way to do the
Service Broker connection. Because the connection is transactional, if the
connection is lost the SEND will roll back and you can send it again.

If you decide to use SQL Express in the middle tier, you gain a little more
fault tolerance at the expense of a little more complexity. If your middle
tier can continue to queue messages while the database is down for
maintenance or the network isn't working, your application is significantly
more fault tolerant. I've always been a fan of reliability and fault
tolerance over OO purity and isolation.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Karch" <no****@absotutely.comwrote in message
news:O9**************@TK2MSFTNGP04.phx.gbl...
Lets say I have a number of web servers that all feed data to a common SQL
Server database, which processes and sends to a master SQL Server. I am
looking at a solution that involves Service Broker at the higher levels
and that all works fine. My question is: what is the recommended way to
get data from the web server to the first-tier Service Broker? I've done a
lot of searching and reading and have not found any definitive answers.
But my ideas are:

1) Write directly to the database from the web server.
I don't really like this solution because it violates the concepts OO
design and abstraction. It also doesn't give me any assurances that the
data gets moved, other than maybe some logging. It also shifts alot of the
processing onto IIS, which I would like to be as "light" as possible,
simply servicing requests.
2) Write to a local queue managed managed by a WCF service hosted in a
Windows Service.
This gives me some abstraction, but also adds some layers that may be
unnecessary. And, if I'm not mistaken, it forces me to use a local MSMQ if
I want to make sure that the messages are durable. And there is still the
question of writing to the queue - seems like I still need to do this from
the IIS hosted web application or use memory-mapping or something. Maybe
someone could elaborate on this one.
3) Install SQL Express on the web servers and use Service Broker all the
way up the line.
This seems a bit of a hack to me - to install SQL Express on the web
servers - but would work. Also, does anyone know how this impacts
licensing; is it really truly free to install Express anywhere, even if
its 50-100 web servers?

Beyond the options above, what is the recommended way to traverse that
first segment to Service Broker if one needs durable messages? What if
volatile messages are okay - should it be done a different way? I feel
pretty comfortable with Service Broker once it gets the initial data - my
issue is getting the data in the pipeline to start.

Thanks
K
Mar 19 '07 #2
By the way, here's a little extra reading on the subject:
http://msdn2.microsoft.com/en-us/arc.../bb245677.aspx
http://msdn2.microsoft.com/en-us/library/aa964144.aspx
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Roger Wolter[MSFT]" <rw*****@online.microsoft.comwrote in message
news:FF**********************************@microsof t.com...
How does you middle tier normally talk to the database? If it uses TSQL
over normal SQL Client or OLEDB connections then this is the way to do the
Service Broker connection. Because the connection is transactional, if
the connection is lost the SEND will roll back and you can send it again.

If you decide to use SQL Express in the middle tier, you gain a little
more fault tolerance at the expense of a little more complexity. If your
middle tier can continue to queue messages while the database is down for
maintenance or the network isn't working, your application is
significantly more fault tolerant. I've always been a fan of reliability
and fault tolerance over OO purity and isolation.

--
This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Karch" <no****@absotutely.comwrote in message
news:O9**************@TK2MSFTNGP04.phx.gbl...
>Lets say I have a number of web servers that all feed data to a common
SQL Server database, which processes and sends to a master SQL Server. I
am looking at a solution that involves Service Broker at the higher
levels and that all works fine. My question is: what is the recommended
way to get data from the web server to the first-tier Service Broker?
I've done a lot of searching and reading and have not found any
definitive answers. But my ideas are:

1) Write directly to the database from the web server.
I don't really like this solution because it violates the concepts OO
design and abstraction. It also doesn't give me any assurances that the
data gets moved, other than maybe some logging. It also shifts alot of
the processing onto IIS, which I would like to be as "light" as possible,
simply servicing requests.
2) Write to a local queue managed managed by a WCF service hosted in a
Windows Service.
This gives me some abstraction, but also adds some layers that may be
unnecessary. And, if I'm not mistaken, it forces me to use a local MSMQ
if I want to make sure that the messages are durable. And there is still
the question of writing to the queue - seems like I still need to do this
from the IIS hosted web application or use memory-mapping or something.
Maybe someone could elaborate on this one.
3) Install SQL Express on the web servers and use Service Broker all the
way up the line.
This seems a bit of a hack to me - to install SQL Express on the web
servers - but would work. Also, does anyone know how this impacts
licensing; is it really truly free to install Express anywhere, even if
its 50-100 web servers?

Beyond the options above, what is the recommended way to traverse that
first segment to Service Broker if one needs durable messages? What if
volatile messages are okay - should it be done a different way? I feel
pretty comfortable with Service Broker once it gets the initial data - my
issue is getting the data in the pipeline to start.

Thanks
K
Mar 19 '07 #3
OK, makes sense. Yes, in this case, my middle tier would be talking TSQL
over SQL Client. The transactional connection is good, but it only lets me
retry, while I would prefer to have the messages queued as you mention in
the second scenario. So, is this a recommended approach - to use SQL Express
along with the middle tier? Something about it seems like overkill. Does it
make any sense to use WCF with private queues on the web server and pick it
up on the middle tier, or is this just overcomplicating the situation? I
would like to have some fault tolerance and reliability on the web servers,
but it just seems strange to deploy SQL Express to them when maybe some
other transport might be more efficient.

"Roger Wolter[MSFT]" <rw*****@online.microsoft.comwrote in message
news:FF**********************************@microsof t.com...
How does you middle tier normally talk to the database? If it uses TSQL
over normal SQL Client or OLEDB connections then this is the way to do the
Service Broker connection. Because the connection is transactional, if
the connection is lost the SEND will roll back and you can send it again.

If you decide to use SQL Express in the middle tier, you gain a little
more fault tolerance at the expense of a little more complexity. If your
middle tier can continue to queue messages while the database is down for
maintenance or the network isn't working, your application is
significantly more fault tolerant. I've always been a fan of reliability
and fault tolerance over OO purity and isolation.

--
This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Karch" <no****@absotutely.comwrote in message
news:O9**************@TK2MSFTNGP04.phx.gbl...
>Lets say I have a number of web servers that all feed data to a common
SQL Server database, which processes and sends to a master SQL Server. I
am looking at a solution that involves Service Broker at the higher
levels and that all works fine. My question is: what is the recommended
way to get data from the web server to the first-tier Service Broker?
I've done a lot of searching and reading and have not found any
definitive answers. But my ideas are:

1) Write directly to the database from the web server.
I don't really like this solution because it violates the concepts OO
design and abstraction. It also doesn't give me any assurances that the
data gets moved, other than maybe some logging. It also shifts alot of
the processing onto IIS, which I would like to be as "light" as possible,
simply servicing requests.
2) Write to a local queue managed managed by a WCF service hosted in a
Windows Service.
This gives me some abstraction, but also adds some layers that may be
unnecessary. And, if I'm not mistaken, it forces me to use a local MSMQ
if I want to make sure that the messages are durable. And there is still
the question of writing to the queue - seems like I still need to do this
from the IIS hosted web application or use memory-mapping or something.
Maybe someone could elaborate on this one.
3) Install SQL Express on the web servers and use Service Broker all the
way up the line.
This seems a bit of a hack to me - to install SQL Express on the web
servers - but would work. Also, does anyone know how this impacts
licensing; is it really truly free to install Express anywhere, even if
its 50-100 web servers?

Beyond the options above, what is the recommended way to traverse that
first segment to Service Broker if one needs durable messages? What if
volatile messages are okay - should it be done a different way? I feel
pretty comfortable with Service Broker once it gets the initial data - my
issue is getting the data in the pipeline to start.

Thanks
K

Mar 19 '07 #4
WCF with private queues will complicate the scenario and introduce
distributed transactions which have performance and reliability issues also.
I would be inclined to use Service Broker all the way out to the web server
layer and skip the middle layer if possible. With CLR stored procedures
it's generally not unreasonable to put enough logic into an activated stored
procedure to do the data validation that normally happens on the middle
tier - but that's a decision you will have to make based on the size and
complexity of your business logic.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Karch" <no****@absotutely.comwrote in message
news:%2******************@TK2MSFTNGP05.phx.gbl...
OK, makes sense. Yes, in this case, my middle tier would be talking TSQL
over SQL Client. The transactional connection is good, but it only lets me
retry, while I would prefer to have the messages queued as you mention in
the second scenario. So, is this a recommended approach - to use SQL
Express along with the middle tier? Something about it seems like
overkill. Does it make any sense to use WCF with private queues on the web
server and pick it up on the middle tier, or is this just overcomplicating
the situation? I would like to have some fault tolerance and reliability
on the web servers, but it just seems strange to deploy SQL Express to
them when maybe some other transport might be more efficient.

"Roger Wolter[MSFT]" <rw*****@online.microsoft.comwrote in message
news:FF**********************************@microsof t.com...
>How does you middle tier normally talk to the database? If it uses TSQL
over normal SQL Client or OLEDB connections then this is the way to do
the Service Broker connection. Because the connection is transactional,
if the connection is lost the SEND will roll back and you can send it
again.

If you decide to use SQL Express in the middle tier, you gain a little
more fault tolerance at the expense of a little more complexity. If your
middle tier can continue to queue messages while the database is down for
maintenance or the network isn't working, your application is
significantly more fault tolerant. I've always been a fan of reliability
and fault tolerance over OO purity and isolation.

--
This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Karch" <no****@absotutely.comwrote in message
news:O9**************@TK2MSFTNGP04.phx.gbl...
>>Lets say I have a number of web servers that all feed data to a common
SQL Server database, which processes and sends to a master SQL Server. I
am looking at a solution that involves Service Broker at the higher
levels and that all works fine. My question is: what is the recommended
way to get data from the web server to the first-tier Service Broker?
I've done a lot of searching and reading and have not found any
definitive answers. But my ideas are:

1) Write directly to the database from the web server.
I don't really like this solution because it violates the concepts OO
design and abstraction. It also doesn't give me any assurances that the
data gets moved, other than maybe some logging. It also shifts alot of
the processing onto IIS, which I would like to be as "light" as
possible, simply servicing requests.
2) Write to a local queue managed managed by a WCF service hosted in a
Windows Service.
This gives me some abstraction, but also adds some layers that may be
unnecessary. And, if I'm not mistaken, it forces me to use a local MSMQ
if I want to make sure that the messages are durable. And there is still
the question of writing to the queue - seems like I still need to do
this from the IIS hosted web application or use memory-mapping or
something. Maybe someone could elaborate on this one.
3) Install SQL Express on the web servers and use Service Broker all the
way up the line.
This seems a bit of a hack to me - to install SQL Express on the web
servers - but would work. Also, does anyone know how this impacts
licensing; is it really truly free to install Express anywhere, even if
its 50-100 web servers?

Beyond the options above, what is the recommended way to traverse that
first segment to Service Broker if one needs durable messages? What if
volatile messages are okay - should it be done a different way? I feel
pretty comfortable with Service Broker once it gets the initial data -
my issue is getting the data in the pipeline to start.

Thanks
K

Mar 19 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jason Schneekloth | last post by:
Hey all.... I'm writing an app that needs to send/recieve data from other applications running, I guess you could think of it as a data relay broker between running applications. I had planned...
1
by: benmorganpowell | last post by:
I have a small windows service which connects to a POP3 server at defined intervals, scans the available messages, extracts the required information and inserts the data into a SQL database. I am...
2
by: dkode | last post by:
Hello, I am laying out the architecture for a very large website that will scale to a very large degree. I have a couple of questions before I attempt to go and implement a Broker/Persistence...
0
by: RAM | last post by:
Hello, I am learning SQL Server and I would like to ask you a question: what are applications of Service Broker? I would like to know in what puproses it can be used in database systems. Thank...
7
by: Chris Mullins | last post by:
I'm in the process of building a number of (Web) Services using .NET 3.0 and WCF. These services are intended to be deployed within the Intranet of a very, very large orginization. I need to...
3
by: Joseph Geretz | last post by:
Our application is primarily VB6, however we are migrating toward .NET and a newer architecture. For the time being though, we're stuck with a hybrid approach with our ActiveX client application...
3
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
2
by: fireball | last post by:
Some of my receiving service side applications usually work offline, and they only are supposed to get connected to the network once/few times a day, to send/receive Service Broker messages. ...
0
by: =?Utf-8?B?aWFtc2Rr?= | last post by:
I have a windows client that calls web service 1 (Broker) synchronously, web service 1 then calls web service 2 (Service) asynchronously, web service 2 sleeps its thread for 10 seconds. When I put...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.