Groups | Blog | Home
all groups > dotnet remoting > january 2005 >

dotnet remoting : Need some advice on architectural design and remoting.



Toble Rone
1/31/2005 10:04:08 PM
I'm quite new to remoting, with few real world implementations. But since i
started reading about remoting I'm hooked up on this topic, really
interesting. I had a lot of book reading on this.



I have the following scenario:



- Central SQL Server with a quite big database.

- Complete (and tested) LLBLGenPro DAL of my relational domain.

- Lot of custom BLL components.

- ASP.NET/C# web site consuming all the underlying components.



It's a corporate web application used by about 500 people all around the
country. The application works really well, with good performance.



Right now... I have a requirement of creating a "WinForm client" with all
the functionality of the actual website and a bunch of new features (some of
them almost possible just with rich clients).



Since I'm using the "Adapter" scenario of LLBLGen (a "factory design")... it
's quite easy for me to right a wrapper component for the DAL and the BLL,
make that component remotable, and create a host (possible IIS or windows
service) for it. The clients will access the component over the Internet.



So... imagine a WinForm client that needs to access the "remote object",
firstly with login information and with all subsequent method calls
accessing specific data for THAT client. My first thought was a CAO
scenario, with every client creating an instance of the main object. The
idea was... letting the client create the instance, and have that instance
alive all the time while the user have the client "connected" (the
connection periods can be 10 hours per client or even more). The instance
could store client information, login, client-specific parameters and have
every method using that state data to perform the actions.



So, my first (easy) question is...: it's even close to reality having a
remoting object instantiated so long? There is any serious limitation
related with server capacity, threads, and that kind of stuff? I now CAO
take down scalability seriously, but I'm assuming that my actual hardware
can handle easily all the possible "rich clients".



The other possible way is: having a SingleCall scenario, when the first
login method returns a "token" (and the host persisting that token on the
DB, or something like that)... and every subsequent method call will send
that token among the other parameters.



Every single comment on this will be REALLY appreciated.



Tnx in advance.


NuTcAsE
2/1/2005 11:01:03 AM
[quoted text, click to view]

Yes. You could practically allow the CAO to live as long as the client
application's alive... but with bandwith and memory costs. When
implementing CAO, the server determines the lifetime of the cao, and
according to your implementation the cao should live as long as the
client is alive. This involves regsitering a client side sponsor that
the server can ping at reggular intervals to see if it should discard
the cao object at the server side... When dealing with a relatively
high transacted environment, the pinging between the server and client
slows the system network considerably.. and over the internet is a
complete different thing. Coming to scalability, you can forget it with
CAO. CAO's serious limitation is that once it is created it binds to
the specific end point to the server. That means out goes load
balancing. You cant take any load balancing or web farm advantages of
IIS when you host CAO services. The same above is valid for marshalled
SAO services.

[quoted text, click to view]

SingleCall's are the best when it comes down enterprise level
distributed apps. They dont take up that much memory (they are gc'd at
the next garbage collection cycle), you can use IIS load balancing and
web farms to scale your application, and dont consume excess network
bandwith if the interfaces arnt chatty.

I would suggest using the SingleCall scenario. Admited its a litle more
complex and required more plumbing than the CAO approach, but the
result will a more responsive and scallable application.
Thats my 2c.

NuTcAsE
Fred Hirschfeld
2/1/2005 1:54:47 PM
I would agree with this as we are in the process of performance tuning /
scaling our application and IIS Hosted SingleCall (binary formatter) seems
to be the best. It may not be the ultimate performer but when the load
begins to get heavy, it scales gracefully especially with the Web Garden
feature of IIS 6 (IIS5 has a simular thing when you use the High (Isolated)
process for the IIS Application in COM+).

FYI... I also did some testing with compression (with datasets I was getting
300K to 30K) but for us the connection between the servers was high and so
saw little to no improvement with it in place. If there was a slower
connection it would likely be of benefit (internet vs intranet).

Fred

[quoted text, click to view]

Yes. You could practically allow the CAO to live as long as the client
application's alive... but with bandwith and memory costs. When
implementing CAO, the server determines the lifetime of the cao, and
according to your implementation the cao should live as long as the
client is alive. This involves regsitering a client side sponsor that
the server can ping at reggular intervals to see if it should discard
the cao object at the server side... When dealing with a relatively
high transacted environment, the pinging between the server and client
slows the system network considerably.. and over the internet is a
complete different thing. Coming to scalability, you can forget it with
CAO. CAO's serious limitation is that once it is created it binds to
the specific end point to the server. That means out goes load
balancing. You cant take any load balancing or web farm advantages of
IIS when you host CAO services. The same above is valid for marshalled
SAO services.

[quoted text, click to view]

SingleCall's are the best when it comes down enterprise level
distributed apps. They dont take up that much memory (they are gc'd at
the next garbage collection cycle), you can use IIS load balancing and
web farms to scale your application, and dont consume excess network
bandwith if the interfaces arnt chatty.

I would suggest using the SingleCall scenario. Admited its a litle more
complex and required more plumbing than the CAO approach, but the
result will a more responsive and scallable application.
Thats my 2c.

NuTcAsE

Ken Kolda
2/1/2005 2:13:57 PM
The idea you're proposing is certainly very valid and one I've used before
(using a CAO as a "Session" object essentially o cache the client's
credentials and act as an entry point for all requests from the client).
It's just important that you understand the ramifications of this choice and
the possible issues you can run into down the road. Here are the ones I
think are most significant for your situation:

1) The number one issue with using CAOs in this manner is scalability,
particulary if you need to go to a web farm envrionment. You should be 110%
sure that you can handle the load on your one server before you move ahead
with this type of architecture.

2) The CAO lifetime issue is especially a problem in a WAN environment
where, even if you use Sponsors, the server probably cannot connect back to
the client to see if the object's still in use. One alternative to sponsors
is to solely depend on the RenewOnCall feature and set the timeout to be
fairly long. This, of course, can cause a buildup of dead CAOs that will hog
memory.

Another option (and one I've used) is to buy a third-party product such as
GenuineChannels (www.genuinechannels.com) that allows you to track the
connection state of clients so your server can proeprly dispose of CAOs when
the client disconnects. Then you can simply set every CAO's lifetime to
infinite and forget sponsors altogether.

Good luck -
Ken


[quoted text, click to view]

AddThis Social Bookmark Button