Skip to content

make Migration Overview MOLT-centric #19532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

taroface
Copy link
Contributor

@taroface taroface commented Apr 17, 2025

DOC-12110
DOC-12134
DOC-12697
DOC-12951

  • Migration Overview now centers on MOLT tooling/flows
    • Removed nav link to MOLT Overview since it's superseded by the Migration Overview
  • Most existing Migration Overview content is now a standalone Migration Strategy doc. This doc may evolve into a planned MOLT Best Practices doc (separate ticket), or it may remain standalone and link to that upcoming doc
  • Added a new diagram for migration flow using MOLT
  • Moved Migration Overview, Migration Strategy, and MOLT tutorial docs to molt subdirectory, as this is easier to maintain & ties the docs to MOLT tooling, which is already there (link changes are the bulk of the files changed)
    • Removed the versioned pages for the above
  • Updated the featured Migration links on the Docs landing page:
image

These changes apply to 23.1-25.2 docs. Please review:

Copy link

github-actions bot commented Apr 17, 2025

Files changed:

Copy link

netlify bot commented Apr 17, 2025

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit f75f2fd
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-api-docs/deploys/6807edcfdb871e0008629250

Copy link

netlify bot commented Apr 17, 2025

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit f75f2fd
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-interactivetutorials-docs/deploys/6807edcf4eccea0008cf9c94

@taroface taroface force-pushed the migration-refactor-v3 branch from 745768a to 778a2d8 Compare April 17, 2025 23:12
Copy link

netlify bot commented Apr 17, 2025

Deploy Preview for cockroachdb-docs failed. Why did it fail? →

Name Link
🔨 Latest commit c1b28fb
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-docs/deploys/68018a787c8fac0008b7ec7d

Copy link

netlify bot commented Apr 17, 2025

Deploy Preview for cockroachdb-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 8aa4ecf
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-docs/deploys/68018ba7f6e2cd00085b2c92

Copy link

netlify bot commented Apr 17, 2025

Deploy Preview for cockroachdb-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 8eebdb3
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-docs/deploys/68018c0cce4d5b0008d190d7

Copy link

netlify bot commented Apr 17, 2025

Netlify Preview

Name Link
🔨 Latest commit f75f2fd
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-docs/deploys/6807edcf9143c7000829822c
😎 Deploy Preview https://deploy-preview-19532--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@taroface taroface force-pushed the migration-refactor-v3 branch 8 times, most recently from e12f37f to 57bbdcf Compare April 21, 2025 16:05
@taroface
Copy link
Contributor Author

Temporarily removing from review while I do some deeper reorganization (prompted by many broken links).

@taroface taroface force-pushed the migration-refactor-v3 branch 3 times, most recently from 3fc3401 to 51c454f Compare April 22, 2025 17:24
@taroface taroface force-pushed the migration-refactor-v3 branch 2 times, most recently from b35e8aa to 4140338 Compare April 22, 2025 19:03
@taroface taroface force-pushed the migration-refactor-v3 branch from 4140338 to 12b29dd Compare April 22, 2025 19:07

- Define an explicit primary key on every table. For more information, refer to [Primary key best practices]({% link {{ site.current_cloud_version }}/schema-design-table.md %}#primary-key-best-practices).

- Do **not** use a sequence to define a primary key column. Instead, Cockroach Labs recommends that you use [multi-column primary keys]({% link {{ site.current_cloud_version }}/performance-best-practices-overview.md %}#use-multi-column-primary-keys) or [auto-generating unique IDs]({% link {{ site.current_cloud_version }}/performance-best-practices-overview.md %}#use-functions-to-generate-unique-ids) for primary key columns.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jeremyyang920 should this explain why exactly? Mainly because of the hot spotting problem. Might be worthwhile to provide reasoning for this statement instead of a blanket statement

SET CLUSTER SETTING kv.rangefeed.enabled = true;
~~~

- Ensure that your CockroachDB deployment has a valid [Enterprise license]({% link {{ site.current_cloud_version }}/licensing-faqs.md %}).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we show the sample command of how to do this?

SET CLUSTER SETTING cluster.organization = 'org';
SET CLUSTER SETTING enterprise.license = 'license';


{% include molt/migration-modify-target-schema.md %}

## Step 6. Replicate changes to CockroachDB

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohan-joshi @Jeremyyang920 should we add the section about how to verify replication has caught up and the next step (cutover) can happen?

1. Convert the source schema: Use the [Schema Conversion Tool]({% link cockroachcloud/migrations-page.md %}) to generate CockroachDB-compatible [DDL]({% link {{ site.current_cloud_version }}/sql-statements.md %}#data-definition-statements). Apply the converted schema to the target database. Drop constraints and indexes to facilitate data load.
1. Load data into CockroachDB: Use [MOLT Fetch]({% link molt/molt-fetch.md %}) to bulk-ingest your source data.
1. (Optional) Verify consistency before replication: Use [MOLT Verify]({% link molt/molt-verify.md %}) to confirm that the data loaded into CockroachDB is consistent with the source.
1. Replicate ongoing changes. Enable continuous replication to keep CockroachDB in sync with the source.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: seems like we explicitly say which tool is used for the above convert schema, load data, and verify steps. Should we also note which tool will replicate ongoing changes? Or at least provide examples (i.e. Replicator or DMS). I guess the complexity here is that we don't refer to "Replicator" directly in these docs as a standalone tool

1. Load data into CockroachDB: Use [MOLT Fetch]({% link molt/molt-fetch.md %}) to bulk-ingest your source data.
1. (Optional) Verify consistency before replication: Use [MOLT Verify]({% link molt/molt-verify.md %}) to confirm that the data loaded into CockroachDB is consistent with the source.
1. Replicate ongoing changes. Enable continuous replication to keep CockroachDB in sync with the source.
1. Verify consistency before cutover. Use MOLT Verify to confirm that the CockroachDB data is consistent with the source.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe link to MOLT Verify again

<tr>
<td class="comparison-chart__feature"><a href="#fetch"><b>Fetch</b></a></td>
<td>Initial data load; optional continuous replication</td>
<td>PostgreSQL 11-14, MySQL 5.7-8.0+, CockroachDB</td>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually support PG 15 too (just checked our CI and we run tests again this nightly)

<tr>
<td class="comparison-chart__feature"><a href="#verify"><b>Verify</b></a></td>
<td>Schema and data validation</td>
<td>PostgreSQL 12-14, MySQL 5.7-8.0+, CockroachDB</td>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above for PG 15


- [Multiple migration modes](#migration-modes) via `IMPORT INTO` or `COPY FROM`
- Data movement via [cloud storage, local file servers, or direct copy]({% link molt/molt-fetch.md %}#data-path).
- [Concurrent data export]({% link molt/molt-fetch.md %}#best-practices) from multiple source tables and shards

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth calling out here that this is limited to certain PK types? Or is that too detailed here?

- Table structure verification
- Column definition verification
- Row-level data verification
- Continuous, live, or one-time verification

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though we support this, want to say this is not an oft-tested path and we've had issues with customers workign with this mode. CC @Jeremyyang920 and @rohan-joshi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants