-
Notifications
You must be signed in to change notification settings - Fork 93
Add blog post: Ignore Duplicate Writes feature announcement #1132
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6b3b5c6
Add blog post announcing ignore duplicate writes feature
tylernix 342ce95
Update blog post with author and optimized image
tylernix 930871d
removing comments from json
tylernix 68364e1
Update blog/ignore-duplicate-writes-announcement.md
tylernix 844cb12
Update blog/ignore-duplicate-writes-announcement.md
tylernix b640304
Update blog/ignore-duplicate-writes-announcement.md
tylernix 4176035
Merge branch 'main' into feature/ignore-duplicate-writes-blog
rhamzeh 0508f33
chore: use the WriteRequestViewer
rhamzeh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| --- | ||
| title: Ignore Duplicate Tuples On Write | ||
| description: OpenFGA now supports ignoring duplicate writes and missing deletes, making data imports much easier and more efficient. | ||
| slug: ignore-duplicate-writes-announcement | ||
| date: 2025-10-31 | ||
| authors: tylernix | ||
| tags: [openfga,features,api] | ||
| image: https://openfga.dev/img/og-rich-embed.png | ||
| hide_table_of_contents: false | ||
| --- | ||
|
|
||
| import { | ||
| SupportedLanguage, | ||
| WriteRequestViewer, | ||
| } from '@components/Docs'; | ||
|
|
||
| # Announcing "Ignore Duplicate Writes" in OpenFGA | ||
|
|
||
| We've added two new optional parameters to the Write API endpoint to improve the experience of writing data to FGA. You can now gracefully ["ignore" duplicate writes and missing deletes](https://openfga.dev/docs/getting-started/update-tuples#05-ignoring-duplicate-or-missing-tuples). | ||
|
|
||
| ## The Problem | ||
|
|
||
| When you're writing tuples to OpenFGA, it's almost inevitable that you'll try to write a relationship tuple that already exists (e.g., `user:anne` is already a `viewer` of `document:123`) or try to delete one that's already gone. In the past, OpenFGA would reject the entire Write request containing that single duplicate operation. | ||
|
|
||
| This forced developers to build complex error-handling and retry logic on the client-side, just to filter out the single problematic tuple and resend the rest of the batch. This adds latency and operational overhead. | ||
|
|
||
| ## The Solution | ||
|
|
||
| The Write API now accepts two new optional parameters to gracefully handle these use cases: | ||
|
|
||
| - **`on_duplicate: "ignore"`**: When included in the `writes` section, this tells OpenFGA to simply skip any tuples that already exist instead of failing the request. | ||
|
|
||
| - **`on_missing: "ignore"`**: When included in the `deletes` section, this tells OpenFGA to skip any tuples that don't exist. | ||
|
|
||
| Now, you can send large batches of writes and deletes without worrying about these common conditions breaking your import. | ||
|
|
||
| ## See it in Action | ||
|
|
||
| For writes: | ||
|
|
||
| <WriteRequestViewer | ||
| relationshipTuples={[ | ||
| { | ||
| user: 'user:anne', | ||
| relation: 'viewer', | ||
| object: 'document:roadmap' | ||
| }, | ||
| ]} | ||
| conflictOptions={{ | ||
| onDuplicateWrites: 'ignore', | ||
| }} | ||
| skipSetup={true} | ||
| allowedLanguages={[ | ||
| SupportedLanguage.JS_SDK, | ||
| SupportedLanguage.GO_SDK, | ||
| SupportedLanguage.DOTNET_SDK, | ||
| SupportedLanguage.PYTHON_SDK, | ||
| SupportedLanguage.JAVA_SDK, | ||
| SupportedLanguage.CLI, | ||
| SupportedLanguage.CURL, | ||
| ]} | ||
| /> | ||
|
|
||
| And deletes: | ||
|
|
||
| <WriteRequestViewer | ||
| deleteRelationshipTuples={[ | ||
| { | ||
| user: 'user:anne', | ||
| relation: 'owner', | ||
| object: 'document:roadmap' | ||
| }, | ||
| ]} | ||
| conflictOptions={{ | ||
| onMissingDeletes: 'ignore', | ||
| }} | ||
| skipSetup={true} | ||
| allowedLanguages={[ | ||
| SupportedLanguage.JS_SDK, | ||
| SupportedLanguage.GO_SDK, | ||
| SupportedLanguage.DOTNET_SDK, | ||
| SupportedLanguage.PYTHON_SDK, | ||
| SupportedLanguage.JAVA_SDK, | ||
| SupportedLanguage.CLI, | ||
| SupportedLanguage.CURL, | ||
| ]} | ||
| /> | ||
|
|
||
| ## Get Started | ||
|
|
||
| This is supported in the latest versions of the OpenFGA API, SDKs and CLI. Try it out and let us know what you think! | ||
|
|
||
| - [API Docs](https://openfga.dev/api/service#/Relationship%20Tuples/Write) | ||
| - [JavaScript SDK](https://github.com/openfga/js-sdk?tab=readme-ov-file#conflict-options-for-write-operations) | ||
| - [Go SDK](https://github.com/openfga/go-sdk?tab=readme-ov-file#conflict-options-for-write-operations) | ||
| - [.NET SDK](https://github.com/openfga/dotnet-sdk?tab=readme-ov-file#conflict-options-for-write-operations) | ||
| - [Python SDK](https://github.com/openfga/python-sdk?tab=readme-ov-file#conflict-options-for-write-operations) | ||
| - [Java SDK](https://github.com/openfga/java-sdk?tab=readme-ov-file#conflict-options-for-write-operations) | ||
|
|
||
| Special thanks to [@phamhieu](https://github.com/phamhieu) for his [contribution](https://github.com/openfga/js-sdk/pull/276) to the JavaScript SDK! π | ||
|
|
||
| Learn more about [Writing Tuples in OpenFGA](https://openfga.dev/docs/getting-started/update-tuples#05-ignoring-duplicate-or-missing-tuples). | ||
|
|
||
| ## We want your feedback! | ||
|
|
||
| Please reach out through our [community channels](https://openfga.dev/docs/community) with any questions or feedback. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.