views:

29

answers:

1

Hello guys. My wcf is hosted by IIS and used basicHttpBinding. My common data is datasets, whci I should serialize and transmit to client. I haven't got hundreads of MB, but I want to trnasmit it to client with best perfomance.

As I understand I should use MTOM encoding. Right?

Also want to know about type of transmitting object: DataSet, Byte[], Gzip Stream (by IIS or manually).

I think my scenario is rather common. Want to hear your working fast design.

+2  A: 

IMO the fastest way to do this would be with protobuf-net via a DTO (instead of data-table). Protobuf-net can plug into WCF with just config file changes and had demonstrably the smallest output and fastest processing of any general purpose serializer I know of. I may be biased (I wrote that version) but it is free, so worth a try.

But no data-tables.

And yea, MTOM helps when passing binary (which protobuf is), but not XML (so MTOM with standard DataTable is pointless)

Marc Gravell
(I can supply a recent SO question on comparative WCF serializer performance as supporting evidence if you like)
Marc Gravell
Marc, thanks a lot. Yeah, can u be so kind give me this link. Also want to ask. if I want pass result of db queries to client I should put result of queries in dtos, and pass to client with (binary protobuf). Ok. But if I haven't got any ORM for get db results to domains and map into dto, and my db query results are just xml string. How should I pass to client this(without object collection)?
Andrew Kalashnikov
@andrew http://stackoverflow.com/questions/3790728/performance-tests-of-serializations-used-by-wcf-bindings/3793091#3793091
Marc Gravell
re the other: if you want the best performance, the client will have to know in advance what it is expecting. In many cases you can share the DTO between client and server
Marc Gravell