I am working on an application that will have ratings on the objects presented to the user. We want to have some of the top rated within a distance of the user.

My thought was to use an azure function to collect all of the objects with at least 4 out of 5 rating and write them to a table with a random order field to break up the top displayed objects with their geolocation added into a new table and run it once a day. When the top list is called its ordered by the random column and get the top 5 within geolocation range.

Would this be a best practice for such a large calculation with a eye heavily on operating costs or is there a better solution for this scenario?

Generated table model in C#

    public class FourStarPlusAverageRating
        public ObjectId Id { get; set; }
        public Guid AverageId { get; set; }
        public Guid Rated { get; set; }
        public string Name { get; set; }
        public double AverageRate { get; set; }
        public int RandomOrderId { get; set; }
        public GeoJsonPoint<GeoJson2DGeographicCoordinates> Location { get; set; }


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.