Search code examples
mongodbazureazure-marketplace

Specifying storage for mongoDB server in fresh install on Azure


I'm planning to install MongoDB server 4.4 on a Ubuntu Linux vm on Azure. In the marketplace I see images already available. Why are these chargeable hourly? It's the community edition which is free, so I cannot understand the charge

enter image description here

Secondly, I plan on adding a 10TB data disk for storing the ever increasing data. But if I use preinstalled image then I suppose mongoDB server will get installed on the OS disk(128GB) whereas I would prefer it used the data disk(10TB).

Does it make sense to then use the preinstalled image? I found a mongodb setting at https://docs.mongodb.com/manual/reference/configuration-options/#mongodb-setting-storage.dbPath to specify storage path. Both the OS disk and data disk will be premium SSD. Will it make a difference if the software is installed on OS disk and collections/databases get stored in data disk?


Solution

  • The reason why you see pricing is because it's neither added by Canonical nor MongoDB publishers. The golden image you shared is being offered by Cloud Infrastructure Services. They not only offer MongoDB CE images but also packer, docker compose etc., built on top of Opensource OS.

    As you say both OS & Data disks will be provisioned using Premium SSDs. I wouldn't worry much about performance.

    To cut down costs, I would propose below things.

    1. Create MongoDB image yourself by picking free version of Ubuntu/Centos or whatever. You can use packer or Azure Image Builder. I would setup automation to periodically build images with different versions of Mongo & Linux flavor & version them
    2. Provision VM, install MongoDB app on top of the VM & regularly patch, upgrade both linux & application packages
    3. If you have MongoDB server on-prem, you could create a snapshot of OS with MongoDB application packaged in it, convert it into vhd file & export the image onto Azure. You can follow documentation here
    4. If MongoDB offers golden images as private offers & you have existing license contract with them. Check out with MongoDB, register your subscription & you may be eligible to access their golden images on Azure appearing as "Private Offers". RedHat offers it's images to customers this way.

    The image being offered on Azure doesn't make much financial sense. Let's assume you have 3 node cluster.

    Pricing for using image is :: 0.025 euros per hour

    per day it would be :: 24*0.025 = 0.6 euros

    yearly cost could be :: 365*0.6 = 219 euros

    combined cost for 3 nodes :: 219*3 = 657 euros

    If you have multiple environments, multiple databases in different regions, cost just gets multiplied on & on.

    Now, the choice is yours!