Search code examples
sqldatabasenosqlrelational

should i choose SQL over NoSQL?


Well, basically I'm working on a web application that may get quite bigger over the time. For now I just need basic user information, so i was thinking that a SQL db should be enough, but as in the future it may need to save more info that I did not have in mind (I'm not talking about a forum, but maybe info like messages or a user board), I thought having a NoSQL db would be better.


Solution

  • You shouldn't be thinking about this in terms of either/or - adopt the notion of Polyglot Persistence - multiple data stores for different purposes.

    • Need to be able to stored highly structured data with lots of joins or relationships between objects? Use a Relational database.
    • Need to have flexible data structure, with dynamic metadata that cannot be easily foreseen? consider a Document Oriented database
    • Need to identify complex relationships between objects and trace nodal relationships looking for patterns that are hard to ascertain across multiple links? use a a Graph database
    • Need to have lightning fast real-time responsive search and interactive look up to iteratively narrow down choices? use a Key Value pair data store.

    I highly recommend the book No SQL Distilled by Martin Fowler and Pramod Sadalage to explain this topic well. It is not very big, which helps.