Skip to content

Explaining the caveats in writing to the same key with a workaround example#3283

Open
ilianiliev-redis wants to merge 1 commit intoredis:mainfrom
ilianiliev-redis:writing-to-the-same-key-example
Open

Explaining the caveats in writing to the same key with a workaround example#3283
ilianiliev-redis wants to merge 1 commit intoredis:mainfrom
ilianiliev-redis:writing-to-the-same-key-example

Conversation

@ilianiliev-redis
Copy link
Copy Markdown
Contributor

@ilianiliev-redis ilianiliev-redis commented May 7, 2026

Explaining the caveats in writing to the same key with a workaround example

Ticket: https://redislabs.atlassian.net/browse/RDSC-5181


Note

Low Risk
Documentation-only change adding guidance for a known edge case (shared-key deletes) and an example workaround; no runtime behavior is modified.

Overview
Adds a new caveat to data-denormalization.md that when multiple RDI jobs write to the same Redis key, a delete event from any source entity can remove the shared key, and links to a workaround.

Introduces a new transform example doc, redis-write-same-key.md, showing how to use row_format: full, convert delete opcode events into updates, and null out fields so jobs can safely on_update: merge into a shared Redis JSON document without deleting the key.

Reviewed by Cursor Bugbot for commit e999b1b. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Contributor

@andy-stark-redis andy-stark-redis left a comment

Choose a reason for hiding this comment

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

Couple of suggestions, but otherwise LGTM.

Comment on lines +87 to +89
# If you have overlapping field names e.g. FK and PK have the same name, or both table have
# a field called "id" and may want to remove the field from the after object to prevent it
# from overwriting the PK.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# If you have overlapping field names e.g. FK and PK have the same name, or both table have
# a field called "id" and may want to remove the field from the after object to prevent it
# from overwriting the PK.
# If you have overlapping field names (for example, FK and PK have the same name, or both tables have
# a field called "id"), you may want to remove the field from the after object to prevent it
# from overwriting the PK.

You can also use custom keys for the parent entity, as long as you use the same key for all jobs that write to the same Redis key.

{{< note >}}
In the case of using the same key for different jobs, deleting any of the entities will result in the key being remove from the target.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
In the case of using the same key for different jobs, deleting any of the entities will result in the key being remove from the target.
If you are using the same key for different jobs, deleting any of the entities will result in the key being removed from the target.

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