Let's say, I'm using Azure Service Fabric Stateful Service, with RemotingV2, and I want to store users phone numbers (That's the only thing my service does).
Task StoreNumber(string username, string phoneNumber);
Task<string> GetNumber(string username);
I want to use the username for partitioning.
What's the elegant way to do that?
can I remove the username
parameter from the methods and somehow get it from the request?
Is there a better way?
Thanks
Here's a video that covers this subject and here's a working code sample that goes with it.
username
, use the long
result to determine an Int64RangePartition
by its key.username
. (the sample doesn't)