MongoDB • Day 2 : Deep Dive into Queries and Analytics • Advanced CRUD operations • Aggregation, GeoSpatial, Full Text • Day 2 : Fun with MongoDB and Javascript • WebSockets • Node.js, AngularJS
use of memory-mapped files i.e. read-through write-through memory caching. • Runs nearly everywhere • Data serialized as BSON (fast parsing) • Full support for primary & secondary indexes • Document model = less work
Find everybody in London with a car built between 1970 and 1980 Geospatial • Find all of the car owners within 5km of Trafalgar Sq. Aggregation • Calculate the average value of Paul’s car collection Map Reduce • What is the ownership pattern of colors by geography over time? (is purple trending up in China?) { first_name: ‘Paul’, surname: ‘Miller’, city: ‘London’, location: { ! type: “Point”, ! coordinates : ! ! [-0.128, 51.507] ! },! cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } } } Text Search • Find all the cars described as having leather seats
• Common approach for many datasources • RDBMS, NoSQL, Caching Layers • Key Features • Templating • ODM • Repository Support • http://projects.spring.io/spring-data-mongodb/
OGM • Developed and Supported by MongoDB Inc • The most used way to use MongoDB & Java • Support “ all database features” • Too Verbose… (IMHO) • new version is coming 3.0
OGM • Developed by Red Hat - Jboss • Not yet supported • Under development (not mature, not for production!) • Too “relational” • nice to learn… but move away from it asap :)