This document discusses leveraging NoSQL technologies for performance. It provides an overview of a benchmark that compares ORM and NoSQL databases. The benchmark tests different data modeling structures and operations like CRUD. The results show that the NoSQL database MongoDB outperformed ORM databases on tests involving complex object graphs, concurrency, and querying. The document concludes that NoSQL approaches can provide better performance than ORM by avoiding joins and complex serialization mappings.
CNIC Information System with Pakdata Cf In Pakistan
Leveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
1. Leveraging your
Knowledge of ORM
Towards Performance-
based N SQL T h l
b d NoSQL Technology
By Robert Greene
Versant Corporation U.S. Headquarters
255 Shoreline Dr Suite 450 Redwood City CA 94065
Dr. 450, City,
www.versant.com | 650-232-2400
#NoSQLVersant
2. Overview NoSQL at it’s Core
SQ C
Pole-Position – Overview
About the Code
Circuits Description
RDB JPA Code
MongoDB Code
Versant JPA Code
V t C d
Results – Winners of the Race
Developer Challenge
#NoSQLVersant
4. Traditional DBMS Scale Architecture
INEFFICIENT
CPU destroying
Mapping
EXPENSIVE
Repetitive data
movement and JOIN
calculation
#NoSQLVersant
5. NoSQL at its Core
A Shift In Application Architecture
UNIFED
Application
A li ti
driven schema
COMMODITY HW
COMMODITY HW
Horizontal scale out,
distribution and
partitioning
• Google – Soft-Schema
• IBM – Schema-Less
#NoSQLVersant
6. A Shift is Needed
► How Often do Relations Change?
g
Blog : BlogEntry , Order : OrderItem , You : Friend
► R l ti
Relations R l Ch
Rarely Change, St R
Stop Recalculating Th
l l ti Them
► Do you need ALL o you da a in o e p ace
o eed of your data one place.
► You don’t. You can distribute it.
#NoSQLVersant
7. Measured V l
M d Value
How NoSQL performance
stacks up to Relational
#NoSQLVersant
8. PolePosition
Performance Benchmark
► Established in 2003
NoSQL
N SQL -vs- ORM
► Code Complexity Circuits
Flat Obj t
Fl t Objects
Graphs
Inherited Objects
Collections
► Data Operations
CRUD
Concurrency
► Scalability
#NoSQLVersant
9. Contenders | Methodology
► Contenders
ORM
NoSQL
► Methodology
External RDB Experts, Internal NoSQL Experts
Open Source Benchmark Code for all contenders
#NoSQLVersant
10. About the Code
► ORM
Common Code Base
► Tested Database Engines
Hibernate – MySQL / Postgres
OpenJPA – MySQL / Postgres
MongoDB
Versant Object Database
#NoSQLVersant
11. Circuit Structure
► Simulate CRUD on embedded graph of different Classes.
► Cl
Class model - C
d l Complex Ci it
l Circuit:
class Holder0 {
String _name;
String name;
List <Holder0> _children;
Holder0[] _array; }
class Holder1 extends Holder0 {
{
int _i1; }
class Holder2 extends Holder1 {
int _i2 <indexed>; } ...class HolderN
extends…..
#NoSQLVersant
12. Hibernate JPA Code
► Write – Generates Holder’s to user spec depth
ComplexHolder cp = new ComplexHolder( );
em.makePersistent(cp);
► Read – Access root of graph and traverse
cp = em.find( ComplexHolder.class, id ); cp.getChildren().touch();
► Query
String query
String query = "from
from
org.polepos.teams.hibernate.data.Holder2 where i2=" +
currentInt; Iterator it = em.iterate(query);
► Delete – Deletes Graph - cascading operation
#NoSQLVersant
28. Conclusions
► Wake-up, smell the coffee
p,
JOINs are not needed - unless adhoc analytics
► Take care of business, dump a load of code
Serialization is bad, data useful once structured
Mapping is Mapping, even when it’s not an ORM
► Get on your Bad Motor Scooter and Ride
NoSQL without Mapping rules the road
Get the Code: http://www.polepos.org
#NoSQLVersant