Demo ModeExit demoStart free
Ready
You
Plan a safe migration to split profile fields out of the users table.
Assistant

Draft migration plan for splitting the users table:

  1. Create user_profiles and dual write for one release.
  2. Backfill 2.4M rows in batches of 5,000 (about 25 minutes).
  3. Switch reads, then drop the old columns two releases later.

Each step is reversible until the final drop.

You
Will the backfill lock the table?
Assistant

Backfill load is low: 5,000-row batches hold row locks for under 100ms each. I would run it off-peak and pause between batches if replica lag passes 5 seconds.

You
Which columns move?
Assistant

Fields moving to user_profiles:

  • display_name, bio, avatar_url
  • timezone, locale
  • marketing_opt_in

email and auth fields stay in users.

You
What is the rollback plan at each step?
Assistant

Rollback per step: stop dual writes and drop user_profiles before the switch; flip reads back to users after it. Old columns remain until the final drop two releases later.

You
Check for data issues that could break the backfill.
Assistant

There are 118 duplicate emails in users from earlier imports. The migration needs a dedupe step first.