SlideShare a Scribd company logo
Thinking Beyond RDBMS :
OPENSHIFT
Building Polyglot Persistence Java
Applications
Workshop

PRESENTED
BY

Shekhar
Gulati
WHO AM I?

•

Shekhar Gulati -- OpenShift Developer Evangelist

•

Java / JavaScript /Python / NoSQL / Cloud Guy

•

Twitter Handle : shekhargulati

•

Github https://github.com/shekhargulati

•

Slides http://www.slideshare.net/shekhargulati
AGENDA
WHO ARE YOU?
ASK QUESTIONS

There are no stupid questions only stupid
answers. So ask questions
NOW WE HAVE CHOICES ...

http://nosql-database.org/ lists 150
databases
WHY RDBMS?
●

Widely used and understood

●

Tested in real environments

●

Efficient use of storage space if data normalized properly

●

Great tools support

●

ACID semantics

●

Incredibly flexible and powerful query language

●

Great framework support
RDBMS LIMITATIONS
●

Complex object graphs does not map very well with flat
tables.

●

Difficult to evolve Schema with time.

●

Data constraints and JOINs can be expensive at runtime.

●

Difficult to scale horizontally.
NoSQL Databases to rescue
NoSQL TO RESCUE
●

Schema-less

●

Eventual consistent

●

Scales writes and reads

●

●

Easy to scale horizontally to add processing power and
storage
Tries to solve few practical use-cases
NoSQL CLASSIFICATION
CLASSIFICATION

Source http://www.slideshare.net/bscofield/nosql-codemash-2010
POLYGLOT PERSISTENCE

Using multiple data storage technologies, chosen based
upon the way data is being used by individual
applications or components of single application.

Martin Fowler
http://martinfowler.com/articles/nosql-intro.pdf
HYPOTHETICAL EXAMPLE

http://martinfowler.com/articles/nosql-intro.pdf
GET MORE INFO AT
APPLICATION

http://localjobs-t20.rhcloud.com/
TECHNOLOGY CHOICES
●

MongoDB – Storing Jobs data

●

PostgreSQL – Storing Users data

●

Redis – Cache for Users

●

Java 7
–

Spring framework , Spring Social, Spring MongoDB,
Spring Security , Spring Redis , etc.

●

OpenShift

●

Git

●

Twitter Bootstrap

●

jQuery

●

Searchify : Full-text Search as a Service
MONGODB
●

Document Oriented database
–

●

JSON-style documents

Schema-less
–

Each document is heterogeneous, and may have completely
unique structure compared to other documents.

●

Fast and horizontally scalable

●

Rich query language
MONGODB TERMINOLOGY

Database →

Database

Table

→

Collection

Row

→

Document

Index

→

Index
WHY MONGODB?
●

Easy to get running

●

Open Source

●

Active community

●

Rich documents

●

Geospatial indexing

●

Writes are very fast. You can customize it using
WriteConcern
RICH DOCUMENT
GEOSPATIAL INDEXING
BASICS



What is it for?





Find all the 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))
21
HOW TO MAKE IT WORK

1)

Put your coordinates into an array

