Skip to main content

MySQL to Snowflake migration and validation

Moving MySQL reporting data into Snowflake can support analytics across multiple application databases. The useful acceptance question is whether customers, orders and events still describe the same business facts after extraction, conversion and incremental loading.

Investigate a multi-shop reporting incident​

Consider a commerce company combining several MySQL shops in Snowflake. Each shop issues its own auto-increment order IDs. The new revenue dashboard shows plausible totals, but support finds missing refunds and marketing sees customers under the wrong shop. Meanwhile, the analytical refresh competes with morning application traffic.

Start with two shops and one closed sales day, plus later refunds for those orders. Define (shop_id, order_id) as the business identity and map refund records separately. If the chosen comparison path needs a single mapped key, use a reviewed, unambiguous representation; delimiter collisions and null concatenation must not merge distinct orders. Align the extraction boundary across orders, customers and refunds and record the corresponding completed target load.

Incident signalFocused experimentEvidence required for acceptance
Orders from different shops replace each otherTest overlapping IDs, high unsigned values and the mapped composite identityUnique, non-null keys in both scopes; no overflow, rounding or shop collision
Orders move between reporting daysCompare TIMESTAMP and DATETIME using documented session timezone and business-day rulesEquivalent instants or wall-clock values, including midnight cases
Refund status becomes true/false incorrectlyInspect the full domain of integer flags and enum/status values before conversionApproved mapping for every actual value, including unknown or legacy states
Names or optional attributes changeReview accented text, trailing spaces, JSON paths, absent properties and null/empty distinctionsPreserved business meaning and expected matching/join behavior
Old orders never receive correctionsCompare later refunds, changed statuses, deletions and retried deliveriesComplete incremental application without duplicate current records

MySQL's temporal type reference describes timezone conversion for TIMESTAMP and the different behavior of DATETIME. Do not infer that identically displayed strings represent the same instant. For legacy invalid dates, agree whether the pipeline rejects, quarantines or deliberately replaces them; preserve enough evidence to distinguish an approved replacement from accidental data loss.

Keep source identity and change history explicit​

For an illustrative commerce dataset, map shop.orders to ANALYTICS.SHOP.ORDERS and retain the source order_id. If multiple shops use overlapping IDs, define a composite business identity or a stable, unambiguous mapped key before comparison. Do not concatenate values without specifying delimiters, escaping and null handling.

Capture the extraction boundary and completed target load. Include changes to older orders and deletions; checking only new auto-increment IDs misses both. Rehearse duplicate deliveries and retried loads to verify that the pipeline does not create a second current record.

Test the awkward values first​

Source concernAcceptance test
Unsigned integer keysInclude high-range values and confirm the chosen target representation preserves identity without overflow or rounding.
Boolean-like columnsCheck the actual domain and application meaning before converting integer values into true/false.
TIMESTAMP and DATETIMERecord connection timezone and intended meaning; compare instants or wall-clock values consistently.
Legacy or invalid datesIdentify actual source values and define reject, quarantine, or approved replacement behavior before loading.
Text and collationInclude accented text, mixed case, trailing spaces and the character sets present in the source.
JSON and nullable fieldsDefine whether absent properties, JSON null, SQL null and empty text must remain distinct.

Consult MySQL's date and time type reference and the Snowflake type-conversion rules while writing the mapping. Test the actual connector and migration-tool settings rather than accepting a generic type-name mapping.

Run a scoped validation​

Use the data-source connection workflow to add MySQL and the Snowflake comparison workflow. The shipped connector types are SmartDiff-enabled; this guide does not claim a live MySQL-to-Snowflake benchmark.

Prepare aligned source and target snapshots for Data Source Diff and explicitly map the keys and columns. For filtered or transformed data, use Query Diff with paired predicates and a documented business grain. Follow the common scope and precision boundaries: exact decimal acceptance needs independent checks, and large comparisons need planned scope rather than reliance on a batch-size ceiling.

Beyond row differences, reconcile order value by currency and status, customers with multiple orders, canceled orders, and late refunds. Keep each exception tied to its source key and business impact. A count that matches can still hide one missing and one duplicated order.

Follow one synthetic cohort through SmartDiff​

