From your MySQL client
Run reports and heavy queries from your MySQL client, on port 3309, without slowing down your MySQL.
Point mysql, a driver or a BI tool at port 3309, and heavy queries come back
from DBTrail's copy of your tables instead of your MySQL. The heaviest of 14
real reports took 7.9 seconds where a MySQL replica took 225
(the numbers). The copy
is seconds behind, like a replica with some lag, so a question about the
last second belongs on your MySQL.
With PostgreSQL servers, the port is 5433 and the client is psql:
From your PostgreSQL client.
1. Turn the port on
In the web interface: Settings → MySQL clients → Turn on. Or, in a script (In production):
curl -s -X PUT -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
http://127.0.0.1:8090/api/flashback -d '{"enabled": true}' | jq -r .passwordEither way you get a password, shown only then. New password in the panel,
or POST /api/flashback/password, replaces it.
2. Connect
The user is your server's name:
mysql -h 127.0.0.1 -P 3309 -u shop -pSELECT status, count(*) FROM orders GROUP BY 1;The answers, without slowing down your MySQL.
The SQL you can send
The client is MySQL's, the copy runs the statement. Most reports run as written:
Backtick names are read as MySQL reads them (0.127.0 or newer).
The order of its list can differ from MySQL’s.
Written for the copy, and DATEDIFF too (0.132.0 or newer). Day and month names come out in English.
Other MySQL-only functions need routing: DBTrail then sends them to your MySQL. Without it, error 1235 says how to write them for the copy.
To keep an application's SQL exactly as it is, turn on routing. Everything that still answers differently: SQL on the copy.
Limits
Small on purpose: a report should not be able to take the machine.
Next: one connection for your application
Turn on routing and your application can use port 3309 in place of its MySQL: light queries run on your MySQL, heavy ones on the copy, and it keeps writing MySQL's SQL. Fast queries on your app's connection.
Upgrade
Move to a new DBTrail version in three steps. Your servers, your password, the copy and its history carry over.
Fast queries on your app's connection
Point your application's reads at port 3309. Heavy queries come back in seconds from DBTrail's copy, lookups are still answered by your MySQL, and you do not change a query.