MongoDB no Azure

1

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 #.

    
asked by anonymous 14.11.2017 / 18:26

1 answer

1

The case Customer, Product and Order are not documents, much less databases they are collections, the form you are doing is right (If you are actually creating them as collections) the only problem in your modeling is to follow the structure relational that actually only leaves MongoDB slow ...

There was really a problem with your invoice and they should not have charged you for several bases since you probably had 1 base and 3 collections. If there are any creation questions and you still have the Base Creation Script, use the following commands to confirm what I said:

show dbs //Mostra todas bases
show collections // Mostra as coleções

Important : MongoDB when installed already creates 2 databases called Admin and Local, you could be paying for them in addition to yours.

    
30.11.2017 / 14:10