Chris Szabo
9/25/2004 3:21:00 PM
Hey everyone. If you're a real .Net person this question is going to make
your day... I'm working on a project, and I'm in the initial stages of
design. I wanted to get some feedback on my ideas before I begin any
implementation.
The basic idea is not new. I have a web service that processes inbound
requests. To provide a high level of scalability, the web services interface
with a data access layer via .Net remoting. The DAL is implemented as a
windows service that accepts requests via TCP on a specified port.
Obviously, those requests are then sent to the database, and results are
returned to the web services.
So here are the design considerations:
1. Transaction control - I would like to use Enterprise Services to take
care of transaction control at the application level (web services). Is this
possible when I'm working with .Net remoting.
2. SAO Singelton - There is information that I want to share between all
calls going to the remoting objects. For example, total current requests.
Information like this can allow me to load balance later, and send requests
to identical windows services that are on different servers. As such, I'm
thinking that the best way to implement the remoting object is to use a
server activated object with an infinite lifetime using the Singelton model.
Am I on the right track?
3. Threading - The SAO Singelton model has an inherent problem in that it
creates a bottleneck in the system. I would like to have a main thread that
takes inbound requests and hands them off to worker threads which actually
make the calls to the database. The threads would be in a pool, whose thread
count is defined in a configuration file. How does that sound?
4. Database Methods - I would like to save on memory usage by declaring all
my database methods as static. This way I never have to create a new
instance of the classes that interface directly with the database. I know
the concerns with the associated with Enterprise Services, but the
transaction control would not happen at these methods, so that problem is
solved. Are there concerns with static methods and .Net Remoting?
Thanks everyone, I really appreciate the feedback on this. I know what I'm
doing, but by no means a .Net God. I'm sure some of you out there are
though, so please guide me.