5

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

1
  • 2
    Once you understand the difference between SQL and NoSQL databases and their props and cons, You can use MySQL or MongoDB or Both. People usually use what works best for them and not what other big companies are using. Commented Feb 11, 2017 at 4:06

1 Answer 1

8

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.