bmvr
bmvr

Reputation: 876

NoSQL Databases for clients and transaction management

I pretend to build a intranet portal using nodejs+express+angular, however I would like to know if MongoDB would be a good choice for the database.

Would it be easy to relate, for example, the client ID in the hour record with the client itself?

Or should I used a SQL db such as MySQL?

I need facts based on Performance, scalability etc.

What will happen when my NoSQL DB goes bigger? Will it lose performance?

Upvotes: 0

Views: 445

Answers (1)

dsharew
dsharew

Reputation: 10665

My Experience: I have been using MongoDB & Mysql for the past 2 years 5 months.

Everything I write here is going to be from my personal view and experience.

These days MongoDB (NoSQL in general) is a buzz word everybody talks about mongoDB, couchDB, MEAN stack etc ... that why we started it and here is what happened:
we found a project that was perfect for mongodb:

  1. We had very large user base

  2. There was a lot inter dependencies between our entity objects i.e Entity A cant live without Entity B so we decided to embed the dependent entities.

Still we are using MongoDB for the same project but our database design is very different than our initial database design( which were designed following the mongodb principles):

  1. Our app become very slow because sometimes we want to get data from more than one collection and mongodb does ot allow us ( now it is supported from version >= 3.2). Hence we to do the join on our service layer pro grammatically.
  2. Loading database entities become very heavy due to the embeded documents so we have to move all embeded documents into separate collections. Hence our database design is now very flat(i.e looks like relational database design).

  3. We found a lot orphaned data in our database; initially we thought we can implement our data integrity on our repo/service layer but it is obvious our implementation was not perfect and sometimes we directly run mongo queries on the database console so we were actually messing up our data while mongodb kept silent laughing at us :)

  4. After we finished most of our app's functionality we focused on writing reports and doing analysis on our data we found out our mongodb queries become very huge and unmanageable; which we believed using relational databases like mysql could have eased this.

Bottom line when I started using MongoDB I was very fascinated about it but not afer I know how to use it:

  1. It does not complain about data integrity violation. In fact you could insert Car instance into Employee collection if you want :D
  2. It is very easy to learn specially if you have good javascript background; you dont have to learn database languages like SQL. All mongo queries are combination of js functions and objects.
  3. You can finish an app in matter of weeks or few months; in fact we finished our app in 3 months(very complex app).

But now we got a similar project and we choose Mysql instead of Mongodb; we could have replicated the old project and finish it in few weeks but we learned our lesson. If you really care about your app ( ie. your data) go for Mysql(any relational database).

We are only using MongoDB for old projects and Kibana(because it is for logging and we dont care much about our log data)

Who said Mysql does not scale? Facebook is using 1,800 mysql servers!

Upvotes: 2

Related Questions