Documents are not stored in the database, but on filesystem. If you deploy to the mendix cloud, it will automatically be provisioned with a PostgreSQL database and Amazon s3 for file storage. Both are more than sufficient to store your data and files.
If you want to do an on-premises deployment, aka provide your own database and filestorage, PostgreSQL is a better choice than MariaDB. Both a free.