I am about to start with an application using JSF 2, Seam 3, Hibernate and Hibernate search with the following characteristics:

  • Users will be uploading documents (pdf, doc).
  • There can be millions of documents.
  • The application will be deployed in the cloud.

Here are my questions:

  1. What will be the best place to store the documents: a database or a content management system (CMS)?
  2. If choosing a database, should I go with document oriented db?
  3. Is there any integration between Hibernate and document oriented databases or CMS to fetch the documents and index it in Lucene?

Basically I am looking for an approach that will be good for storing documents in the cloud, easy accessibility of documents for indexing and keeping performance in mind.

Any suggestions / experience or link on this will be good.

1 Answer 1


You are confusing a few concepts here.

Basically CMS is an Application that USES a Data store. The CMS its self will store file in either the File system or in a DB. These are not mutually exclusive. A CMS may use document oriented database but I don’t know of any that does.

Your best bet (if not using an off the shelf CMS) is to use a standard DB, Store all your file attributes in the DB but the store the actual files in the file system. Store the file location in the DB. (Web servers are better then DBs at serving up files. So this configuration will give you the best of both worlds.) Millions of docs should not be a problem.

I don’t know enough about Lucerne or document oriented databases to comment on it. -Sorry.

  • 1
    Just be careful if storeing files on the file system that you have no name clashes. Maybe pre-fix the file name with the key you use in the database to make it unique. Also you will need to think about replecation so you do not loose data.
    – adam f
    Commented Dec 20, 2011 at 21:17
  • Just saw this link programmers.stackexchange.com/questions/105191/…, although it talks about storing images in database, but it also applies in my case, so storing documents in db is not good .. but can I store documents in FileSystem on Cloud ?<br/>Also what I mean by using CMS is maybe CMS provides some API so that its easy to store documents whether it is database or FileSystem Commented Dec 21, 2011 at 7:38
  • Yes, you can store documents in FileSystem on Cloud. Anything you can do on a "Server" (web servers included) you can do in the Cloud.
    – Morons
    Commented Dec 21, 2011 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.