Observer Subscription Scalability issues
I have a requirement to store close to 1000 observers in grain state of publisher grain. But publisher grain fails to write to state with an error "Data too large to write to Azure Storage" when observer count is ~450. The grain state is as follows
public class PublisherGrainState : GrainState
{
public ObserverSubscriptionManager<INotificationObserver> Observers { get; set; }
}
I switched to Streams and I still see the same issue when the observer count ~350.
Is there any guidelines to support such large number of observers?
This is the limitation of the current implementation of the Azure Table storage provider that stores all of the grain state into a single column. We are planning to bring a more sophisticated implementation of it to GitHub in the near future.
In the meantime, the workaround is to use a different storage provider or to manage persistence of the subscribers list with app code in the grain.
Same issue was raised in https://github.com/dotnet/orleans/issues/1217.
Will be fixed by https://github.com/dotnet/orleans/pull/1539.