Faster: Serialize Entity and Xmit over LAN or..

Posts   
 
    
MatthewM
User
Posts: 78
Joined: 26-Jul-2006
# Posted on: 14-Sep-2006 01:22:45   

Which is faster: Serialize an Entity and Xmit over LAN or query it from a very nice SQL Server.

I should just do the test in bulk. At a hunch I say the serialize / xmit / deserialize but it seems awful close..

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Sep-2006 08:15:28   

This depends on many factors and I think there is no standard answer for it. So you should have tests to see what's better for your setup.

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 14-Sep-2006 17:29:53   

It also depends on how your serializing those entities. Binary Formatter? are you hosting the remoting layer in IIS? etc etc...

My guess though is that xmiting from sql server is going to be faster from a pure performance perspective, infact i am almost 100% sure ( plus i remember reading in some newsgroup post somewhere that a guy did a test on it and sql was always faster wink )

Obvisouly remoting over TCP is going to be more on par with sql but will still be faster..

The problem with connecting directly to sql server though is that it doesnt scale...by using a remoting layer you can take advantage of connection pooling...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 14-Sep-2006 21:30:05   

I'd say LAN access to the sqlserver, as you then will get very small packages send over the wire and hte lan transport is IMHO the bottleneck.

Frans Bouma | Lead developer LLBLGen Pro
MatthewM
User
Posts: 78
Joined: 26-Jul-2006
# Posted on: 15-Sep-2006 18:58:47   

Well I can't say definitevely from my hacked up tests. Remoting over tcp was on par with querying from the SQL server in question. However, I setup cases both directions to swing the balance.

I was going to say this was going to be a tough choice, but it seems that double/triple/etc fetching data from SQL makes more sense in the long run. Then only 1 box or cluster needs to be upgraded based on load/data size.

I guess it seems obvious now.