KatrinaHoffert / EatSafe

An app for finding safe places to eat
Other
2 stars 2 forks source link

Integrate ratings into SlimLocation #66

Closed KatrinaHoffert closed 9 years ago

KatrinaHoffert commented 9 years ago

The SlimLocation class was made to reduce the impact of getting all locations for a city (which was very slow). We should first see if #25 improves performance enough to avoid this. If it doesn't, we should consider creating a "rating" table that maps each location to its current rating. SlimLocation would then be given a rating field and the query that gets SlimLocations would join the location and rating tables.

This is somewhat undesirable because the creation of a rating table means that there must be some kind of utility function to create the table. That is the main part of this issue. One way to do this would be to have a password protected page (later made part of an admin interface?) that would run the utility function (emptying and then recreating the rating table) when visited.

One thing to consider is that the site will be temporarily broken while the rating table is being created. A solution to this is to create a maintenance mode that can be enabled and disabled as needed and would block access to all other pages. A way to do this would be to use action composition, where we'd wrap our existing actions with an action that checks if we are supposed to be in maintenance mode, and if so, show an alternative page.

If the need for maintenance mode is realized, it should be a separate issue (it's not actually necessary, but prevents users from stumbling across a "bug" due to the database being in construction at the time of access.

KatrinaHoffert commented 9 years ago

Not clear if this is something we'd want to tackle in milestone 3. It's closely related to the multimap (#64) in that it would allow for efficiency that the multi-map badly needs.

KatrinaHoffert commented 9 years ago

Not clear if this is necessary. While it does take ~45 seconds to get all the locations with ratings and coordinates, caching completely eliminates that time. So the 45 seconds only has to be waited once. We could literally just check the page once and everyone else will be able to get super fast access time. Because of the effectiveness of the caching, I don't think we need to go any further.