is .NET Remoting dead? WCF and Llblgen XML serialization performance questions...

Posts   
 
    
Walter Almeida avatar
Posts: 150
Joined: 27-Aug-2007
# Posted on: 18-Sep-2009 13:12:28   

Hello,

I am actually struggling with one key design decision. When dealing with communication between systems or sub-systems, the current Microsoft recommendation and trend is to use WCF. And I am not especially talking about SOA but really communications in a broader sense.

In the past there was .NET Remoting preferred for inter-Microsoft based applications. This technology is supposed to be replaced by WCF, which kind of standardize communications.

However I can see a big benefit of using .NET Remoting: .NET Remoting allows the use of a binary serializer which is not supported (at least with no custom extension) by WCF.

You can decide with WCF to use a binary encoding (default for NetTcpBinding). However this will only provide binary encoding for transport. And what's encoded is the XML Serialization of the message...

We know that XML Serialization is not the most efficient. And Llblgen provides a fast binary serializer for when you need high performance with not too much concerns about inter-operability. I am very sad that I cannot use this fast serialization with WCF....

So my questions are: 1. In llblgen framework: How less performant is Xml Serialization as compared to fast serialization ? 2. Has anyone already developped/use an extension that provides binary serialization for WCF (not transport encoding but really objects serialization)? (don't know if it is possible and agree it would break a WCF paradigm where everything should be SOAP... but that would kind of simulate .NET Remoting) 3. Any information about .NET Remoting future? will it be maintained? or abandonned?

I kind of like the idea to use WCF if I can reach the performance level of .NET Remoting. Reason is it is very easy then to tweak the configuration depending on your needs...

Thanks in advance! Walter Almeida

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 20-Sep-2009 10:57:06   

WCF binary serialization is still xml but sent binary. The only real binary serialization is remoting with the binary formatter.

It's however not a matter of serialization techniques, but how you want to setup your services. In general, SOA is about having services as independent applications with an interface which listens to messages. At that level, the serialization system doesn't really matter as it's not 'chatty' and doesn't involve large blocks of data. However, if you want to setup the service as a data-service, i.e. more REST like, you have a 'chatty' service which potentially will accept and send a lot of data. In that light, xml based serialization isn't great, fast serialization over remoting is much faster, but at the same time also more low level.

So, it's up to you how you want to architect your system. Personally if you don't use pure SOA, there's little reason to use a service at all as it's just adding overhead (as there are dependencies between layers anyway).

Frans Bouma | Lead developer LLBLGen Pro
Walter Almeida avatar
Posts: 150
Joined: 27-Aug-2007
# Posted on: 21-Sep-2009 15:22:58   

Otis wrote:

WCF binary serialization is still xml but sent binary. The only real binary serialization is remoting with the binary formatter.

Yes I agree... when we talk about binary and the TCP binding, we're in fact talking about binary encoding on the wire... but XML serialization (and xml deserialization) indeed occurs before (and after)

Otis wrote:

It's however not a matter of serialization techniques, but how you want to setup your services. In general, SOA is about having services as independent applications with an interface which listens to messages. At that level, the serialization system doesn't really matter as it's not 'chatty' and doesn't involve large blocks of data.

Yes again I agree... However Microsoft sold the whole WCF story as a unification of communications on the Microsoft plateform (and above, when interoperable configuration is used), and not necessarily only in the most pure SOA form. That said, they talked about WCF as beeing a replacement for all Microsoft legacy technologies, be it ASMX web services, DCOM or .NET Remoting. However we can see that this is not the case (at least not by default) as WCF uses only XML Serialization thus making it much less efficient that .NET Remoting + binary serialization. Microsoft even published a paper showing that WCF is performing better than .NET Remoting!! see: http://msdn.microsoft.com/en-us/library/bb310550.aspx However when you see the details, the test is done on the following contract:

public interface IRemoteObject { [OperationContract] byte [] GetRBytes(int NumBytes); }

So OK... This example does not require big work for what serialization is concerned!! So the test only says that WCF performs better for transport on the wire... nothing related to what happen before or after. I guess they want to sell the whole WCF story while hidding some precious details... and bad surprises...

Anyway... WCF is extensible. By default using the DataContractSerializer. I guess it should be possible to replace the DataContractSerializer by the Llblgen FastSerializer used for remoting. That would make doing distributed application with WCF as fast as (or faster since apparently WCF more efficient on the wire) with Remoting. Ok would not be interoperable and not follow SOA principles, but would help do everything with the WCF stack, + also would allow passing predicates though WCF since now using the Llblgen serializer... Does that make sense?

Ok in the mean time I will just use .NET Remotingsimple_smile