Moving an application onto SynergyDB, and back out
This page is for a team deciding whether it can move an existing application onto SynergyDB and return to its original database if needed. It is written from the repository at main @ 8a689c5c (2026-11-30). This is SynergyDB V1.0.
Many facts here come from status entries in docs/status/. Each entry describes one branch on one date, and several say "PR: (pending)" or "see branch". Check that a fix is in the build you test before relying on it.
Before you start: which build
The latest image on Docker Hub was built from 8838377 (2026-10-25) and does not contain the wire work measured in the README. Build from source (cargo build --release --features full), or build the image yourself, to get the measured behaviour (source: README.md, "Run it").
Note that the README's "Compatible databases" section and its status entry describe synergytechllc/synergydb:latest as "the 4510b81 build line" (source: README.md; docs/status/2026-11-30-compatible-databases.md). Both statements cannot describe the same image. Check the image you pull.
The basic path
1. Point the existing driver at the matching wire port
SynergyDB serves the wire protocols applications already use, so the application keeps its driver, ORM and SQL dialect and changes only its connection string (source: README.md, intro). Default ports for the main wires:
| Original database | SynergyDB rating | Default port |
|---|---|---|
| PostgreSQL | Full | 5432 |
| MySQL | Full | 3306 |
| SQL Server | Full | 1433 |
| Oracle | Full | 1521 |
| MongoDB | Full | 27017 |
| Redis | Full | 6379 |
| Cassandra | Full | 9042 |
| Neo4j (Bolt) | Full | 7687 |
| Elasticsearch | Full | 9200 |
| SQLite (libSQL Hrana over HTTP) | Preview | off by default |
| gRPC, HTTP/REST, GraphQL | Preview | 9090, 8080 |
(source: README.md, "Wire scorecard")
Which wires start depends on the config file; with no config file at all every wire starts on its default port, and in a config file a wire whose port key is missing is off (source: README.md, "Run it").
Things that commonly need attention at this step:
- SQL, document, graph and analytical wires authenticate against SynergyDB's catalog. Users come from
CREATE USER ... PASSWORD(source:README.md, "Security defaults"). - MariaDB 11.4 clients require TLS by default. Enable
[tls]on SynergyDB or pass--skip-ssl(source:docs/status/2026-11-30-compatible-databases.md). - A development build generates a self-signed certificate and turns TLS on for every wire unless
SYNERGYDB_TLS_ENABLED=false(source:docs/status/2026-11-30-compat-v2-fixes.md). - If two applications on different wires share one SynergyDB database, same-named tables can collide across wires (source:
docs/status/2026-11-27-multi-day-soak.md). Use separate databases or table names.
2. Load the data with the original database's own tools
These dump-and-load paths into SynergyDB were tested:
| Tool and direction | Result | Source |
|---|---|---|
PostgreSQL 16 pg_dump (plain SQL) to psql into SynergyDB |
Identical data, sequences continue | docs/status/2026-11-24-backup-restore-drill.md |
MySQL 8 mysqldump (FK child before parent, a view, BLOBs) into SynergyDB |
Identical | docs/status/2026-11-24-backup-restore-drill.md |
Real Redis DUMP to SynergyDB RESTORE; MIGRATE from real Redis |
Identical | docs/status/2026-11-24-backup-restore-drill.md |
Fixes made along the way are worth knowing because older builds lack them: COPY FROM STDIN corrupted multi-byte UTF-8 characters split across messages; pg_dump's setval form was ignored, so sequences restarted at 1; mysqldump's /*!NNNNN ... */ executable comments were dropped (source: docs/status/2026-11-24-backup-restore-drill.md).
SERIAL and identity ids after a dump load. A pg_dump load inserts rows with explicit ids and then calls setval. Before 2026-11-30 the column counter stayed at 0, so the application's first INSERT reused id 1 and hit the primary key (Metabase sign-in failed this way). The fix makes an INSERT that omits the id never return a value below the column's sequence. Remaining gaps: an identity column with a custom SEQUENCE NAME is not linked, and the column counter is not transactional (source: docs/status/2026-11-30-serial-default-after-dump.md).
Large COPY loads. The README, on 2026-11-30, lists as an open bug that a very large COPY ... FROM can run out of memory, and says to split large loads into batches until the fix lands (source: README.md, Known gaps). A status entry from the same day, on branch fix/copy-bounded-memory, describes the fix (source: docs/status/2026-11-30-copy-bounded-memory.md):
-
COPY ... FROM STDINcommits every 250,000 rows.SYNERGYDB_COPY_COMMIT_ROWSoverrides this; 0 restores one transaction. - Up to 250,000 rows is still one all-or-nothing transaction.
- If a larger load fails into a table that was empty when it started, the table is truncated. Into a table that already had rows, committed chunks stay and the error says how many rows that is.
- Other sessions can see committed chunks while the COPY runs. PostgreSQL shows none until it commits.
-
pgbench -i -s 700(70M rows) peaked at 3.4 GB RSS and finished in 76 s, where it was previously killed at 13.9 GB. - Still open: a giant
INSERT ... SELECTor a long explicit transaction holds its whole write set in memory until COMMIT.
Not verified: whether the chunked COPY is in your build. If it is not, follow the README and split large loads.
3. Expect application-specific gaps
Real applications are installed against SynergyDB and driven through their own UIs. On the 2026-11-24 browser walk of 17 apps, Django, Odoo, Metabase, Graylog, LibreChat, Mastodon and GitLab passed end to end. WordPress and OpenEMR save data but do not show it back correctly yet, and about eight others do not install yet (source: README.md, "Real applications").
Status entries record what blocked specific apps and what was fixed:
-
MySQL-wire apps (WordPress, MediaWiki, Matomo):
SQL_CALC_FOUND_ROWS, multi-tableDELETE, user-level locks (GET_LOCK), index hints,MATCH ... AGAINSTand severalinformation_schemaviews were added. Still open at that time: MySQL numeric truthiness (WHERE 0),NOW()text with microseconds,CURRENT_TIMESTAMP(6)in a SELECT (source:docs/status/2026-11-24-app-install-gaps.md). -
PostgreSQL-wire apps (Grafana, OpenEMR, Outline, Mastodon, Odoo and others): data-modifying CTEs,
ALTER TYPE ... RENAME,DOblocks, real SQLSTATEs on the extended protocol, and several Prisma and psycopg issues were fixed (source:docs/status/2026-11-24-pg-app-install-blockers.md). Gaps it lists that matter for a migration:-
timestamptzvalues are stored as the text they were written with and compared as text.'10:00+02'reads back as10:00+02, where PostgreSQL returns08:00+00, and an equality test against the normalised form does not match. -
ctidis not a column (Grafana uses it). -
COMMENT ONis accepted but not stored. - Constructs inside a
DOblock that SynergyDB cannot parse or run are logged and accepted, not failed.
-
-
Prisma.
prisma db pushcreates the schema, and a seconddb pushormigrate diffagainst it reports the schema in sync. Check-constraint introspection still returns no rows (source:docs/status/2026-11-24-prisma-db-push-introspection.md). -
One way to find gaps before you migrate. The project extracted every SQL literal from its own suite of apps (1,876 statements), ran
EXPLAINon each against PostgreSQL 16 and SynergyDB, and kept the ones only SynergyDB rejected (source:docs/status/2026-11-29-suite-app-sql-gaps.md).
Read the per-wire Known gaps list in the README before you start. For example: on MongoDB, natural order is key order and change streams are not resumable across a restart; on SQL Server, DATETIMEOFFSET comes back in UTC; on Oracle, the README says packages, triggers and user-defined types are not implemented, but the code now has all three (source: README.md, Known gaps; src/protocol/oracle/plsql.rs, src/protocol/oracle/trigger.rs, src/protocol/oracle/types.rs); test them on your own schema first (see Oracle).
The migration tool synergydb-migrate
The README lists the migration tool as not validated end to end (source: README.md, "Engine features").
The binary is built from src/bin/migrate.rs (source: Cargo.toml). This is what the code does:
Sources
| Connection string | Source type | Build feature needed |
|---|---|---|
postgres:// or postgresql://
|
PostgreSQL | migrate-postgres |
mysql:// or mariadb://
|
MySQL | migrate-mysql |
mongodb:// |
MongoDB | migrate-mongodb |
sqlite://, or a path ending .sqlite or .db
|
SQLite | migrate-sqlite |
path ending .csv
|
CSV | none |
path ending .json
|
JSON | none |
path ending .parquet
|
Parquet | no source implemented; the run stops with an error |
The full feature includes all the migrate-* features. A migrate-couchdb feature also exists, but the CLI has no way to select a CouchDB source (source: src/bin/migrate.rs, Cargo.toml).
Flags
| Flag | Meaning | Default |
|---|---|---|
-s, --source <URL> (or the first positional argument) |
Source connection string | required |
--target <URL> |
Target SynergyDB, as a PostgreSQL-wire URL | none |
-n, --name
|
Migration name | mig_<unix time> |
-t, --tables / -e, --exclude
|
Comma-separated include / exclude lists | all tables |
-b, --batch-size
|
Rows per batch | 10,000 |
-v, --verify
|
none, rowcount or checksum
|
rowcount |
-d, --dry-run
|
Read but do not write | off |
--state-dir |
Where migration state is kept | .synergydb/migrations |
-l, --list / --status <ID>
|
List migrations / print one migration's saved state | |
-r, --resume <ID>
|
Resume a migration | see below |
-V, --verbose
|
Verbose output (note: -v is --verify) |
off |
(source: src/bin/migrate.rs)
Behaviour to know about
-
Without
--target, nothing is written. The run goes through a no-op writer as a dry run, then prints its summary. A binary built withoutmigrate-postgresalso falls back to the no-op writer when given a target (source:src/bin/migrate.rs). -
The only target is the PostgreSQL wire. Data from MySQL, MongoDB or files is written through SynergyDB's PostgreSQL wire (source:
src/bin/migrate.rs). -
--resumedoes not resume. It checks the state file exists, prints progress messages and a note that full resume "requires runtime integration", and stops (source:src/bin/migrate.rs). - Tables are migrated one at a time, indexes are created, and metadata preservation is on (source:
src/bin/migrate.rs). - An unknown
--verifyvalue falls back torowcountwith a warning (source:src/bin/migrate.rs). - The OpenAPI file also documents
POST /api/migrationsto start a migration job over HTTP (source:docs/openapi.yaml).
What has been checked
As of 2026-05-10 the roadmap recorded: SQLite source 6/6 rows; PostgreSQL source in dry run, 2/2 rows read; CSV 3/3 and JSON 3/3 rows migrated and read back through the PG wire. The MySQL source hit a "packet out of order" error against SynergyDB's own MySQL wire, the MongoDB source was not enabled by default, and Parquet was not implemented (source: ROADMAP.md, item 4.47). The 2026-11-24 status baseline lists "Migration tooling end-to-end" under untested major systems (source: STATUS.md).
Not verified: any end-to-end run of synergydb-migrate from a real MySQL, MongoDB or PostgreSQL server into SynergyDB, the checksum verification mode, and the HTTP migrations endpoint. For a real migration, use the source database's own dump tools (step 2 above).
deploy/suite-cluster/migrate-db.sh
This script moves one PostgreSQL database used by the project's own suite of applications from a PostgreSQL container onto a SynergyDB cluster reached through a router, and repoints the application services that use it. Its paths and service names are specific to that deployment, so read it as a worked example, not a general tool (source: deploy/suite-cluster/migrate-db.sh).
What it does, in order:
- Finds the compose services whose connection URL names the database.
- Always writes a restorable
pg_dump -Fcbackup of the source. - Dumps the source as plain SQL with no owners or privileges, drops and recreates the database on SynergyDB, and loads it with
psql. Load errors are counted from the log. - Compares row counts table by table between source and SynergyDB.
- Without
CUTOVER=1, stops here (dry run). - With
CUTOVER=1, stops the running services first, then copies, and refuses to cut over if there was any load error or any row-count mismatch. In that case it restarts the services on the original PostgreSQL. - On success, backs up each compose file, rewrites the database URLs to point at SynergyDB, and recreates the services. If recreation fails, it restores the compose files and the old containers.
(source: deploy/suite-cluster/migrate-db.sh)
Its rollback for one database is to restore the compose files from the backups it wrote and recreate the services. The original PostgreSQL is never written to or dropped by the script (source: deploy/suite-cluster/migrate-db.sh).
Limits visible in the script:
- Verification is row counts only, not row contents.
- It drops any existing database of the same name on SynergyDB before loading.
- Services configured through other keys than a connection URL are not found; the script names one such service that must be moved by hand.
- It passes the SynergyDB superuser password to a client container as an environment variable on the command line.
- There is no reverse step: writes made on SynergyDB after cutover are not copied back.
(source: deploy/suite-cluster/migrate-db.sh)
Rollback: getting data back to the original database
Keep the original running
The safest rollback is the one migrate-db.sh uses: leave the original database untouched and switch the application back by configuration (source: deploy/suite-cluster/migrate-db.sh). Anything written to SynergyDB after cutover then has to be exported, because no tool in the snapshot replicates changes from SynergyDB back to another database.
Not verified: continuous replication or change capture from SynergyDB to the original database. No such tool or test appears in the snapshot. Dual-running means the application (or you) writes to both.
Dump tools out of SynergyDB
| Wire | Tool and direction | Result | Source |
|---|---|---|---|
| PostgreSQL | PG 16 pg_dump (plain, -Fc, -Fd -j 2) and pg_dumpall from SynergyDB, restored into real PostgreSQL 16 |
Runs to completion, 0 restore errors, rows identical, sequences continue | docs/status/2026-11-24-pg-dump-from-synergydb.md |
PostgreSQL, non-public schemas |
pg_dump -Fc to real PG 16 pg_restore
|
0 errors, rows identical | docs/status/2026-11-24-pg-dump-schemas.md |
| MySQL |
mysqldump from SynergyDB into real MySQL 8 |
Identical | docs/status/2026-11-24-backup-restore-drill.md |
| MariaDB |
mariadb-dump 11.4 from SynergyDB into MariaDB 11.4 |
Passes on a branch dated 2026-11-30 (rows and a view); against the published image it wrote no rows |
docs/status/2026-11-30-compat-v2-fixes.md, docs/status/2026-11-30-compatible-databases.md
|
| Redis |
redis-cli --rdb from SynergyDB into real Redis 7 |
Identical | docs/status/2026-11-24-backup-restore-drill.md |
What pg_dump from SynergyDB does not carry yet: functions, triggers, domain, composite and range types, comments, grants, and role passwords (pg_dumpall creates roles without them). Partial, expression and DESC indexes are written as plain column indexes. Indexes created USING hnsw or ivfflat need pgvector on the target. pg_dumpall includes internal tables that other wires keep in the postgres database. The server reports version 15.0 (source: docs/status/2026-11-24-pg-dump-from-synergydb.md). Recreate the missing objects on the target from your own schema source.
The README states that mariadb-dump round-trips into MariaDB (source: README.md, "Compatible databases"). The 2026-11-30 compatible-databases entry found that against the published image mariadb-dump exported tables with no rows, and the compat-v2 entry fixed it on a branch the same day. Check your build.
Not verified:
-
MongoDB: the backup drill lists
mongodump/mongorestoreas identical but does not say whether the restore target was real MongoDB or SynergyDB (source:docs/status/2026-11-24-backup-restore-drill.md). Testmongodumpfrom SynergyDB into real MongoDB yourself. - Every other wire (SQL Server, Oracle, Cassandra, Neo4j, Elasticsearch, ClickHouse, Kafka and the rest): no file in the snapshot tests exporting from SynergyDB into the original product.
SynergyDB's own backups
SynergyDB has synergydb backup, restore and backup-verify subcommands (source: src/main.rs). The 2026-11-24 drill proved, on data written through seven wires: offline backup, verify and restore byte-identical; online backup during writes with a 78 ms writer stall; point-in-time restore over a full plus two incremental backups; and refusal of a backup or restore torn by kill -9. Restore goes into an empty data directory with the server stopped; the HTTP restore endpoint answers 501 with the CLI command, because a running server cannot swap its files (source: docs/status/2026-11-24-backup-restore-drill.md).
The README still lists "restore from backup as a live operation" as not validated end to end (source: README.md, "Engine features"). The PITR runbook in deploy/pitr/RESTORE.md (disk snapshot plus WAL shipped every minute by default) tells operators to run the drill and measure recovery point and recovery time before promising either (source: deploy/pitr/RESTORE.md).
These backups restore into SynergyDB. They are not a way back to the original database.
Suggested pilot plan
This section is a recommendation, not a tested procedure. It combines steps the repository provides into an order that limits risk. Nothing in the snapshot shows this sequence being run as a whole.
-
Pick one wire rated Full in the README scorecard, the one your application uses (source:
README.md, "Wire scorecard"). Start with one application and one wire. -
Build the measured code. Build from source at a known commit rather than using the published
latestimage (source:README.md, "Run it"). -
Run the proof pack for that wire.
make prove ARGS='--wires <wire>'starts the real database in Docker next to a fresh SynergyDB and runs the same-connection, second-connection andkill -9restart suites, then writesprove/out/latest/report.html(source:README.md, "Reproduce the proofs";prove/README.md). It covers the 17 wires listed inprove/README.md; Snowflake, Prometheus, Arrow Flight, SQLite and gRPC are not in that list. -
Read the Known gaps entry for that wire in the README, and the newest
docs/status/entries that name it. Note every gap your application might touch, and every fix that is still on a branch (source:README.md, Known gaps). -
Check your SQL before running it. For SQL wires, collect the statements your application sends and run
EXPLAINon each against both the original database and SynergyDB, as the project did for its own apps (source:docs/status/2026-11-29-suite-app-sql-gaps.md). - Run your application's own test suite against SynergyDB. Point the test configuration at the SynergyDB port and compare failures with a run against the original database.
-
Load a copy of production data with the original database's dump tools (step 2 of the basic path) and compare row counts and, for key tables, row contents.
migrate-db.shcompares counts only. -
Dual-run. Keep the original database as the system of record. Send reads, or mirrored writes, to SynergyDB and compare results. Include a
kill -9of SynergyDB during the run and check that acknowledged writes are still there. - Rehearse the way back. Export from SynergyDB with the tested tool for your wire (see the rollback table) into a fresh instance of the original database, and recreate the objects the dump does not carry. If your wire has no tested export path, treat rollback as unproven.
- Decide. Move only if the steps above pass and every open gap that affects you has a fix in the build you will run.