Skip to content

docs: datastore migration guide#8581

Closed
cadivus wants to merge 4 commits into
mainfrom
docs/datastore-migration
Closed

docs: datastore migration guide#8581
cadivus wants to merge 4 commits into
mainfrom
docs/datastore-migration

Conversation

@cadivus
Copy link
Copy Markdown
Member

@cadivus cadivus commented Apr 29, 2026

Description

Updates the DataStore-to-GraphQL migration guide to include backend changes required for a zero-downtime migration.

Problem

PR #8540 assumes clients can keep their Gen1 backend with DataStore/conflict resolution enabled. This is incorrect because:

  • Soft-deleted items (_deleted: true) remain in DynamoDB
  • Standard GraphQL clients (Apollo) receive ALL items including soft-deleted ones
  • Without _deleted in the schema, clients cannot filter them out

Solution

This PR documents the correct migration approach:

  1. Disable conflict resolution via amplify update api
  2. Manually re-add _deleted: Boolean to the GraphQL schema (maps to existing DynamoDB data)
  3. amplify push to apply changes
  4. Update frontend clients to filter { _deleted: { ne: true } }
  5. (Optional) Clean up soft-deleted items and remove _deleted field once all clients are migrated

Why this approach?

  • Zero-downtime: backwards-compatible with both DataStore and Apollo clients
  • No maintenance window required
  • No race conditions with in-flight deletions
  • Gradual migration path: clients can be migrated incrementally

Files changed

  • src/directory/directory.mjs — Added navigation entries for the new migration guide pages
  • src/pages/gen1/[platform]/.../migrate-from-datastore/index.mdx — Parent page explaining why backend changes are required
  • src/pages/gen1/[platform]/.../migrate-from-datastore/disable-conflict-resolution/index.mdx — Step-by-step guide for disabling conflict resolution

Testing

  • All 59 test suites pass (269 tests)
  • yarn prebuild generates directory.json successfully with new entries

Related: #8540

soberm and others added 2 commits April 29, 2026 00:15
* docs: Add Flutter guide

* docs: Don't mention Apollo in the backend part

* docs: Add Android guide

* docs: Add Swift guide

* docs: Update spellcheck
@cadivus cadivus requested a review from osama-rizk April 29, 2026 12:12

<InlineFilter filters={["angular", "javascript", "nextjs", "react", "react-native", "vue"]}>

This guide shows you how to use Apollo Client for queries, mutations, and caching, combined with the Amplify library's built-in subscription support for real-time updates. Depending on how much of DataStore's feature set your app actually uses, you may find the migration simpler than expected.
Copy link
Copy Markdown
Contributor

@osama-rizk osama-rizk Apr 29, 2026

Choose a reason for hiding this comment

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

Can we add link here to the "Apollo Client" docs?

osama-rizk
osama-rizk previously approved these changes Apr 29, 2026
@soberm soberm marked this pull request as ready for review April 30, 2026 11:41
@soberm soberm requested a review from a team as a code owner April 30, 2026 11:41
@iliapolo iliapolo marked this pull request as draft May 1, 2026 12:56
@iliapolo
Copy link
Copy Markdown
Contributor

iliapolo commented May 1, 2026

This is now included in #8570

@iliapolo iliapolo closed this May 1, 2026
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.

4 participants