Sql database versus document database?
Small introduction:
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 col开发者_Python百科lections 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.
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?
This article has suggestions on when to use NoSQL DB's. Also this
精彩评论