2
votes

Can I use Azure Service Fabric reliable stateful actors for geo mapping issues? Let's say I have an actor representing an event. This event is created by a user, who set such an event on a map. A lot of users can create a lot of events. Each event representing actor stores a geo coordinate and one another state. That will cause I can have millions of events distributed over a map.

So now I want have a grouping actor representing event actors based on an area of the map, or based on a rectangle of coordinates. The grouping actor stores a list of all event actors in this map area. In view of performance issues, is it possible and recommended to create dynamically such a grouping actor? The area will be determined by user input.

1

1 Answers

1
votes

It's possible but it probably won't perform very well because the grouping actor will have to make an individual request to each actor for its geocoordinate, and these requests aren't cheap because they involve data serialization and network requests.

It would probably be easier and better performing to just use a Reliable Dictionary within a Reliable Service. Each coordinate and any associated data can be an entry in the dictionary. You can enumerate, perform LINQ queries, and generally program like you would with a normal dictionary.

With millions of items, you'll probably want to partition the service to spread it over multiple nodes. You get full control over key distribution across partitions, so you can do things like partition by region by hashing geocoordinates or using quad keys.