Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Bringing Spatial Love to your Java Application

You have seen the stuff that Foursquare has done with spatial and you want some of that hotness for your app. But, where to start? MongoDB offers an easy way to get started and enables a variety of location-based applications - ranging from field resource management to social check-ins. In this session we are going to show you how easy it is to add spatial functionality to your application using MongoDB. We will load up a spatial database and then create web services, using a straight Java MongoDB driver and Spring MongoDB project, then let your web or mobile application take advantage of the spatial functionality in MongoDB. Our application will be hosted on OpenShift, Red Hat's Platform as a Service, which provides multiple language development and native MongoDB hosting. By the end of this session, you will be ready to go home and start using MongoDB to add some great functionality and spatial love to your Java application.

Bringing Spatial Love to your Java Application

3.
User Stories As a User, I should be able to find all the jobs. As a User, I should be able to find all the jobs near to my location. As a User, I should be able to find all MongoDB (or any skill) jobs near to my location. As a User, I should be able to find all the MongoDB (or any other skill) jobs near to my location with distance.3

4.
Assumptions: as a developer ...  Want to prototype quickly  Need quick feedback  Dont want to manage infrastructure  Dont want to spend much money on infrastructure. Or, even better, you want it to be free.  Use your existing knowledge  Should be able to use the best tool for the job4

8.
Geospatial Indexing Basics  What is it for?  Find all the MongoDB jobs near me  Find all the MongoDB jobs within Pune  Supports only two dimensional indexes.  You can only have one geospatial index per collection.  The spatial functionality MongoDB currently has is:  Near  Containment http://www.mongodb.org/display/DOCS/Geospatial+ Indexing8

12.
What else do I get and what is the catch?• OpenShift is free-as-in-beer & free-as-in-freedom• You get three free gears, each with 512MB memory and 1GB of disk space.• Need more resources, just ask!• The catch is we are in developer preview right now12

19.
Play with MongoDB running in the Cloud ssh into instance Type mongo on the shell Create a sample db Insert some documents in the collection Run some queries19

20.
Lets take a look at GIT Distributed version control A local repository – on your laptop A remote repository – on some other machine, usually a server20

21.
You need to understand at least 3 commands in Git 1. Git add . (means add all news files as being tracked in the local repository) 2. Git commit –am “your message” (means commit all my changes to the local repository with this message) 3. Git push (means push from your local repository to the repository on your OpenShift gear)21

27.
Conclusion 1. MongoDB makes it very easy to build location aware applications. 2. OpenShift is very easy to use and embraces rapid development. 3. Did I mention – Free? 4. What are you waiting for? Try it out.27