marc
marc

Reputation: 41

Is OrientDB really ACID compliant?

I' am research OrientDB for academic studies. One big part we should look at is the ACID-paradigma.

The OrienDB Manual says:

OrientDB is an ACID compliant DBMS.

It also says:

When you create a property, OrientDB checks the data for property and type. In the event that persistent data contains incompatible values for the specified type, the property creation fails. It applies no other constraints on the persistent data.

So foreign-RIDs will not checkt if point to an existent record or not? If so why is Orient ACID compliant if the C is invalid?

Example: There are the classes Writer and Blog with the property Blog.author LINK Writer. There is only one record in Writer with RID=#12:0.

In an Relational database this insert should occur an error:

Insert into Blog CONTENT {"author" : "#12:1"}

There is no record with RID=#12:1, but OrientDBh occurs no error. Even within an transaction using the Java API:

ODatabaseDocumentTx db = new ODatabaseDocumentTx(...);

    ODocument newBlog = new ODocument("Blog");
    newBlog.field("author", new ORecordId(12,1) );

    try{
        db.begin();
        newBlog.validate();
        newBlog.save();
        db.commit();
    }
    catch(Exception e){
        System.out.println(e.getMessage());
        e.printStackTrace();
        db.rollback();
    }

    db.close(); 
}

So do i have a big misunderstanding or why is OrientDB ACID compliant if ther is no foreign-RID checking and so the possibility of inconsistency?

Upvotes: 4

Views: 820

Answers (1)

lsavio
lsavio

Reputation: 850

This is a limitation of the Document API, there is not check on RID consistency, because when you delete a document, finding all the other documents that link to it would mean doing a full scan of the database, that typically takes ages to complete. To resolve this, there are bi-directional links or manage link consistency at application level.

Upvotes: 2

Related Questions