Strategic issue: Mixing relational and non-relational db?
Asked Answered
E

3

14

There has been a lot of talk about contra-revolutionary NoSQL databases like Cassandra, CouchDB, Hypertable, MongoDB, Project Voldemort, BigTable, and so many more. As far as I am concerned, the strongest pros are scalability, performance and simplicity.

I am seriously considering to suggest using some non-relational db for our next project. However, some teams comprise some RDBMS fanatics, so convincing a hard switch might be impossible in some cases just because of emotional reasons. Also, when it comes to complex data models, I personally still believe in the power of RDBMS with their low-level consistance enforcement mechanisms.

Now here comes my question: I was wondering, if someone could seriously consider using both, RDBMS and non-relational DB in a new project: The complex, but not performance critical data model would still be implemented using a relational model and db, while all performance critical, yet, simple models would be implemented with a non-relational db. Furthermore, such a soft paradigm shift would be much easier to sell to some highly emotionalized team members than a hard one.

Would anyone recommend such an approach? Or would you rather recommend a black or white, i.e. relational or non-relational approach? All comments highly welcome!


P.S.: Any idea if such a mix-up works well with Spring and Hibernate/JPA?

Every answered 8/7, 2010 at 23:35 Comment(0)
S
15

Rob Conery recently wrote about his experience building his popular web application TekPub with both MongoDB and MySQL, highlighting the strengths of both:

The high-read stuff (account info, productions and episode info) is perfect for a "right now" kind of thing like MongoDb. The "what happened yesterday" stuff is perfect for a relational system.

At a high-level, Rob breaks their application data into two scopes: runtime data and historical data. The current state of a user's shopping cart, for example, is great for keeping in MongoDB. It's an object blob that is constantly mutating. To keep a historical record of what went in and out of the shopping cart; when it happened; the state of the checkout are great for relational, tabular data in MySQL.

He summarizes with this:

It works perfectly. I could not be happier with our setup. It's incredibly low maintenance, we can back it up like any other solution, and we have the data we need when we need it.

Update May 2016 (6 years later)

This has only become more true in the last 6 years. It's now common to see NoSQL databases powering transactional stores and traditional relational databases powering analytical databases.

Skycap answered 8/7, 2010 at 23:42 Comment(3)
Thanks for the input, great blog entry.Every
The article, however, is gone. As are all the nosql articles on Rob's blog it seems. Do you have sources of applications that have run for more then one year and are still happy? Or Better sources that have moved from SQL only to a combination?Cradle
@BorisCallens I think a mix is now the more common case. Most modern applications in most companies I have observed take it for granted that a solution will use multiple kinds of data stores.Skycap
C
3

I use both. RDBMS is good for complex analysis, reports, and data accessed in different ways by multiple users. NOSQL is great when I'm looking at a data from a single users perspective. A question I ask myself is: "Who is accessing this data?". If the answer is 1 user, I use NOSQL to store it.

Of course, there are other times when it is appropriate, but that's just one example.

As you mentioned, NOSQL is simpler storage, and it could cause you to have to right complex code to maintain data... For example, storing a list of connections.

Chromogenic answered 8/7, 2010 at 23:53 Comment(0)
R
0

Non-relational key-value databases are best used for blob storage and caching.

Robynroc answered 8/10, 2010 at 14:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.