pardon the very long thread title
we have this WCF service operation that can get up to hundreds of thousands of rows from a database and send it to the WCF client. (it's part of the customer requirements that they really GET this hundreds of thousands of rows!) since this can take a really long time we decided to implement paging so that the WCF client can just request chunks of data at a time (like 2000 rows each) until it gets the whole thing in.
while this works OK, it's kinda slow. and i couldn't help but think of the overhead of repeatedly executing the same database query on the server side everytime a chunk of rows is requested by the WCF client. i'm thinking...would it be possible to do this asynchronously? like the WCF client will tell the server to perform a task, then the server will spin off the task in another thread and fill up this huge list, then the WCF client can call another operation to retrieve those chunks.
i'm afraid we're stuck with BasicHttpBinding here since our clients are not actually WCF clients but ASMX clients (.NET 2.0 only). right now i'm leaning towards reimplementing just this operation via .NET remoting and having the server do callbacks to the client whenever a chunk of data is ready. but that's a more radical infrastructure change so I'd like to solicit some of your ideas first before proceeding with this shift to .NET remoting.
thanks in advance!
http://devpinoy.org/blogs/cruizer
We can implement event handler on the client-side and send the serialized delegate to the server-side to subscribe for the event.
Server component fires the event as and when the chunk of data is available and the client will receive the callback.
A few things off my mind.
Some reference for reading.
http://www.codeproject.com/useritems/Net_Remoting_Events.asp
Hope it helps a little.
thanks...but i also want to hear from you folks the affirmation that it can't be done by just web services (ASMX client, WCF server)
looks like we'll really have to go remoting in this one if we want to optimise loading speed...
WCF (when use on both client and server) can support duplex channels to allow the server to call back clients for notification or returning result in asynchronously.
However, if the client is just ASMX client, duplex channels are no longer applicable.
To work around it, can we consider polling? Server keep results in cache (session variable) and let the ASMX client regularly fetch chunks of data.
But do aware that pull technique always generate more traffic than push in any implementation.
you're right. and it can severely limit scalability of the server to support more clients since it's going to have to keep in memory all those rows.
thanks for the inputs! now I know that remoting with remote events/callback is the way to go if we want the best performance. it would've been easier to use WCF and NetTcpBinding to support callbacks but our client platform is stuck with Win2K (thus .NET 2.0 only) for now.