Should I store my relational data in MongoDB?
Any insight given my unique situation (outlined below) would be greatly appreciated!! As with any project, my resources are extremely limited. I'm looking to improve performance with as little cost as possible. :)
Background
- I'm working on a project with an expansive and complex data model.
- 84 primary tables
- 44 views into secondary tables
- 600k instances of the main item type
- 500,000,000+ tuples supporting the 600k main items
- The model is well normalized, and was well thought out.
- Many items have been denormalized for performance.
- Our data access layer uses Hibernate for ORM.
Problem Statement
Hibernate joins the 84 tables + 44 views together to map the primary data item together (I'll refer to the primary data item as THEObject). This construction is extremely expensive (single Oracle db node). It can take minutes to assemble THEObject and its children.
There is very little data shared between instances of THEObject. The data that is shared, is primarily read-only (Stuff like user data, references to general configuration...)
Saving THEObject is also extremely expensive.
As a side project, I created a set of beans to represent THEObject's data, copied data from an expensive instance of THEObject into the beans, then serialized the bean to XML using xstream. The conversion from THEObject to a bean, serialization of the bean, and storage of the XML representing the bean took a mere 26ms. (Nowhere near the 6minutes required to save THEObject back using hibernate over our relational representation). O.o
I think my application would be better served by a Document based database because the data I work with comes in 3 main chunk types (thinking collections), and the chunk representing THEObject shares data from 2 of the other main chunks, but doesn't share any of its own data amongst other instances of THEObject. This would allow me to read THEObject as a whole item with no joins or performance degradation related to normalized storage.
Is it reasonable to store my data in a document based database despite the fact that it's really relational data?!
Relevant Reading
Why should I use document based database instead of relational database?
Non-Relational Database Design
What is NoSQL, how does it work, and what benefits does it provide?