3 Replies Latest reply on Jan 30, 2014 10:38 PM by jschellSomeoneStoleMyAlias

    Handling an critical object if it is down




        In our J2EE web application we have so many critical functionality which is handled by various component. Say if one of the critical object or the respective critical system is down. How we can serve the request and still get the response from those systems? How this can be handled technically through code? I know we can go for service virtualization and create a system which will emulate the behavior of critical object or system. But for that we need to use the respective tools which is quite costly. How the same can be handled using java code , whether we can create a clone of that critical object and still serve the request eventhough the origibal critical object is down or can we create a proxy of that critical object? How we can handle it in java through code? Please clarify.



        • 1. Re: Handling an critical object if it is down

          If by "down" you mean down, then clearly nothing you can do will get an answer from the resource. Unless, of course, it's  resource known to have transient errors that may resolve themselves without help from you. In such a case,  you might want to implement a reasonable number of retries. An example might be a resource that's temporarily busy handling other requests.


          Other approaches you may want to consider include fail over copies of the resources (servers, etc.), and/or monitoring systems which alert you when critical resources go down.


          All of this is hypothetical, of course, since we don't know your architecture.

          • 2. Re: Handling an critical object if it is down

            800839 wrote:

            But for that we need to use the respective tools which is quite costly.

            This should be a simple calculation:

            What are the costs for losing that critical resource (temorary)?

            How much will a comercial solution be (eg. Oracle RAC or Failover)

            How much will a self coded solution cost?

            That is:

            • how much efford is to be made by your developer(s)? 
            • how expensive is it to keep the only person knowing that solution in your company (eg for extensions or bugfixes)?
            • how much will it cost if this solution does not work when needed?


            In the long run cheap solutions tent to be quite expensive...




            • 3. Re: Handling an critical object if it is down

              This isn't a code problem.  It is an architecture and design problem.


              You START with the assumption that any given system will be down at some time.  Then you look into business rules and technical decisions how to mitigate the impact of that.


              Keep in mind of course that a system can go down in the middle of a request as well.


              A solution that many businesses use is to have two duplicate servers either up all the time (two 'hot' servers) or one server as a stand by (one 'hot' and one 'cold').  In this situation the idea is that if the primary server can not service a request then the secondary server can do so.  There are many issues involved with this however.