.NET question based on DataPortal observation

.NET question based on DataPortal observation

Old forum URL: forums.lhotka.net/forums/t/3377.aspx


Patrick.Roeper posted on Tuesday, August 14, 2007

I am relatively unfamiliar with the in workings and behind the scenes .NET stuff so I've become curious as to what is going on when start up our application and our dataportal is using remoting. I've noticed that everytime I start our application at the beginning of the day with remoting enabled, the first business object database call hangs for about 10 seconds. After that, everything works just as fast as the client-server model. My question is what is going on that causes this initial delay.

I am guessing that there is some sort of compilation going on during the initial request. Thanks in advance.

ajj3085 replied on Tuesday, August 14, 2007

Yes, when asp.net (which is used to host the remoting) is first started, it needs to do some compilations.  The initial delay is the asp.net starting and doing some jitting, IIRC.  That's normal behavior for asp.net.  If you restart the application, the complation has to be done again.  The application also shuts down after a timeout which again will cause the delay.

Patrick.Roeper replied on Tuesday, August 14, 2007

Okay thats what I figured.

Also, I had one more question about the dataportal that is kind of generic. I understand the concept of a mobile object being able to move from a client machine to a server do some work, and then return of the client machine. Our application is using the dataportal just to process CRUD procedures for remote users. Currently, we are using remoting just because it is built into the framework. But really for my own curiousity and lack of networking knowledge, I am curious why this approach would be better than running the system locally (client-server) and just exposing a remote database through VPN. I understand that you have another level of security by not exposing connection strings to a database to the end user, but other than that I wouldnt know the pros and cons.

One of our partners has a database application that handles remote users through a light weight, middle-man application that accepts requests over a specified port, and transmits data that is both compressed and encrypted. My instincts would tell me that this would use a lot less resources than the remoting schema that CSLA enables (no serialization/no IIS overhead). Why would remoting be a better approach than this?

Chapter 4 was a blur for me as networking is not my forté. Thanks in advance.

ajj3085 replied on Tuesday, August 14, 2007

Well putting your db server on the internet is a risk, even without the connection string problem. 

The architecture your partner is using may or may not be more lightweight; it sounds like they'd be using web services, which may be slower than remoting.   At some point, the data needs to go from client to server, and that's all that serialization is doing for you... just transmitting the data in a binary format.

I'm not sure IIS adds all that much overhead, at least probably not enough where you'd want to re-invent the wheel.  The partners model has a maintence cost to it, and they may have security holes yet undiscovered.   You need to consider that as well. 

If you can go to .Net 3.0, you can use a WCF channel instead of remoting.  I believe it offers encryption and compression of the channel.  The other nice part is that you configure the WCF channel with a standard .config file, so you can move to other channels easily until you find one that works best for you.

HTH
Andy

Copyright (c) Marimer LLC