I am curious about a great way to creating a DB connection manager for any load-balanced n-tier system.
Classic n-tier appears like this:
Client -> BusinessServer -> DBServer
A lot-balancing solution when i view it would take a look such as this:
+--> ... +--+ +--> BusinessServer +--+--> SessionServer --+ Client -> Gateway --+--> BusinessServer +--| +--> DBServer +--> BusinessServer +--+--------------------+ +--> ... +--+
As pictured, the company server component has been load-balanced via multiple instances, along with a hardware gateway is disbursing the burden included in this.
Session server most likely must be situated outdoors the burden-balancing array, since it handles condition, which should not be copied.
Barring any major errors in design to date, what's the easiest method to implement DB connection management?
I have develop a few options, but there might be others I am unaware of:
Introduce a brand new Broker component between your DBServer and also the other components and allow it to handle the DB connections.
- The upside is the fact that all of the connections could be handled from one point, that is very convenient.
- However that now there's one more "single reason for failure" within the system. Other components must feel it for each request which involves DB in some manner, that also makes mtss is a bottleneck.
Slowly move the DB connection management into BusinessServer and SessionServer components and let each handle its very own DB connections.
- The upside is the fact that there's no additional "single reason for failure" or bottleneck components.
- However that there's also no treatments for possible conflicts and deadlocks aside from what DBServer itself can offer.
What else can be achieved?
FWIW: Technology is .Internet, but no vendor-specific stacks are utilized (e.g. no WCF, MSMQ or even the like).
Ultimately, I opted for a design that's hybrid of these two I pointed out within the question. I have made the Broker and SessionServer into dynamic components, which could then each be set up to operate in both-proc with BusinessServer or out-of-proc, thus covering all imaginable combinations.
Essentially I have selected to set up a little more try to result in the system easy to customize so I'm going to be able determine a great way situation by situation.