MariaDB
Stackpad provides managed MariaDB databases as project services. MariaDB is a MySQL-compatible relational database that works with any MySQL client or ORM.
Creating a MariaDB service
- Open your project in the dashboard
- Click Add Service → Database
- Select MariaDB
- Click Create
Stackpad provisions a MariaDB instance with:
- Auto-generated credentials encrypted with AES-256-GCM
- Persistent storage that survives container restarts
- Private network access at
mariadb:3306
Connecting from your application
Stackpad injects the MYSQL_URL environment variable into your web services:
mysql://stackpad_user:auto_generated_pass@mariadb:3306/stackpad_db// Using mysql2import mysql from 'mysql2/promise';
const connection = await mysql.createConnection(process.env.MYSQL_URL!);Performance tuning
MariaDB services start with optimized configuration based on their allocated RAM:
| Parameter | Value | Description |
|---|---|---|
innodb_buffer_pool_size | 70% of RAM | InnoDB cache for table and index data |
innodb_log_file_size | 10% of RAM | Transaction log file size |
max_connections | 1/50 of RAM | Maximum concurrent connections |
Override individual parameters from the service Settings tab if needed.
Version management
Change the MariaDB version from the service settings:
- Available versions: MariaDB 10, 11
- Pick the version, save, and the service restarts with the new image
Backups
MariaDB databases are backed up using mysqldump with the same schedule as PostgreSQL:
| Plan | Frequency | Retention |
|---|---|---|
| Starter | Daily | 7 days |
| Pro | Every 6 hours | 30 days |
| Business | Hourly | 90 days |
Browse and download backups from the Backups tab on the service page.
When to choose MariaDB
Choose MariaDB over PostgreSQL when:
- Your application or ORM requires MySQL compatibility
- You’re migrating from an existing MySQL/MariaDB setup
- Your team has more experience with MySQL
For new projects, we generally recommend PostgreSQL for its advanced features, JSON support, and broader ecosystem.
What’s next?
- PostgreSQL — the alternative database option
- Connecting services — how private networking works
- Backups — manage and restore database backups