at Red Hat • 8 years of software development experience • Learning JavaScript these days :) • Java / NoSQL/ Cloud • Loves to learn and try new technologies • Twitter Handle : shekhargulati • Github https://github.com/shekhargulati • Slides https://speakerdeck.com/shekhargulati
• Efficient use of storage space if data normalized properly • Great tools support • ACID semantics • Incredibly flexible and powerful query language • Great framework support WHY RDBMS?
flat tables. • Difficult to evolve Schema with time. • Data constraints and JOINs can be expensive at runtime. • Difficult to scale horizontally. RDBMS LIMITATIONS
data is being used by individual applications or components of single application. Martin Fowler http://martinfowler.com/articles/nosql-intro.pdf POLYGLOT PERSISTENCE
framework , Spring Social, Spring MongoDB, Spring Security etc. • Searchify : Full-text Search as a Service • Git • Twitter Bootstrap • Backbone.js TECHNOLOGY CHOICES
Each document is heterogeneous, and may have completely unique structure compared to other documents. • Fast and horizontally scalable • Rich query language MONGODB
MongoDB jobs near me – Proximity Queries Find all the MongoDB jobs within Colombo – Bounded Queries Find all the MongoDB job at this location – Exact Queries • Supports only two dimensional indexes. You can only have one geospatial index per collection. By default, 2d geospatial indexes assume longitude and latitude have boundaries of -180 inclusive and 180 non-inclusive (i.e. [-180, 180)) GEOSPATIAL INDEXING BASICS
: [ 50 , 30 ] } //SUGGESTED OPTION { loc : { x : 50 , y : 30 } } { loc : { foo : 50 , y : 30 } } 1) { loc : { lon : 40.739037, lat: 73.992964 } } 2) Make a 2d index db.places.ensureIndex( { loc : "2d" } ) 3) If you use latitude and longitude as your coordinate system, always store longitude first. MongoDB’s 2d spherical index operators only recognize [ longitude, latitude] ordering. HOW TO MAKE IT WORK
data to binary geohash values and calculates these values using the location data and the index’s location range • Geohashes have a precision that is determined by the number of bits in the hash. Default value 26 • More bits allow the index to provide results with greater precision • You can configure number of bits at index creation db.collection.ensureIndex( {<location field>: "2d"} , { bits: <bit precision> } ) GEOHASHES
support. Supports Java, Node.js, Perl, Python, PHP and Ruby • Extensible via DIY • No need to learn anything new • Open source – OpenShift Origin • Scalable • FREE! WHY OPENSHIFT?
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 now WHAT DO I GET?
code and any data store. Has to be on 1 or more gears 2. Gear – is like a server. It can have only 1 language for the web programming. 3. Cartridge – it adds a language, a data store, or other functionality 4. Git – used for version control and managing code between server and your development machine 5. Ssh – command line tool to connect to your gear