Mongodb in Azure

Asked

Viewed 94 times

1

A while ago I had an unpleasant surprise on my Azure invoice on account 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 the no-sql standards, but...) in the end Azure gave me an absurd bill to pay because it considered each document created as a database. Thus, charged for individual use of documents.

I bypassed that situation, using only one document to store customers products and orders. Of course each with a "type" field specifying what it was, so you can get it later.

My question: I can’t believe this is correct, but I can’t think of any other way to resolve 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? Do you actually create a document for each type of object? An attribute is created specifying the type of the object for further use?

Someone can give a light?

Note: My application was developed with c#.

  • I use the mongodb atlas, inside you get a free plan for the bank, however this option is only available for AWS.

  • I understand. But in reality, this is not the issue. It’s more a case of modeling and experience as well

  • Unfortunately, I no longer have the sources. But I can give an example here, where would have a table products, a customers and a budgets. Why should I model a document for each correct? If not, in this context of AZURE, how would we do?

  • 1

    This is nonsense, database is one thing, document is another. In the relational world the document would be the row of a table, so there is no reason for you to be charged as each document represents a database. Unless Azure is charging you for the n° requisitions and not for the bank itself. In this case, you could then have a high account if you have many requests.

1 answer

1


The Customer, Product and Order case are not documents, much less databases they are collections, the way you’re doing it is right (if you’re actually creating them as collections) the only problem in your modeling is following the relational structure that actually only makes Mongodb slow...

There was actually a problem with your invoice and they shouldn’t have charged you for various bases since you probably had 1 base and 3 collections. If you have any questions about creation and you still have the Database 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 your.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.