diff --git a/blog/authors.yml b/blog/authors.yml index b22519fcd7..8ca85aa8c4 100644 --- a/blog/authors.yml +++ b/blog/authors.yml @@ -15,4 +15,9 @@ hello-caleb: name: Caleb Hunter title: Community Engagement url: https://github.com/hello-caleb - image_url: /img/blog/authors/caleb.jpg \ No newline at end of file + image_url: /img/blog/authors/caleb.jpg +tylernix: + name: Tyler Nix + title: Product Manager + url: https://github.com/tylernix + image_url: /img/blog/authors/tyler.jpg diff --git a/blog/ignore-duplicate-writes-announcement.md b/blog/ignore-duplicate-writes-announcement.md new file mode 100644 index 0000000000..72b10981bd --- /dev/null +++ b/blog/ignore-duplicate-writes-announcement.md @@ -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: + + + +And deletes: + + + +## 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. \ No newline at end of file diff --git a/static/img/blog/authors/tyler.jpg b/static/img/blog/authors/tyler.jpg new file mode 100644 index 0000000000..23298e26b1 --- /dev/null +++ b/static/img/blog/authors/tyler.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2b694ec37f4e9f2abd3bcfe39e01c8fe3ba9c4e2bf8bcc26f492b98d6847eb2 +size 8965