how can we read / write data from a MariaDB database?
Based on the documentation below it doesn't appear that Adobe Campaign Classic supports MariaDB.
So unless you absolutely have no other choice, I would not recommend using MariaDB as it technically would not be a supported configuration.
You can submit a request to Adobe Campaign Support for an enhancement for this DB platform to be supported in future releases as well.
You can connect to it over FDA. Campaign is no longer supported directly on MariaDB.