Launch, configure, and operate a fully-managed MariaDB database on Amazon Web Services (AWS RDS or EC2).
Running MariaDB on AWS offloads backups, patching, failover, and hardware scaling to Amazon, letting developers focus on schema design and query performance.
Use aws rds create-db-instance
to provision a managed server, choose instance class, storage, network, and encryption options in one command.
aws rds create-db-instance \
--db-instance-identifier ecommerce-mariadb \
--db-instance-class db.t3.medium \
--engine mariadb \
--allocated-storage 20 \
--master-username admin \
--master-user-password "S3curePass!" \
--backup-retention-period 7 \
--vpc-security-group-ids sg-0123456789abcdef \
--db-subnet-group-name private-subnets \
--multi-az
After the instance becomes available
, copy the endpoint from the RDS console and connect with any MariaDB client: mysql -h ecommerce-mariadb.abc123.us-east-1.rds.amazonaws.com -u admin -p
.
Create familiar ecommerce tables so team members instantly know the data model, then apply constraints and indexes for performance.
CREATE TABLE Customers (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE Orders (
id INT PRIMARY KEY AUTO_INCREMENT,
customer_id INT NOT NULL,
order_date DATE,
total_amount DECIMAL(10,2),
FOREIGN KEY (customer_id) REFERENCES Customers(id)
);
CREATE TABLE Products (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255),
price DECIMAL(10,2),
stock INT
);
CREATE TABLE OrderItems (
id INT PRIMARY KEY AUTO_INCREMENT,
order_id INT,
product_id INT,
quantity INT,
FOREIGN KEY (order_id) REFERENCES Orders(id),
FOREIGN KEY (product_id) REFERENCES Products(id)
);
Dump the on-premise schema with mysqldump --single-transaction
, gzip it, upload to S3, then import from an EC2 jump host or AWS Database Migration Service.
Enable GeneralLog=0
, raise innodb_buffer_pool_size
to 70-80 % of RAM, and configure performance_schema
only for troubleshooting to avoid overhead.
Set --backup-retention-period
at creation or modify the instance later. AWS keeps N days of snapshots and allows point-in-time restores.
Place the RDS instance in private subnets, require TLS (rds.force_ssl=1
), rotate credentials with AWS Secrets Manager, and restrict inbound traffic to trusted CIDRs.
Leaving --publicly-accessible
set to true
exposes the database to the internet. Recreate or modify the instance with private subnets only.
The default group often allows broad access. Create a dedicated group allowing port 3306 only from application subnets or a bastion host.
MariaDB software is open-source, but AWS charges for compute, storage, backups, and data transfer.
Yes. Modify the instance, set --multi-az
to true
, and AWS will create a synchronous standby in another Availability Zone.
You pay for AWS resources; the database engine itself is open-source.
Yes. Modify the instance to move between gp2, gp3, and io1 volumes without downtime when using Multi-AZ.
AWS RDS currently offers MariaDB 10.4 through 10.11; choose the latest LTS for new workloads.