Suppose the approved union contains 8,000 distinct shop/order keys. An invented first run finds 7,760 matching rows, 170 shared keys with changed values, 50 source-only orders and 20 target-only orders. There are 7,980 source rows and 7,950 target rows. The total is 240 differing rows. These numbers illustrate review arithmetic only; they are not observed migration results or a DataDios benchmark.

Review the overall counts, then choose the affected table or query pair. The source-only examples direct the investigation toward omitted records; target-only examples may reflect retry duplication or an incorrectly scoped target. They do not automatically prove either cause. Check each disputed key against the load boundary before repairing data.

SmartDiff groups rows by combinations of difference labels and highlights changed cell text. Switch between inline and side-by-side views to inspect shop_id, order status and projected attributes together. Use Diff by column to focus on a suspected transformation and Only diffs to reduce matching detail. A rounding-related label is not permission to ignore a changed identifier or financial value.

Use the Summary tab's source/target value frequencies to look for a status becoming unexpectedly common. A rise in null shipping regions can identify a projection problem affecting many orders. Review Metadata alongside the mapping, especially when source integer flags became a target boolean. These summaries are calculated evidence, not an AI-generated causal diagnosis. Label, column and missing-row breakdowns overlap: do not sum them to recreate total differences.

Export the selected table's available CSV/PDF evidence with filters and load identifiers attached. The standard result store can retain only up to 1,000 sample rows per cluster, although counts describe the compared population. Keep full native reconciliation outputs for complete exception processing and exact decimal acceptance. The investigation and performance guide provides the common review method.

Compare application pressure and warehouse performance​

Collect a baseline before offloading the reports. Enable supported workload analysis for both connections, inspect prerequisites and verify extraction freshness. In Performance Analyzer, investigate MySQL query and I/O activity around the refresh window. Distinguish a frequently called lightweight statement from an expensive report, and record application demand so a quiet period does not masquerade as an improvement.

MySQL Performance Schema statement summaries aggregate events, including counts and timing statistics. Collection snapshots of these counters are not individual execution traces. DataDios charts summarize collected snapshots; they do not automatically turn every cumulative counter into an interval delta. For a separate native-counter investigation, compute valid deltas only after checking reset boundaries and instrumentation. In particular, the collected maximum-time chart aggregates snapshot maxima, not individual request durations. Do not call a snapshot-derived average or maximum “p95”; measure request or report percentiles using suitable execution-level observations outside that inference.

On Snowflake, isolate queue/provisioning delay from query execution, then examine scan and spill evidence where offered. If a daily report scans most of the order history, inspect whether converted predicates still express the intended selective scope. If execution waits behind other workloads, investigate scheduling and warehouse contention before changing SQL. Use native Snowflake query investigation for details beyond the collected product metrics.

Run equivalent report parameters repeatedly with recorded warehouse size, concurrent load and cache conditions. Validate freshness at the same time: an instantly returned report based on yesterday's load does not meet a five-minute business requirement. After switching analytics, check whether MySQL application pressure actually fell under comparable demand. Include extraction, warehouse execution, validation and parallel-operation costs when deciding whether offload delivered value.

Example acceptance report and repair cycle​

GateExample evidence and release decision
Identity and completenessHold the initial synthetic run until all 50 source-only and 20 target-only keys are reconciled
Business valuesResolve the 170 changed rows; attach exact totals by shop, currency and status plus refund reconciliation
Incremental behaviorDemonstrate an older-order correction, a deletion and a retried delivery without duplicated current state
Performance and freshnessAttach repeatable report measurements, MySQL counter context, Snowflake investigation and observed load delay

Repair the identified mapping or pipeline defect, then rerun the same cohort before widening coverage. Do not hide an unreviewed mismatch by excluding a troublesome column. Record any approved normalization in the contract and preserve a raw-value check where identity or money is involved.

A smaller team can begin with one shop and a report whose owner understands refunds. A larger enterprise should retain separate source-system boundaries and accountable owners even when dashboards aggregate all shops. Expand only after the pilot demonstrates both complete business facts and a workable operating cycle.

Roll out by business dependency​

Start with a closed reporting period and a report whose owner can explain discrepancies. Then validate an active period containing updates, deletes and retries. Switch dependent analytics only after the complete agreed scope passes or exceptions have named owners.

Review your MySQL to Snowflake plan