1. Building a Mobile App! Part 1 { name: Bryan Reinero, title:
Developer Advocate, twitter: @blimpyacht, code: github.com/breinero
email: [email protected] }
2. 2 Track Agenda Part 1: Architecture and Application Design
Part 2: Geo-Spatial Indexing and Queries Part 3:Deployment
Readiness
3. 3 Mobile Applications Location based data User relevance
Context Rich Social Engagement
4. 4 The Scavenger Hunt App Users create scavenger hunts by
pinning waypoints
5. 5 The Scavenger Hunt App Players search for a scavenger hunt
near their current position
6. 6 The Scavenger Hunt App Basic Requirements
7. 7 The Scavenger Hunt App Basic Requirements Mark target
points
8. 8 The Scavenger Hunt App Basic Requirements Mark target
points Identify our users
9. 9 The Scavenger Hunt App Basic Requirements Mark target
points Identify our users Mark users progress during hunts
10. Schema Design
11. 11 The Scavenger Hunt App Users create scavenger hunts by
pinning waypoints
12. 12 Waypoint { _id: ObjectId(), user: UUID, tour: UUDI name:
"Doug's Dogs", desc: "The best hot-dog", clues: [ "Hungry for a
Coney Island?", "Ask for Dr. Frankenfurter", "Look for the hot dog
stand" ], "geometry": { "type": "Point", "coordinates": [125.6,
10.1] } };
13. 13 Waypoint { _id: ObjectId(), user: UUID, tour: UUDI name:
"Doug's Dogs", desc: "The best hot-dog", clues: [ "Hungry for a
Coney Island?", "Ask for Dr. Frankenfurter", "Look for the hot dog
stand" ], "geometry": { "type": "Point", "coordinates": [125.6,
10.1] } };
14. 14 Waypoint { _id: ObjectId(), user: UUID, tour: UUDI name:
"Doug's Dogs", desc: "The best hot-dog", clues: [ "Hungry for a
Coney Island?", "Ask for Dr. Frankenfurter", "Look for the hot dog
stand" ], "geometry": { "type": "Point", "coordinates": [125.6,
10.1] } }; Geospacial Index: ensureIndex( { geometry: 2dsphere }
)
15. 15 Waypoint Mobile Client
16. 16 Waypoint Application ServerMobile Client RESTful Service
scavenger.com/waypoints?lat=40.87&lon=-73.87&max=100 HTTP
GET
17. 17 Waypoint Application Server DatabaseMobile Client
RESTful Service
scavenger.com/waypoints?lat=40.87&lon=-73.87&max=100 HTTP
GET
18. 18 Waypoint Application Server DatabaseMobile Client
RESTful Service
scavenger.com/waypoints?lat=40.87&lon=-73.87&max=100 HTTP
GET Query { $geoNear: { $geometry: { type: "Point", coordinates: [
-174.9559, 40.6544 ] }, maxDistance: 100 }
19. 19 The Scavenger Hunt App Basic Requirements Mark target
points Identify our users Mark users progress during hunts
27. 27 Notifications / Messaging Message { sender: Hypatia,
recipients: [ Democritus, Euripides, Eratosthenes ] date:
ISODate(), message: truth is a point of view, and so is changeable
}
28. 28 Notifications / Messaging Message { sender: Hypatia,
recipients: [ Democritus, Euripides, Eratosthenes ] date:
ISODate(), message: truth is a point of view, and so is changeable
} db.messages.find( { recipients: Democritus} );
33. 33 One Document per Message per Recipient { sender:
Hypatia, recipient: Democritus, date: ISODate(), message: truth is
a point of view, and so is changeable } { sender: Hypatia,
recipient: Euripides, date: ISODate(), message: truth is a point of
view, and so is changeable } { sender: Hypatia, recipient:
Eratosthenes, date: ISODate(), message: truth is a point of view,
and so is changeable }