Yordis Prieto
08/23/2023, 11:10 AMBatchWriteRelantionship?vroldanbet
08/23/2023, 11:11 AMWriteRelationship API supports batch writes of relationships alreadyvroldanbet
08/23/2023, 11:11 AMvroldanbet
08/23/2023, 11:11 AMRelationshipUpdatevroldanbet
08/23/2023, 11:12 AMvroldanbet
08/23/2023, 11:14 AMYordis Prieto
08/23/2023, 11:16 AMYordis Prieto
08/23/2023, 11:16 AMvroldanbet
08/23/2023, 11:24 AMTOUCH instead of CREATEvroldanbet
08/23/2023, 11:25 AMvroldanbet
08/23/2023, 11:25 AMvroldanbet
08/23/2023, 11:30 AMYordis Prieto
08/23/2023, 11:51 AMYordis Prieto
08/23/2023, 11:51 AMYordis Prieto
08/23/2023, 1:23 PMCREATE will create the relationship only if it doesn't exist, and error otherwise.
TOUCH will upsert the relationship, and will not error if it already exists.Yordis Prieto
08/23/2023, 1:26 PMYordis Prieto
08/23/2023, 1:26 PMvroldanbet
08/23/2023, 1:48 PMvroldanbet
08/23/2023, 1:48 PMvroldanbet
08/23/2023, 1:51 PMvroldanbet
08/23/2023, 1:55 PMYordis Prieto
08/23/2023, 2:26 PMat-least-once processing, so I can have many.Yordis Prieto
08/23/2023, 2:28 PMvroldanbet
08/23/2023, 2:45 PMvroldanbet
08/23/2023, 2:47 PMCREATE. It won't be idempotent in that it does not return the same response, but would allow you to get the same effect.
You could add a CREATE relationship that has your idempotency key, and you do that transactionally with the actual relationships.
- if WriteRelationships fails because the idempotency-key-relationship already exists, then you know the operation was already performedvroldanbet
08/23/2023, 2:49 PMzedtoken returned by the operation, but you can make sure the operation was performed.
I still think it could be useful to have some first-class support for idempotency keys so feel free to open a Github issueYordis Prieto
08/23/2023, 4:06 PMYordis Prieto
08/23/2023, 4:17 PMvroldanbet
08/23/2023, 4:35 PMvroldanbet
08/23/2023, 4:44 PMWriteRelationships call. Includes metadata for Idepotency Key
2. Stream processor attempts to commit
3. Stream processor dies before it gets commit acknowledgement
4. Stream processor is restarted and resumes from the last processed Event
5. Stream processor prepares WriteRelationships call with same Idepotency Key
6. Stream processor gets response the operation was already processed, including the result of committing itYordis Prieto
08/23/2023, 4:49 PMYordis Prieto
08/23/2023, 4:49 PMYordis Prieto
08/23/2023, 4:50 PMvroldanbet
08/23/2023, 4:58 PMvroldanbet
08/23/2023, 5:03 PMYordis Prieto
08/23/2023, 5:13 PM