views:

92

answers:

2

In an app I am working on, we use a MySQL database and want to store articles in a table. Rather than store them in a SQL DB, we were looking at just storing the key to the article in a NoSQL db. Is this a good problem to solve using NoSQL, or should we just create another table in MySQL and store the large amounts of text there?

We are looking at using MongoDB to store the text.

A: 

MongoDB is good at storing large blob-ish fields, whether text or binary. So I think that is a good thing to do.

There is a limit on BSON objects (MongoDB "records") of 4MB. If you text fields are larger than 4MB, you can use GridFS and then there is no limit.

dm
Would this be faster than keeping the data in mySQL?
tesmar
A: 

First thing I'd do is check how MySQL runs with the 'large amount of data'. If you're getting acceptable performance, then there's no point trying to make the system more complicated.

Putting the text content into a separate table in MySQL wouldn't accomplish anything. Putting it into a separate DB might help, but I wouldn't do it unless you're sure that MySQL is a significant bottleneck, and that you can't do anything else, like optimize your queries.

Mike Baranczak
In MYSQL, would it be faster to keep it in the same table, even if this significantly increases the size of the table?
tesmar
Nevermind, I found that the mySQL medium text type could store large amounts of text, and since it just creates a refernece to somewhere in the file system, doesn't slow down database queries. It would be better to keep the data in mySql for now.
tesmar