0

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?

4
  • 3
    Honestly, my first thought is "Do you really need this?" If there is a problem machine then the user will most likely never get to the SWF in the first place. Things like load balancing and data centers can help w/ the "server down" style issues. I wouldn't try to handle such "machine down" issues in code. Aug 15, 2011 at 21:37
  • Yea, I am leaning toward having a second apache/php/db server and set up sync and replication between the two. Then all I would need to do is in flex connect to 'server2' if 'server1' is not reachable. Aug 16, 2011 at 10:02
  • I'm not sure if you understood my point. If your machine is unreachable; how did your user load a Flex app from it? Aug 16, 2011 at 10:24
  • you're looking for Failover(en.wikipedia.org/wiki/Failover), possibly with some dynamic routing, With that you don't have to put the if server1 down try server2 code in the client at all, it all can be handled by a dns server/router. Aug 16, 2011 at 12:33

1 Answer 1

0

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.