# Gradual database migration: PostgreSQL to MariaDB without downtime

A gradual database migration moves tables one at a time while applications keep working. With Otterstax, services connect to one endpoint, Otterstax keeps the old and new databases in sync with CDC, and each table switches over without code changes or a long maintenance window.

## Gradual database migration

**Situation:** A fintech company with 80–100 TB on PostgreSQL estimated its database upgrade at 2 years (8 quarters).

**With Otterstax:** Services switched to Otterstax without code changes. Tables moved to MariaDB one by one, about 2–4 weeks each, with Otterstax keeping both databases in sync. The team rewrote queries for MariaDB on its own schedule.

**Result:** 1 year — instead of the estimated 2

**Customer:**

- **Fintech company:** Database upgrade estimated at 2 years (8 quarters) → PostgreSQL → MariaDB table by table, apps unchanged. 1 year instead of 2.

## Migration demo

Migration demo: the orders table moves from PostgreSQL to MariaDB while the app keeps the same Otterstax connection string.

1. Query
2. Move orders to MariaDB
3. Same query again

DATABASE_URL: `mysql://app@otterstax:8816`

```sql
SELECT u.country, COUNT(o.id) AS orders, SUM(o.total) AS revenue
FROM orders o
JOIN users u ON u.id = o.user_id
GROUP BY u.country
ORDER BY revenue DESC;
```

| country | orders | revenue |
| --- | --- | --- |
| US | 1,284 | 184,920.40 |
| DE | 702 | 96,311.75 |
| GB | 518 | 71,048.10 |
| FR | 391 | 52,776.00 |
| NL | 233 | 31,502.65 |

catalog updated: orders → mariadb_prod. application config: no changes.

The query and the connection string stayed the same. Your app never noticed.

## Your data lives in multiple data sources. Your code holds them together.

Nobody plans a multi-source stack — it just grows. And every new feature pays for it.

### Migrations that take quarters.

Moving a table from PostgreSQL to MariaDB or ClickHouse means changing every service that touches it. Teams postpone the migration, and the old database keeps growing. In one fintech case the upgrade was estimated at 2 years (8 quarters).

**What teams told us before switching to Otterstax:**

- 2+ years to migrate a database

## Before / After

**Before:**

- 3 database drivers in every service
- nightly ETL jobs
- sync scripts between data sources
- analytics on data that is hours old
- migration = rewrite every service

**After • with Otterstax:**

- 1 connection string
- queries run in place
- writes go to the right database
- fresh data in seconds
- migrate table by table

## Less infrastructure. Faster delivery. No lock-in.

**−23%** migration TCO · **20%** faster time-to-market. After a PostgreSQL → MariaDB migration run through Otterstax. Fintech, 80–100 TB. Effect of the whole migration, including MariaDB itself. Source: [mariadb.org](https://mariadb.org/from-postgresql-12-to-mariadb-11-a-gradual-fintech-migration-with-23-lower-tco/)

### Incremental

Adopt it one service at a time. Check the results first, then retire the pipelines and subscriptions you no longer need.

## Enterprise capabilities

### CDC with guarantees (Enterprise)

Change data capture and dual writes with delivery guarantees, running in a cluster. Open source has CDC without guarantees.

## Start free. Pay when you need scale, custom features and support.

| Capability | Open Source (Free • Apache 2.0) | Enterprise (Self-hosted • SLA) |
| --- | --- | --- |
| CDC and dual writes | No guarantees | With guarantees, in a cluster |

[Compare open source and Enterprise →](https://otterstax.com/pricing)

## Otterstax vs Trino vs Spice.ai

Why teams pick Otterstax

|  | Otterstax | Trino | Spice.ai |
| --- | --- | --- | --- |
| CDC, dual writes and gradual migration | ✓ | — | CDC for acceleration only |

Based on public documentation of each product, September 2026.

## Try it on your stack for 2 weeks.

1. We map your data sources and pick one use case.
2. We run Otterstax next to your current setup, and nothing is switched off.
3. We check agreed success criteria together.

[Start a pilot](https://otterstax.com/demo)

## Four ways to migrate a database

Big bang, replica and cutover, dual writes in the application, or table by table through a federated query engine: downtime, rollback and app changes compared.

[Database migration strategies: zero downtime, table by table →](https://otterstax.com/guides/zero-downtime-database-migration)

## Frequently asked questions

### How long does a typical rollout take?

Migrations go table by table, about 2–4 weeks per table, without a long maintenance window. In the MariaDB case, an upgrade estimated at 2 years took one year.

### Does Otterstax copy my data?

No. Otterstax doesn't store your data: queries run where the data lives, and only the rows a query needs pass through. You can turn on caching for heavy analytical queries. During a migration, data moves straight from the old database to the new one, and Otterstax keeps them in sync with CDC until you switch over.

### Do I need to change my application code?

No. Your app connects with its existing MariaDB / MySQL or PostgreSQL driver or ORM. You only change the connection string. Otterstax translates part of the SQL for the target database and passes database-specific SQL through as is.

### Is it production-ready?

Yes. The largest public case is a fintech company with 80–100 TB on MariaDB, about 1 million queries a day and up to 10 million during promotions. Some deployments are larger.

## Use cases: cross-database joins, analytics without ETL, ML in SQL, database migration

- [One app, many data sources](https://otterstax.com/use-cases/cross-database-joins) — +36.4% daily clients

- [Analytics without ETL](https://otterstax.com/use-cases/analytics-without-etl) — 3 h → real time data latency in dashboards and A/B tests

- [ML in SQL: real-time fraud detection](https://otterstax.com/use-cases/ml-in-sql) — −36.8% fraud

## See Otterstax on your own data sources

In a 30-minute call we'll map your stack and show a working query across your data sources.

[Talk about a pilot](https://otterstax.com/demo) · [Start with open source](https://github.com/otterstax/otterstax/tree/main/examples/quick_start)

---

Source: https://otterstax.com/use-cases/database-migration · Otterstax · info@otterstax.com
