Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should you use JCR and when should you use JPA/RDBMS?

The Java JCR API defines a persistence mechanism which can be used to replace many of the traditional roles of a RDBMS. For example, JackRabbit - the JCR reference implementation - supports transactions, SQL queries, object-content mapping, etc.

You could pick one or the other, storing binary data in BLOBs/file system pointers in a RDBMS or textual data in JCR node properties. Does anyone have experience replacing tossing their DB in favor of JCR?

You could use both, perhaps storing binary data in the CR and textual data in the RDBMS, but then you have to express relationships between systems, keep them in sync, etc. You also begin facing the difficult question of, "Well it feels right to store this document title with the document's binary data, so I'll make it a node property... but then I have this document record in my DB so perhaps I should keep it there.."

How do you decide?

like image 902
Robert Campbell Avatar asked Aug 04 '09 08:08

Robert Campbell


1 Answers

There is a paper by Bertil Chapuis on exactly that topic:

JCR or RDBMS? (blog post)

And there is also the NoSQL movement (described in this article for example, or here), which is an ongoing discussion that, hmmm, let's say, "highlights" the disadvantages of the relational model.

like image 172
Alexander Klimetschek Avatar answered Jan 03 '23 01:01

Alexander Klimetschek