The amount of disk space required by MongoDB depends entirely on the number of assets in the system. If the number of assets is stable, or if there is a steady influx / deletion rate in the archive so that the number of assets remains at a certain level, the instance will not grow.
Each asset remains approximately 10 days in MongoDB after deletion. Hence, the approximate formula for calculating the number of assets can be expressed as follows:
N = i * (t + 10) + p
p: Number of assets that are permanently in the system
t: Max number of days an asset is kept in the system after ingestion
i: Number of assets ingested per day (24h)
N: Total number of assets in the system at any given time.
Each asset requires approximately 10Kb of space. The formula to calculate the disk space required for assets in MongoDB goes like this:
Disk space (Megabytes) = N * 0,01
(N is the total number of assets, as explained above.)
All indexed files are pushed to MongoDB
When an Index Manager is configured to push data to a FotoWeb server's MongoDB instance, all the indexed content from that Index Manager server is pushed to MongoDB, even if only some of the indexes are used as archives in FotoWeb. For example, there may be a case where FotoWeb hosts only a few archives from the Index Manager server while other indexes are used by FotoStation. In this case, data from all indexes is pushed to the MongoDB server, since Index Manager is considered a "slave" of the FotoWeb server.
MongoDB cleanup routine
MongoDB does not free up disk space when data is deleted. However, already allocated disk space can be reused by new data. There are MongoDB admin commands that can be used to shrink and defragment the database files. However, FotoWeb does not automatically run such commands on MongoDB.
FotoWeb uses the “smallfiles” option of MongoDB to ensure that disk space is allocated in small chunks rather than huge blocks with exponentially increasing sizes. Older versions of FotoWeb did not do this, so older installations may have large MongoDB data files which are mostly unused.
Important: Never delete the database files
MongoDB is NOT a cache - It is a database. Valuable data such as albums, CMS exports and (starting with Feature Release 4) users and groups are stored in MongoDB.
Deleting database files causes loss of data that can only be restored from a backup.
Storing the MongoDB database files in an alternative location
The location of the MongoDB data files is not configurable per se. However, you can create a file system junction point to place the folder elsewhere.
MongoDB requires approximately 1GB of RAM per 100.000 assets. If the system has to start swapping memory to disk, this will have a severely negative impact on performance, and should be avoided.