{ loc : [ 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)

22

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.
OpenShift
is

PaaS by Red Hat

Multi-language,
Auto-Scaling,
Self-service,
Elastic,
Cloud Application
Platform
WHY OPENSHIFT?

●

●

Supports MongoDB , PostgreSQL ,and MySQL
Multi-language support. Supports Java, Node.js, Perl,
Python, PHP and Ruby

●

Extensible via DIY and cartridges

●

No need to learn anything new

●

Open source – OpenShift Origin

●

Scalable

●

FREE!
FLAVORS OF OPENSHIFT

Open
Source
Project

Public
Cloud
Service

origin

Onpremise
or Private
Cloud
Software
OUR STACK

26
Let's build the application

27
OPENSHIFT – GETTING
STARTED

Go to

●

https://openshift.redhat.com/app/account/new

Promo code is DEVFEST2013

Create namespace

●

Install rhc command line
utility

●

Run rhc setup command

●

28
DEMO : LOCALJOBS APP

Lot of other tasks you can do with rhc – tail log, app management,
cartridge management , ssh management , namespace
management, etc. Run rhc -h for details
29
HOW IT FITS
ITS All GIT

$ git rm -rf src pom.xml
$ git commit -am “delete template app”
$ git remote add upstream -m master
https://github.com/shekhargulati/localjobsdemo.git
$ git pull -s recursive -X theirs upstream master
Source code https://github.com/shekhargulati/localjobs-demo

31
git push

32
Code Walkthrough

33
QUESTIONS?
DONE!

More Related Content

KEY
rubykaigi2011_spatial.key
PDF
Delivering and using Grid service with Nordugrid/ARC
PDF
Ruby for soul of BigData Nerds
PDF
Polyglot Persistence - Two Great Tastes That Taste Great Together
PDF
DevOps, microservices and stress-free incidents. How toy have your cake and ...
PPTX
DevoxxUK 2016: "DevOps: Microservices, containers, platforms, tooling... Oh y...
PDF
Developing polyglot persistence applications (gluecon 2013)
PDF
Dockerを使ったローカルでの開発から本番環境へのデプロイまで
rubykaigi2011_spatial.key
Delivering and using Grid service with Nordugrid/ARC
Ruby for soul of BigData Nerds
Polyglot Persistence - Two Great Tastes That Taste Great Together
DevOps, microservices and stress-free incidents. How toy have your cake and ...
DevoxxUK 2016: "DevOps: Microservices, containers, platforms, tooling... Oh y...
Developing polyglot persistence applications (gluecon 2013)
Dockerを使ったローカルでの開発から本番環境へのデプロイまで

Similar to Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devfest Vienna (20)

PDF
Mongo db bangalore
PDF
Bringing spatial love to your python application
PDF
Java EE 6 and NoSQL Workshop DevFest Austria
PPT
MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
PDF
Java(ee) mongo db applications in the cloud
PPTX
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
PDF
Building spatial back ends with Node.js and MongoDB
PDF
OrientDB - The 2nd generation of (multi-model) NoSQL
PPT
Mongo sf spatialmongo
PPTX
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
PPTX
Bringing Spatial Love to Your Java Application
PPTX
Spatial mongo for PHP and Zend
PPTX
Geoindexing with MongoDB
PPTX
Mongodb open data day 2014
PPTX
Webinar : Premiers pas avec MongoDB - Back to Basics
PDF
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...
ODP
A Happy Cloud Friendly Java Developer with OpenShift
PPTX
Introduction to NoSql
PPTX
Conceptos básicos. Seminario web 1: Introducción a NoSQL
KEY
MongoDB at CodeMash 2.0.1.0
Mongo db bangalore
Bringing spatial love to your python application
Java EE 6 and NoSQL Workshop DevFest Austria
MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
Java(ee) mongo db applications in the cloud
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Building spatial back ends with Node.js and MongoDB
OrientDB - The 2nd generation of (multi-model) NoSQL
Mongo sf spatialmongo
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
Bringing Spatial Love to Your Java Application
Spatial mongo for PHP and Zend
Geoindexing with MongoDB
Mongodb open data day 2014
Webinar : Premiers pas avec MongoDB - Back to Basics
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...
A Happy Cloud Friendly Java Developer with OpenShift
Introduction to NoSql
Conceptos básicos. Seminario web 1: Introducción a NoSQL
MongoDB at CodeMash 2.0.1.0
Ad

More from Shekhar Gulati (8)

PDF
Modern web application development with java ee 7
PDF
Working effectively with OpenShift
PDF
Developing Great Apps with Apache Cordova
PDF
Developing Modern Java Web Applications with Java EE 7 and AngularJS
PDF
Developing modern java web applications with java ee 7 and angular js
PDF
Open shift for java(ee) developers
PDF
Power up Magnolia CMS with OpenShift
PPT
Indic threads java10-spring-roo-and-the-cloud
Modern web application development with java ee 7
Working effectively with OpenShift
Developing Great Apps with Apache Cordova
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing modern java web applications with java ee 7 and angular js
Open shift for java(ee) developers
Power up Magnolia CMS with OpenShift
Indic threads java10-spring-roo-and-the-cloud
Ad

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Electronic commerce courselecture one. Pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Spectroscopy.pptx food analysis technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Approach and Philosophy of On baking technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
KodekX | Application Modernization Development
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
sap open course for s4hana steps from ECC to s4
Teaching material agriculture food technology
Electronic commerce courselecture one. Pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Programs and apps: productivity, graphics, security and other tools
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Spectroscopy.pptx food analysis technology
The AUB Centre for AI in Media Proposal.docx
Approach and Philosophy of On baking technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
“AI and Expert System Decision Support & Business Intelligence Systems”
KodekX | Application Modernization Development
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Diabetes mellitus diagnosis method based random forest with bat algorithm
sap open course for s4hana steps from ECC to s4

Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devfest Vienna