Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql database versus document database?

Small introduction:

  1. I've tried to develop my project with sql database, entity framework, linq. I have table 'Users' and for example i have list of user educations. I ask myself: 'How much educations user can have? 1, 2, 10...' ? And seems at 99% of cases not more than 10. So for such example in sql i need to create referenced table 'Educations'. Right? If i need to display user educations and user i need to join above mentioned tables... But what if user have 10 or even more collections with not more than 10 items in each? I need to create 10 referenced tables in sql? And than join all of them when i need to display? For better performance i've created denormized tables with shape of data that i need to show on ui. And every time when user was updated, i need to update denormilized structure.

  2. Now i redeveloped my project to use document database(MongoDB). And i've created one document for User with all 10 collections inside.

May be i've lost something? But seems document database win here. It's very fast and very easy to support. +1 to document database.

So, what is your opinion about what better to use document database or sql database?

When I should use document database and when sql?

like image 505
Andrew Orsich Avatar asked Oct 14 '22 19:10

Andrew Orsich


1 Answers

This article has suggestions on when to use NoSQL DB's. Also this

like image 120
Aravind Yarram Avatar answered Oct 18 '22 03:10

Aravind Yarram