Skip to content

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

  1. Open your project in the dashboard
  2. Click Add Service → Database
  3. Select MariaDB
  4. 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 mysql2
import 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:

ParameterValueDescription
innodb_buffer_pool_size70% of RAMInnoDB cache for table and index data
innodb_log_file_size10% of RAMTransaction log file size
max_connections1/50 of RAMMaximum 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:

PlanFrequencyRetention
StarterDaily7 days
ProEvery 6 hours30 days
BusinessHourly90 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?