I heard about Mysql used big companies like Uber, Linkedin. I think NodeJs is best to use Mysql than MongoDB. Am I wrong? Maybe i don't know features about MongoDB
Like you I was in the same dilemma when I started learning NoSQL. Coming from a RDBMS background NoSQL or MongoDB is easier to scale and has a JSON-like syntax that feels home with JavaScript developers. Imagine this structure when you were developing a Todo app:
Todo Database (MySQL):
- Todo (table)
- Id
- Todo Item (table)
- TodoId
- TodoName
With MongoDB you can put everything in one Table or Collection like so:
Todo: {
Id: //some uniq id,
Items: [
0: {
name: 'wash the dishes'
},
1: // and so on
]
}
And later on if you decide to break or add more details you can do so, hence the word "scale"
Todo: {
Id: asdf
}
TodoItem: {
todoId: asdf,
name: 'wash the dishes',
etc: // and so on
}
And best of all if you feel you're app is almost set in stone, you can transfer to MySql or Postgresql which the big companies you mentioned are doing.
This is just an easy example and probably using NoSql over Sql won't be that much of a benefit. But think of this, you are trying to build out a new app with unfamiliar data relationships. Yes, you can build ER Diagrams and normalize it as much as you want and when you start building your app you realized one very important field which might affect the entire relationships of your tables. OR would you rather build fast and get your hands dirty, build messy tables/collections with NoSql and see your app come alive much quicker?
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With