APU13 - Bringing Spa- APU13 - Bringing Spa- tial Love to your Java tial Love to your Java Application Application http://talks.thesteve0.com http://talks.thesteve0.com Presented by: Steven Pousty Steven Pousty @TheSteve0 on Twitter, IRC, @TheSteve0 on Twitter, IRC, and Github and Github http://presentations-thesteve0.rhcloud.com/amdjavamongo/index.html?print-pdf
34
Embed
CC-4010, Bringing Spatial Love to your Java Application, by Steven Citron-Pousty
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
APU13 - Bringing Spa-APU13 - Bringing Spa-tial Love to your Javatial Love to your Java
A bit about MongoDBA bit about MongoDBA document is just a bunch of attributes andvalues - think of it like HashMapCan be nested - helps avoid joinsSchemalessReally good at fast writes - but you give upimmediate consistencyEasy to horizontally scale
1. Put coordinates into an array1. Put coordinates into an array{ loc : [ 50 , 30 ] }{ loc : { x : 50 , y : 30 } }{ loc : { foo : 50 , y : 30 } }{ loc : { lon : 40.739037, lat: 73.992964 } } If you use lattitude and longitude with a default
2. Make a 2D index2. Make a 2D index db.places.ensureIndex( { loc : "2d" } )
JEE - CDI and JAX-RSJEE - CDI and JAX-RSContext Dependency Injection - allows you tomake classes availble whenever you need themand let the calling class decide which class it wantsJAX-RS - the antiSOAP (three cheers). Makes itsuper easy to write REST like architectures