Some time ago I had an unpleasant surprise on my azure invoice because of a MongoDB database that I owned for access to an application.
I created, for example, the documents:
- Client
- Product
- Request
I did all the programming in a relational way (obviously against no-sql standards, but ...) azure gave me an absurd account to pay because I considered each document created as if it were a database. Thus, he charged for individual use of the documents.
I circumvented this situation by using only one document to store customer products and orders. Of course each with a "type" field specifying what it was, to be able to get it later.
My question: I can not believe this is correct, however, I do not think of another way to solve it. Today I have already discontinued the application, so this is simply a question.
What is the best way to model these types in mongodb in this situation? Is a document really created for each type of object? Is an attribute specifying the object type for later use?
Can anyone give a light?
Note: My application was developed with C #.