Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL NOSQL mix possible or not?

Tags:

sql

nosql

I have an application on a relational database that needs to change in order to keep more data. My problem is that just 2 of the tables will store more data(up to billions of entries) and one the tables is "linked" by fk to other tables. I could give up the relational model for these tables. I'd like to keep the rest of the db intact and changes only these 2 tables. I'm also doing a lot of queries - from simple selects to group by and subqueries - on these tables, so more problems there.

My experience with NoSQL is limited, so I'm asking which one (if any) of its siblings suits my needs: - huge data - complex queries - integration with a SQL database. This is not as important as the first two and I could migrate my entire db to an equivalent if it's worth it.

Thanks

like image 629
qtm Avatar asked Nov 25 '12 15:11

qtm


1 Answers

Both relational databases and NoSQL approaches can handle data having billions of data points. With the supplied information, it is hard to make a meaningful and specific recommendation. It would be helpful to know more about what you are trying to do with the data, what your options are regarding your hardware and network topology, etc.

I assume since you are currently using a relational database, you have probably already looked at partitioning or otherwise structuring your larger tables so that your query performance is satisfactory. This activity by itself can be non-trivial, but IMHO, a good database design with optimized sql can take you a very long way before there is a clear need to explore alternatives.

However, if your data usage looks like write-once, read often, the join dependencies are manageable, and you need to perform some aggregations over the data set, then you might start to look into alternative approaches like Hadoop or MongoDB - however these choices come with trade-offs in terms of their performance, capabilities, platform requirements, latency, and so forth. Your particular question about integration between a NoSQL repository and a SQL database at the query level might not be realizable without some duplication of data between the two. For example, MongoDB does not like joins (http://stackoverflow.com/questions/4067197/mongodb-and-joins), so you must design your persistence model with that in mind, and this may involve duplication of data.

The point I am trying to make is - identifying the "right" approach will depend on your specific goal and constraints.

like image 119
icey502 Avatar answered Sep 29 '22 12:09

icey502