Last post Jun 13, 2011 03:23 PM by atconway
May 31, 2011 07:28 PM|aicrag|LINK
Hi!, don't know if this is the right place to post this question, but, hope you can help me.
I've been looking for a solution on this, I'm creating a ASP.NET website, one of the requirements is to allow the site to let the user know of a server disconnection, then if the server goes down, the site must be able to display a waiting message, meanwhile
in the background, the page will be trying to connect to another server, once the connection is stablished all queries will be against this new server, and when the first server goes up, the process will syncronize all operations that was made against the
secondary server and wait again to configure in the background and run queries against the first server.
I tried to explain as well as possible, any help will be greatfully appreciated
May 31, 2011 07:44 PM|XIII|LINK
these servers, are those webservers? If so you could go for a load balanced server configuration so that if one server goes down you can still get balanced to the other one. Be sure however that session state needs to be put out of process (sql server or
state management server).
May 31, 2011 08:49 PM|aicrag|LINK
Hi, thanks for you replay
yes both are webservers, located at differents locations. The central server is accessed through the internet, the problem comes when there are communication problems due to a problems with ISP or whatever makes the server inaccesible, so the big deal here
is to know the moment the connection goes down and let the user knows it, and then establish a connection with the second one, that is located at a local always available intranet
May 31, 2011 09:46 PM|XIII|LINK
Then why don't you always connect with that more reliable intranet server? Or host your application on Windows Azure. They got some good SLA to provide.
May 31, 2011 11:42 PM|aicrag|LINK
Azure would be perfect, but isn't up to me, so cannot do that ... neither can always connect to the intranet, because is just for a company
branch, not the entire company, actually the main idea is to have a local server in every single branch with connection problems and do the process I described above
Jun 01, 2011 05:55 AM|XIII|LINK
I'm not an infrastructure specialist but according to me it's more on the infrastructure side that you need to handle this problem then on the application side. You could poll with ajax to the server but it's via the dns name. If the server doesn't respond
to the ajax call you would be able to see it error out but there's no direct dns switch available for the application.
If the server would be known then you could do a post, by changing the form action to the url of the backup server with an ip address and send the data to there. However that would give you the problem that you can't make use of Session state as session's
not available for that user on that backup server unless you have single point to store it like a sql server. You didn't mention if you only have one sql server and where it's hosted but if that's also duplicated then you're likely in other problems like synching
Another option would be to save the data in local storage with html5 but not all browsers support that and you end up with data syncing again too.
Jun 01, 2011 12:02 PM|Mastan Oli|LINK
Jun 01, 2011 02:50 PM|DotNetSeeker|LINK
I think you are talking about a "Web farm" scenarion for your .Net application. A Web farm setup inherently handles these issues.
Here's a link
Jun 02, 2011 12:07 AM|aicrag|LINK
You could poll with ajax to the server but it's via the dns name. If the server doesn't respond to the ajax call you would be able to see it error out but there's no direct dns switch available for the application.
thks, I was thinking in something like Comet and keep an open channel, and that way check if the connection is available, it's a posibility... can't use WFF due to infraestructure issues... what i'm thinking of, is advisable???
Jun 02, 2011 07:37 AM|XIII|LINK
Comet could also be a possibility but the thing is that you're using outside and inside servers and as such don't really have the possibility to make use of Session state so you'll need to either always have to include things in hidden fields or in querystring.
Jun 02, 2011 08:34 PM|aicrag|LINK
thks for all of your replies, think I will be using Comet. The session will be another issue, as well as the
Jun 13, 2011 03:23 PM|atconway|LINK
@aicrag - just to pile one more option on top, instead of using the long-polling architecture in Comet, you could also consider using a small Silverlight control on your ASP.NET page to do the same thing, and have the familiarity of managed .NET framework
code. The downside as always with Silverlight is the plug-in download, but if this is not an issue then this is the way I would go. Then you could use an array of functionality from the System.NET namespace within the Silverlight control to do a Ping for example
to determine whether a remote computer is accessible over the network:
That's just 1 idea; there is a lot of functionality in the System.Net namespace to determine if a site/server/IP etc. is up and running. Me personally being a .NET guy, I would rater use managed code when possible to solve a problem like this when possible.
If using SL is not feasible, then another client-side method as recommended before should work too.