Software Architecture and more...

Can a SOA app use TCP transport?

Yesterday I was reading some posts regarding WCF, and found the following:

"In my opinion, netTcpBinding is a very good option for us given its good performance and security options. On the other hand, it does not respect the tenets of SOA"

This made me think. Why using a TCP transport is considered a violation of the SOA tenets? Let's take a look again at those tenets (can be found here) and see what happen if we'll take an HTTP-based app and convert it to a TCP one:

1. Boundaris are explicit: When the service's boundaries are well defined, changing the protocol won't make any difference. We'll still need to send messages when we did it before, and where there were no messages at all - there won't be with TCP either.

2. Services are autonomous: If the service can stand-alone using HTTP, it will still have this capability using TCP.

3. Services share schema and contract, not class: Now, this is where we might have a problem. When using HTTP, we obviuosly share schema - simply put a monitor on the channel and the XML message will shine thrught it, all readable and clear. Now that what I call a schema! With TCP this is obviously not the case. It is using a binary format which is unreadable and can't be visualised (not easily, anyway). So, does this violates the 3rd tenet? Not necessarily. SOA should allow two (or more)applications to talk to each other, not application and human. The fact that we cannot understand the message does not mean it's invalid. It is just encoded in a different way, a way that, by chance, our inferior human brain can't fathom. But it is still schema nonetheless.

4. Service compatibility is determined based on policy: Here, also, the fact that we are using TCP instaed of HTTP has no impact.

We have grown to the perception that a valid SOA system must use SOAP over HTTP. It is more "Open", more "Stanndard", more "Understandable". Actually, all these may be true, but that's not make them a mandatory for a SOA application. There are many inherent advantages to using TCP instaed of HTTP, and using it will not make our app any less SOA-ish,

Published Thursday, September 20, 2007 9:26 AM by MemiLavi

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Kevin Daly said:

But isn't the reason it fails on 3. not a question of readability, but the fact that it does in fact share the class?

September 20, 2007 6:32 AM
 

MemiLavi said:

Kevin -

Actually that not true. By default, when using netTcpBinding you still pass SOAP messages over the wire, it just encoded in a different way (binary instead of text). It's not binary as in binay class, but as in binary encoding.

Take a look here for a complete comparison between the various encodings:

http://www.pluralsight.com/blogs/aaron/archive/2007/03/22/46560.aspx

September 23, 2007 4:45 AM
 

alikl said:

If I were you while reading the post you reference I would assert on this of course “its good performance and security options”. The question I would ask “good for what/who?”. We had this talk, Memi, several times – you know me, I am a big fun of context precision. Simple comparing 3>2 is not enough in our world – there are way too much more to add to this equation. Like hosting services, interop and other.

alikl

September 29, 2007 11:04 AM

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Submit

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker