database-designnosqlrdbms

Why choose a relational DB over a NoSQL one?


Apart from certain cases, most modern applications need:

  1. Great scaling

  2. Adaptible model (db schema)

One could also argue about development agility, but I'll say that's under #2 in relation to a database.

Given the aforementioned points, according to what I've read about NoSQL databases, they are better suited to those problems than relational ones.

When should you consider a relational database when starting a new system from scratch? (Excluding the case where the system is very query heavy - where I think that RDBs have the advantage)

(PS: I've just started learning about NoSQL DBs, and given that I've only came in contact with relational ones at the university, I'm trying to understand when to choose each one, and if I should focus on NoSQl)

Forgot to write, I don't understand why ACID is considered an advantage of a relational database. How can any database not have atomicity or consistency? Do NoSQL databases not ensure those? And if so, how the heck can you rely on them?


Solution

  • Here are the reasons, you can consider Relational databases over NoSQL

    1. Transactions (for eg: database for bank accounts, most of the operations result in updating multiple tables as unit)
    2. Data integrity (check constraints, referential integrity constraints etc)
    3. Zero data loss recovery
    4. Security and compliance

    You should focus on both. If your project requires transactions, security, zero data loss etc then better to go with traditional RDBMS. For projects like recommendation engines, endorsement engines where scalability is the major challenge you can go with NoSQL databases.

    In short, RDBMS databases are useful for running applications that are critical to the business, NoSQL databases are useful for running applications that complement your business.