Search code examples
rubydatabasenosqlrelational-databasedatabase-agnostic

Relational vs NoSql: Which database should I use for this kind of app?


I am about to build an application which does analytics on student results. Ghe data that needs to be stored looks like this:

Course: name
Semester: 1st,2nd etc
Student: name
Subject1: marks
Subject2: marks
Subject3: marks
Subject4: marks
Subject5: marks
Subject6: marks

GRAND TOTAL: marks

Subjects would vary according to the semester & course. Ghe main requirements are:

  1. Database should allow creation of various reports like exam-wise report, student-wise report, consolidated report, subject report etc.
  2. It should have library for ruby as that's the language I have decided on.

So, should I choose relational or NoSQL database for this kind of application. If NoSQL, then which one?

Question what is the best suited database for this use-case?


Solution

  • Considering only the requirements you mentioned, I'd go with the simplest approach and use a RDBMS. I can't see any advantage in using NoSQL here because:

    1. The data is well structured
    2. It doesn't sound like a distributed system
    3. NoSQL is not a magic solution for reporting. In fact it's not a solution for reporting :)
    4. Considering your domain, performance should not be an issue
    5. Considering your domain, you do care about ACID

    However RDBMS has everything to get up and running:

    1. Transactions
    2. Low learning curve
    3. Easy to implement basic reporting

    So if the purpose is to get things done fast - I'd do it with RDBMS. If it's just for playing with databases - try implementing it with both technologies and then compare :)