Safe Settings

#1

Hi,

I am trying to set up ObjectDb in a safe way that allows turning the machine off while database transactions are running.

I would like to test if things are really safe and if I don't get corrupted database files in any possible case.

I found "recovery" and "recording" in the objectdb.conf file. Which one is safer to use?

I suppose I should turn on sync="true", right?

I already tried playing with both configuration settings with the debugger and I put a breakpoint in FileDescriptor#sync(). It never got triggered with no setting that I could come up with. How come?

Thanks in advance for enlightenment on the subject.

Best,
Albert

#2

Hi Albert,

ObjectDB provides 2 separate mechanisms for recovery from failure:

Every mechanism has its own advantages and disadvantages. In some cases recording is faster and in other cases recovery is faster. Only one of the two has to be enabled in order to have a safe environment.

Both methods prevent database corruption by fixing the database on the next time it is opened, if necessary. You don't have to enable sync to avoid database corruption. If you have a specific test that shows otherwise - please upload it and this will be explored and fixed.

The purpose of sync is not to prevent database corruption (otherwise it would have been enabled by default) but to support durability (the D in ACID). But a server with electricity backup (UPS) can have a high level of durability even when sync is disabled (and the performance would be better). There are many reasons why 100% durability is unreachable anyway. For example - the hard drive itself might fail just after commit.

ObjectDB Support

Reply