microsoft / TypeScript-Node-Starter

A reference example for TypeScript and Node with a detailed README describing how to use the two together.
MIT License
11.31k stars 2.77k forks source link

Why using mongodb as default database? #113

Closed nghenglim closed 6 years ago

nghenglim commented 6 years ago

Why not Postgres? Why not Cassandra? Why not Sqlite?

locohost commented 6 years ago

Because those are old tech and everyone uses MongoDb today because its way better. Probably? ;-)

mattwelke commented 6 years ago

I agree that using MongoDB as default database is a bad idea. There are situations where SQL is appropriate and NoSQL is appropriate. Most of the times I use this repo, I'm using SQL on my project, so I have to tear out the Mongo code and replace it.

Database agnostic would be preferable for this.

bowdenk7 commented 6 years ago

Databases, like any technology choice, are largely dependent on the app being developed. For any serious project, you'll have to assess the pros and cons of all the options regardless of what we use here.

I chose MongoDB because (in my opinion) it's the easiest choice for new developers to setup and learn.

If you already know exactly what you want, I'm assuming that like @welkie, you are probably capable of easily replacing the database. If you don't know what you want, I don't want you to have to make a choice and I'm optimizing for getting you going as quickly as possible.

Of course, I would certainly welcome and encourage additional branches that replace the database, docs on the readme that describe the choices and potential benefits/drawbacks, or both :)

mattwelke commented 6 years ago

@bowdenk7 Now that I think of it from that perspective, while it's important to think carefully about choosing NoSQL long term, MongoDB does make a great database for prototyping.

If we're voting, I'll change my vote to keeping it as starter db. ;)