How Backup pricing works in Cloud Manager
Many customers have asked us how we charge for MongoDB Cloud Manager backup. Your first 1GB per replica set is always free. After that, we charge:
- $2.50 per GB per month
- or $30 per GB per year (for prepaid customers)
How do we calculate your data size (that is being backed up)? Total data size is calculated as the sum of dataSize plus indexSize. If you go into each database and check these values from the db.stats() function you can get the total dataset size. Here is a handy script you can run from the mongo shell that automates this calculation for each of your databases:
var dbNames = [];
var sum = 0;
var dblist = db.getMongo().getDBs();
for (var key in dblist) {
 if(key === "databases") {
 for (var i = 0; i < dblist.databases.length; i++){
 if (dblist.databases[i].name !== "local") {
 dbNames.push(dblist.databases[i].name);
 }
 }
 }
} 
function formatSizeUnits(bytes){
 if (bytes>=1000000000) {bytes=(bytes/1000000000).toFixed(2)+' GB';}
 else if (bytes>=1000000) {bytes=(bytes/1000000).toFixed(2)+' MB';}
 else if (bytes>=1000) {bytes=(bytes/1000).toFixed(2)+' KB';}
 else if (bytes>1) {bytes=bytes+' bytes';}
 else {bytes='0 byte';}
 return bytes;
}
for (var i = 0; i < dbNames.length; i++) {
 var indexSize = db.getMongo().getDB(dbNames[i]).stats().indexSize;
 var dataSize = db.getMongo().getDB(dbNames[i]).stats().dataSize;
 var total = indexSize + dataSize;
 sum += total;
 print("db name: " + dbNames[i] + " | indexSize: " + formatSizeUnits(indexSize) + " | dataSize: " + formatSizeUnits(dataSize) + " | total: " + formatSizeUnits(total));
}
print("total size of all dbs: " + formatSizeUnits(sum));
You can also find the script at this Gist.
Here is some sample output of that script:
$ mongo getTotalSizeofDatabases.js
MongoDB shell version: 3.0.1
connecting to: customerDB:
db name: course | indexSize: 1.41 MB | dataSize: 2.40 MB | total: 3.81 MB
db name: course2 | indexSize: 8.18 KB | dataSize: 448 bytes | total: 8.62 KB
db name: test | indexSize: 829.97 MB | dataSize: 1.23 GB | total: 2.06 GB
total size of all dbs: 2.06 GB

Note that we don’t include the local database here. This is because Cloud Manager Backup does not backup this database, and therefore you will not be charged for its size.
Also, please note that if you are still running Cloud Manager Classic, our old pricing with oplog processing and data size still applies. Check your Billing/Subscriptions page under Administration for an estimate on how the new Cloud Manager pricing can work for you – many customers will save money under the new pricing.