I am currently using Flex (Flash Builder 4) and making web service connections to a Apache PHP Zend AMF server to retrieve data.
This works great, but I am wondering what options are available for fault tolerance.
I know I can probably set up a second server that the application would switch to in the event it is unable to reach the first server. Any thoughts on that would be nice, but I am also thinking about trying to give each individual machine some tolerance.
For example, if they at least had the ability to input data to the application, that would be a start. So if they click 'save' and it can not reach the server, it caches it or stores it to a local file until the server is back up. Though lack of being able to do data look-ups might be a big problem.
Maybe there are already some libraries or something I can look at to do this?
So far it sounds like I would either go with:
A Failover solution (not sure specifically what kind) - As SuperSaiyen suggested, I assume I would need a specific router or dns solution to handle that. The idea being that the device would either route the traffic normally intended for server1 over to server2, OR in the case of a dns solution, when server1 is down it would be returning server2's address for lookups.
I believe another solution would be to try to connect a few times to server 1 in the flex code. If the server is down, then it tries server2. As Flextras pointed out, this solves the problem as long as the application is already loaded on the users screen. For me, this is usually the case. In fact, I might even consider making this an AIR application so I do not have to deal with the initial application load if the web server on server1 is not available. Otherwise, I would still have to has some kind of dns fail-over or give them short-cuts to the two servers and train them to try the second one if the first is down (which I think is NOT a good option).
Any other ideas?