My solution would be to make a small sinatra app that wraps the unreliable
database that always returns some sort of usable status instead of crashing;
then talk to it through rest-client or any other api interface.

Martin Emde
Tw: @martinemde


On Fri, Apr 23, 2010 at 4:39 PM, Glenn Little <[email protected]> wrote:

> We've got an application that uses several databases.  One of those
> databases is not in our control, and can go down occasionally.  Several
> of our models rely on that database, so when it goes down our app is
> left unable to start.
>
> What we've done in the past when this happens is to just temporarily move
> the relevant model rb files out of the app source tree.  The app then
> starts, and we then just have to stay away from any runtime code that
> hits those models (not a super-huge deal in this case, that code is
> relatively isolate).
>
> Is there a fairly clean way though to protect ourselves just via the
> code so that if that database goes offline we can perhaps warn ourselves
> and then continue running in a deprecated mode?
>
> Thanks...
>
>        -glenn
>
> --
> SD Ruby mailing list
> [email protected]
> http://groups.google.com/group/sdruby

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to