I have an app and I'm early enough in the design to walk back the database choice. I'd like to use MongoDB but here is where I'm running into potential issues. I will be doing averaging frequently. Consider this case:
- A trip leg is a certain number of miles long
- A trip leg consumes a given amount of fuel
- The average fuel economy (computed) is a simple division of miles / gallons
- A more interesting statistic is the average economy of everyone doing the same leg
- Another interesting statistic is the average economy of everyone doing a leg near specified start and end points
The last point involves a map/reduce across a query obtaining the total number of miles driven and dividing by the total number of gallons consumed. Is this going to make my server melt down?
I'm using Mongoid in a Rails app. Is there any friction I'm injecting here or will it work just fine to streamline common use-cases like insert, delete, update, query?
The other candidate database is Postgres, which also handles location data, but it is not schema less in the way Mongo is.
I recognize that some of this calls for opinion, but perhaps this is information that would benefit SO users.
Thanks!