Efficiently performing read only operation on entity #2053
-
I'm using a durable entity to determine the enabled status of various items. For example, at a couple points in an orchestration, I check to make sure that the ID of the task isn't disabled. If it is disabled, I send the orchestration into a standby loop until it is enabled again. Right now, I have an The documentation states
As this is a read-only check, this seems inefficient. I can't use the the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think the reason this creates a performance bottleneck is because each You might be able to speed this up quite a bit by using Adding @sebastianburckhardt in case he has additional thoughts. |
Beta Was this translation helpful? Give feedback.
I think the reason this creates a performance bottleneck is because each
IsEnabled
check from your orchestration(s) to the entity is represented as a series of messages that need to be processed by the entity. The entity can only process one message at a time, which means it slows down as you add more orchestrations.You might be able to speed this up quite a bit by using
IDurableEntityClient
in an activity function that fetches the read-only state of the entity (which is very fast). It still involves messaging because you have to invoke an activity function, but it's more scalable since it removes the entity operation throughput bottleneck. This option should be viable as long as you can…