0

We're going to implement the feature, It pushes me to ask myself the benefits and defects in MongoDB. I don't want to create any data model in MongoDB and let client side create it by sending me the json object. It's because the schema might be changed in some cases.

It inspires me the reason why we need to create the data model just like common RDB does.

If the user can know all the schema of data and make sure the data they sent will have the correct format. Is it a better solution to do?

What' the pros and crons of both cases? Any other technical replacement for this cases?

1 Answers1

0

MongoDB is not schema-less -- think of it as "schema flexible" and "schema dynamic", but not schema-less. When you are not too sure as to what you are storing in the database, you pay for this flexibility on the way out; there are also index and performance implications. The other thing to remember is that in order to make it performant, you have to figure out what your most popular queries are going to be and create appropriate indexes -- which implies that you know exactly what kind of data you are going to be storing. There is no free lunch, everything is a tradeoff.

alernerdev
  • 2,014
  • 3
  • 19
  • 35