Azure-functions-durable-extension: [Feature Request] Add NewGuid() to DurableOrchestrationContext in order to enable creating unique replay friendly values to provide to activities from the orchestrator directly

Created on 3 Jul 2018  路  11Comments  路  Source: Azure/azure-functions-durable-extension

Something similar to DurableOrchestrationContext.CurrentUtcDateTime, which would persist the GUID and return same value on replay. This would allow to create new GUID without calling an Activity to obtain it and persist it for replay, GUID can then be shared to multiple activities.

enhancement help wanted

Most helpful comment

What I had in mind is something like 2. Today, I could create an activity to generate and persist my GUID, but it does involve too much overhead for a simple GUID generation.

All 11 comments

I like this idea. I think there are two ways we could do this:

  1. Create some kind of "built-in" activity function which returns Guid.NewGuid(). This is simple, but involves a lot of Azure Storage overhead.
  2. Generate deterministic GUIDs that are safe for replay (example).

Any thoughts/concerns/preferences?

What I had in mind is something like 2. Today, I could create an activity to generate and persist my GUID, but it does involve too much overhead for a simple GUID generation.

Hello @cgillum,

I would like to help with this feature.

Where will be the best place for the core logic in the Durable Functions or Durable Task code base?

Thank you!

@gled4er I was thinking to start by adding it in Durable Functions. If people find it useful enough, we can add it to the Durable Task Framework at a later time.

@cgillum thank you for the clarification!

Hello @cgillum,

I think we should add information for this feature in the documentation page. Shall we continue working from the release-functions-durable-migration branch?

Thank you!

Yes, that is the right branch to target.

Thank you for the confirmation!

I will work on it.

Thank you!

Hello @cgillum,

What documentation page will you advice me to use for the NewGuid method?

I checked all the pages and I don't see one dedicated to the DurableOcrchestrationContext that we can use for adding more info for NewGuid method.

Thank you!

I think the pages which talk about orchestrator function limitations around random data. We should call out that the workaround for the "no random GUIDs" rule is to use your new API, just like how we mention how to get the current DateTime.

This shipped as part of the v1.7.0 release. Docs can be found here: https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-checkpointing-and-replay#orchestrator-code-constraints

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mpaul31 picture mpaul31  路  3Comments

pacodelacruz picture pacodelacruz  路  3Comments

val-janeiko picture val-janeiko  路  3Comments

cgillum picture cgillum  路  4Comments

tommasobertoni picture tommasobertoni  路  3Comments