LuckyLuke
LuckyLuke

Reputation: 49097

What exactly is the definition of a content repository?

I am using Apache JackRabbit for storing the images for my application. I have just started to use it and I still have some questions unanswered:

  1. What is the difference between a content repository and a database?

  2. Can you use a content repository for saving all the data of an application instead of a database? (I know you can add all kind of nodes and properties it is more like a question if you actually should save everything in the content repository).

  3. Are content repositories always organized in hierarcies?

I am struggeling with the definition of what makes a content repository.

Upvotes: 4

Views: 2734

Answers (2)

Bertrand Delacretaz
Bertrand Delacretaz

Reputation: 6100

If you allow a shameless plug, my "Java Content Repository - the best of both worlds" article might help understand what a content repository is.

In the JSR 283 spec, the Java Content Repository is defined as

an abstract model and a Java API for data storage and related services commonly used by content-oriented applications.

So you could say it's a storage system that's best suited for content-oriented applications, for example as a back-end for websites. It's more similar to hierarchical and object databases than to relational databases, and we often refer to it as "a file system on steroids" meaning that it's well suited for file storage but does much more. The "related services" in the above definition are quite rich and include versioning, observation, fine-grained access control, structured and full-text search - many things that you need when working with content.

That being said, I disagree with @EJP that using multiple datastores is necessarily better - a major benefit of JCR is that it nicely integrates file storage with database-like operations and unstructured schema-less storage, without requiring the kind of hybrid system that @EJP mentions and that might be much harder to manage. Depending on your needs, more specialized storage systems might be useful, but JCR offers a lot of out-of-the-box functionality that you'd have to reinvent if you create your own hybrid storage system.

Upvotes: 3

user207421
user207421

Reputation: 310979

I am using Apache JackRabbit for storing the images for my application.

Why? If you don't know what it's for? That's not one of the things it is best at. You would be better off storing images in the file system.

What is the difference between a content repository and a database?

A database is for structured data that you want to access in a transactional way. A content repository is basically for documents, where you may need e.g. versioning, hierarchy, ownership, ...

Can you use a content repository for saving all the data of an application instead of a database?

Yes but you shouldn't.

Are content repositories always organized in hierarchies?

How to organize it is up to you but that's the way it's usually done.

As an example, I am presently using four datastores:

  1. The file system, for images and other static resources.
  2. A database, for structured transactional data.
  3. An LDAP server, for user data.
  4. A JCR repository, for documents, versioning, hierarchy, WebDAV access, etc.

Upvotes: 3

Related Questions