Move schemas and data from Amazon Redshift to MariaDB with export, transform, and load steps that preserve types, indexes, and referential integrity.
Teams move when they need cheaper analytics, open-source flexibility, or OLTP features. MariaDB’s storage engines and licensing cut costs while widening use cases.
Confirm MariaDB 10.6+ is running, the target schema exists, and the client host has AWS CLI, MariaDB client, and enough disk to stage S3 exports.
Use UNLOAD to write delimited, GZIP-compressed files to an S3 bucket in the same region. Parallel slices speed export and lower cost.
UNLOAD ('SELECT * FROM Orders')
TO 's3://company-exports/orders_'
IAM_ROLE 'arn:aws:iam::123456789012:role/redshift-unload'
FORMAT AS CSV GZIP
ALLOWOVERWRITE;
Download files, then stream them with LOAD DATA LOCAL INFILE. Disable foreign keys until all tables finish.
# Download
aws s3 cp s3://company-exports/orders_ ./exports/ --recursive
# MariaDB shell
SET FOREIGN_KEY_CHECKS=0;
LOAD DATA LOCAL INFILE 'exports/orders_part000.gz'
INTO TABLE Orders
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
(id, customer_id, order_date, total_amount);
SET FOREIGN_KEY_CHECKS=1;
AWS Database Migration Service (DMS) or MariaDB MaxScale handle ongoing replication. AWS Schema Conversion Tool rewrites DDL and resolves type gaps.
Map Redshift BIGINT to MariaDB BIGINT, SUPER to JSON, and TIMESTAMP to DATETIME(6). Always create staging tables first, inspect, then promote.
Run row counts and checksums. A sample comparison query verifies numeric totals match across systems.
-- Redshift
SELECT SUM(total_amount) FROM Orders;
-- MariaDB
SELECT SUM(total_amount) FROM Orders;
Freeze Redshift writes, replicate the delta with DMS, reroute applications, and monitor latency. Roll back by pointing DNS to Redshift if needed.
Add secondary indexes, tune innodb_buffer_pool_size, and enable query cache if reads dominate. Partition large order tables by year for fast pruning.
Galaxy’s AI copilot rewrites Redshift SQL to MariaDB syntax, suggests index hints, and keeps migration scripts organized in shared Collections.
Yes. Use AWS DMS in full-load-and-CDC mode. Perform initial load, wait for CDC to catch up, then cut over during a brief maintenance window.
No. Translate DISTKEYs to partitioning or secondary indexes, and SORTKEYs to compound indexes for similar query acceleration.
Redshift PL/pgSQL differs from MariaDB SQL/PSM. Rewrite procedures manually or use AWS SCT to create stubs and flag unsupported features.