SlideShare ist ein Scribd-Unternehmen logo
1 von 28
© 2014 Aerospike. All rights reserved â€č#â€ș
That ORM is Lying to You
Ronen Botzer
Aerospike
© 2014 Aerospike. All rights reserved â€č#â€ș
Preamble
■ I owe you at least one slide that fits the abstract’s style.Âč
■ Your ORM is not unlike a crazy significant-other.ÂČ
■ You’ve been told you need to go steady. That passed-down logic
is so old you forgot (or never knew) where it came from.
■ You’ve dated, now you’ve settled down. But you feel stuck.
■ ActiveRecord, Spring, Propel, SQLAlchemy, Storm. The names
practically promised you’re going to get some action. But your
ORM is more drama than action.Âł
■ You are scared to mention an end to the relationship.
■ Fear of going it alone.
■ Worry about the alternatives.
■ Fear of hysterical responses from the ORM community or others.
■ You may be in love, but others tell their horror stories.
■ I'm stopping now, since I'm approaching FIMS.
■ Let’s get to the backstory.⁔
© 2014 Aerospike. All rights reserved â€č#â€ș
Prehistory: The Relational Database Management System
■ 1970: ”A Relational Model of Data for Large Shared Data
Banks" by Edgar F. Codd describes relational modeling.Âč
■ 1974: IBM starts developing System R (first commercial
use in 1977).
■ Includes SEQUEL, a query language based on Codd’s paper,
developed by Donald Chamberlain and Raymond Boyce.ÂČ
■ System R turns into SQL/DS(1981), which becomes DB2(1983).
■ 1977: Larry Ellison co-founds SDL after being inspired by
the 1970 Codd paper.
■ 1979: Now RSI, the company releases the Oracle database, which
includes an implementation of SQL.
■ While at IBM two UC Berkeley researchers, Eugene
Wong and Michael Stonebraker are inspired by the Codd
paper and initial System R work to create Ingres.
© 2014 Aerospike. All rights reserved â€č#â€ș
Prehistory: The RDBMS [continued]
■ 1974: Ingres prototype is open sourced and is worked on
by teams of students.
■ Includes the Quel query language.Âč
■ After three years commercializing Ingres, Stonebraker returns to
UC Berkeley in 1985 and starts work on Postgres.ÂČ
■ 1984: An ex-Ingres team starts Sybase (first commercial
release in 1987).
■ Sybase includes the T-SQL query language.
■ Sybase cooperates with Microsoft which licenses its product,
rebranding it in 1992 as SQL Server.
■ 1985: Informix RDBMS includes the ISQL query engine.
■ 1995: Postgres replaces Quel with SQL closely mirroring
Oracle’s SQL. Renames to PostgreSQL.
■ 1996: An open-source RDBMS named MySQL is
released.
© 2014 Aerospike. All rights reserved â€č#â€ș
Here Come The Internets
■ 1989-1991: Tim Berners-Lee, while at CERN, works on
an information system which he names WWW, that uses
HTTP to transmit HTML from web server (CERN httpd) to
web browsers (WorldWideWeb Browser).
■ 1993: A team at NCSA led by Marc Andreessen releases
Mosaic, which becomes the first popular browser.Âč
■ Commercialization of the World-Wide Web begins around
the mid-90s.
■ 1994: Netscape's Navigator browser and Commerce Server
include the scripting language JavaScript.
■ 1995: Microsoft's Internet Explorer browser and Internet
Information Server (IIS).
■ 1996: IIS gets an add-on scripting language, ASP.
© 2014 Aerospike. All rights reserved â€č#â€ș
Here Come The Internets [continued]
■ Individuals, then startups use open-source tools.
■ Server-side scripting mostly done through the Common Gateway
Interface (CGI) using Perl.
■ 1997: PHP2/FI emerges as another popular CGI language, then as
a web server module (SAPI).
■ 1996: Java shows up, promising one language to rule
them all. jk, WORA, FTWÂč
■ 1999: Java 1.2. A shadow falls on Greenwood. Marketing
call it: J2EE.
© 2014 Aerospike. All rights reserved â€č#â€ș
“You Need an RDBMS”
■ Server-side engineers look around for persistent data
stores.
■ RDBMSs are what experienced engineers and recent
computer science graduates are familiar with.
■ The open-source databases MySQL and PostgreSQL are
picked up heavily by small projects and startups.
■ At first, scripts make direct use of SQL.
■ Data is loaded manually from SQL query results.
■ On writes, application-side data is broken up into one or more
DML operations (INSERT/UPDATE).
■ The concept of a persistent data store becomes
conflated with RDBMS at this point.
© 2014 Aerospike. All rights reserved â€č#â€ș
“You Need an ORM”
■ J2EE ❀ Patterns. 😍😍😍
■ "You can’t be enterprise gradeℱ without them!"
■ Relevant patterns: Business Objects, Database Abstraction Layer
(DBAL) / Data Access Layer (DAL), Data Access Objects
(database specific mappers), and later Active Record (2003).
■ Incessant chatter by the Java marketing machine ensues.Âč
■ The "patterns" meme even invades the minds of once
hacker-minded, scripting-oriented developers.ÂČ
■ Everybody and their grandmother writes an ORM.
■ 16 years later, this has not stopped.³
■ There are well over 100 published ORMs.
■ PHP, for example, is still spewing new ORMs.
■ You write your ORM or join one of many warring camps.
© 2014 Aerospike. All rights reserved â€č#â€ș
Should we be using an ORM
to talk to the RDBMS?
© 2014 Aerospike. All rights reserved â€č#â€ș
The Good Aspects of ORM
■ CRUD operations on a single table have repetitive
SQL/DML. An ORM reduces that boilerplate code.
■ Decent ORMs are mostly config-free.
■ Generate access methods for business objects by inspecting the
schema of the matching tables.
■ Allegedly, ORMs allows ‘non-SQL’ developers to work
against an RDBMS blissfully unaware.
■ Decent ORMs cache data, reducing the load on the
RDBMS.Âč
© 2014 Aerospike. All rights reserved â€č#â€ș
Some Bad Aspects of ORM

© 2014 Aerospike. All rights reserved â€č#â€ș
The Bad: Leaky Abstraction
■ The notion that ORMs support ‘non-SQL’ developers is a
hoax.Âč
■ Mapping new classes to the relational model requires an
understanding of DDL.
■ Modifications to the data model (migrations) do too.ÂČ
■ When you use an ORM your code usually ends up looking
like SQL anyway. Doctrine example: Âł
$query = $conn->createQueryBuilder()
->select('u')
->from('users', 'u')
->where('u.id = :user_id')
->setParameter(':user_id', 1);
SELECT * FROM users AS WHERE id = 1
© 2014 Aerospike. All rights reserved â€č#â€ș
The Bad: A Lowest Common Denominator Database
■ A DBAL is a good idea if you are writing very generic
software for wide distribution, like a CMS.Âč
■ Popular DBALs are like politicians - they need to appeal to the
dumbest database in the group.ÂČ
■ Like politicians, ORMs promote themselves with soothing
authoritative statements about how all data persistence problems
can be solved with one dogma

■ Lowest common denominator features miss out on
optimizations specific to your database.Âł
■ Abstraction inversion: missing features must be emulated.
■ Abstractions slow down your application with extra code.
■ Functional dependency.⁔
■ The notion that a DBAL allows you to switch databases
with ease is silly.⁶
© 2014 Aerospike. All rights reserved â€č#â€ș
The Bad: Speed and Resource Consumption
■ CRUD operations are slower with an ORM.Âč
■ Using an ORM for Queries, especially ones JOINing
tables is even slower.
■ Generated SQL is often hideously slow and expensive.ÂČ
■ SQL is a robust query language, native to the RDBMS.
■ If your ORM has problems coming up with the correct JOINs you
will inevitably see slow queries that eat up a lot of CPU and
memory.
■ ORMs facilitate bad coding. The “n+1” problem.³
© 2014 Aerospike. All rights reserved â€č#â€ș
– High Scalability blog
‘The Case Against ORM Frameworks In
High Scalability Architectures’, 2008
“ORM frameworks are built to serve as wide an
audience as possible and while their success is
unquestionable in the commodity/middle market, they
are not and cannot possibly be tooled to
accommodate the atypical demands of high scalability
architecture.”
© 2014 Aerospike. All rights reserved â€č#â€ș
Laurie Voss, CTO at npmjs
"In Defense of SQL", 2010
http://seldo.com/weblog/2010/07/12/in_de
fence_of_sql
“ORM is slower than just using SQL, because abstraction
layers always are. But unlike other abstraction layers,
which make up for their performance hit with faster
development, ORM layers add almost nothing.“
“I want to be very, very clear about this: ORM is a stupid
idea.”
© 2014 Aerospike. All rights reserved â€č#â€ș
Mattias Geniar, Developer at Nucleus
"Bad ORM is infinitely worse than bad
SQL", 2012
http://ma.ttias.be/bad-orm-is-infinitely-
worse-than-bad-sql/
“As more and more developers use only ORM to create
applications, they lose their touch with the database
interaction, the queries behind it, the reasoning of why to
use a certain kind of query, the performance impact of an
INNER or OUTER joins, ...”
© 2014 Aerospike. All rights reserved â€č#â€ș
Ted Neward, 2006 [Updated 2012]
http://blogs.tedneward.com/2006/06/26/Th
e+Vietnam+Of+Computer+Science.aspx
“Object-Relational Mapping is the Vietnam of Computer
Science”
© 2014 Aerospike. All rights reserved â€č#â€ș
Is an RDBMS The Right Data
Store?
© 2014 Aerospike. All rights reserved â€č#â€ș
Do You Really Need an RDBMS?
■ The majority of ORMs are tightly coupled with RDBMS.
■ Impedance Mismatch.Âč
■ OO notions such as encapsulation (hiding representation),
private/public accessibility, inheritance and polymorphism do not
map to an RDBMs.ÂČ
■ Major difference in data types. RDBMSs only support scalar types
such as integer and string.Âł
■ Manipulation of data in objects is imperative, and usually operates
on lists and maps. In an RDBMS it’s declarative.
■ Transactional differences - granularity of transaction for object is
an individual assignment modifying its attribute. RDBMSs use
much larger sets of operations, and are inefficient at updating the
value of a single field.
© 2014 Aerospike. All rights reserved â€č#â€ș
Do You Really Need an RDBMS? [continued]
■ Normalization kills web applications.Âč
■ The goal in the 70s and 80s when normalization was formalized by
Codd and Boyce was for the data to be as small as possible.
■ The goal since the late 90s and web applications is speed.
■ No web application that is open to a global audience via
desktop and mobile apps is even in third normal form.ÂČ
■ Web applications quickly devolve to lower forms of normalization
(denormalization).
■ RESTful APIs are a particular example of modeling for the internet
age which is essentially single-table access.
http://example.com/api/:resource/:id
© 2014 Aerospike. All rights reserved â€č#â€ș
So
 what should I use in my
application?
© 2014 Aerospike. All rights reserved â€č#â€ș
Perhaps You Actually Need a Key-Value Store
■ Don’t expect to go generic and get performance.
■ If you choose a specific database know why you’re doing so, and
optimize your app to its characteristics.
■ Use minimal abstractions, as they make sense to your particular
case (native client vs. ORM).Âč
■ Key-value stores are often a more natural kind of data
store for a web application than an RDBMS.ÂČ
■ Support complex types which alleviate the need for a one:many
relationship to be expressed as a JOIN between two tables.
■ If you’re using an RDBMS as a key-value store, STOP. Use
something designed to do those operations much faster, with lower
latency.
■ If your database is fast enough you don’t need a cache nor
caching logic. Was caching your excuse? Less code means a
leaner, faster application, with less opportunity for bugs.
■ Don't shard yourself.³
© 2014 Aerospike. All rights reserved â€č#â€ș
How do we do it?
© 2014 Aerospike. All rights reserved â€č#â€ș
WRITING RELIABLY WITH HIGH PERFORMANCE
1. Write sent to row master
2. Latch against simultaneous writes
3. Apply write to master memory and replica
memory synchronously
4. Queue operations to disk
5. Signal completed transaction (optional storage
commit wait)
6. Master applies conflict resolution policy
(rollback/ rollforward)
master replica
1. Cluster discovers new node via gossip protocol
2. Paxos vote determines new data organization
3. Partition migrations scheduled
4. When a partition migration starts, write journal starts
on destination
5. Partition moves atomically
6. Journal is applied and source data deleted
transactions
continue
Writing with Immediate Consistency Adding a Node
© 2014 Aerospike. All rights reserved â€č#â€ș
DATABASE
OS FILE SYSTEM
PAGE CACHE
BLOCK INTERFACE
SSD HDD
BLOCK INTERFACE
SSD SSD
OPEN NVM
SSD
Ask me and I’ll tell you the answer.Ask me. I’ll look up the answer and then tell it to
you.
DATABASE
HYBRID MEMORY SYSTEMℱ
‱Direct device access
‱Large Block Writes
‱Indexes in DRAM
‱Highly Parallelized
‱Log-structured FS “copy-on-write”
‱Fast restart with shared memory
FLASH OPTIMIZED HIGH
PERFORMANCE
© 2014 Aerospike. All rights reserved â€č#â€ș
SHARED-NOTHING SYSTEM:100% DATA AVAILABILITY
■ Every node in a cluster is identical,
handles both transactions and long
running tasks
■ Data is replicated synchronously with
immediate consistency within the cluster
■ Data is replicated asynchronously
across data centers
OHIO Data Center
© 2014 Aerospike. All rights reserved â€č#â€ș

Weitere Àhnliche Inhalte

Was ist angesagt?

Hadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
Hadoop World 2011: Advanced HBase Schema Design - Lars George, ClouderaHadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
Hadoop World 2011: Advanced HBase Schema Design - Lars George, ClouderaCloudera, Inc.
 
Lessons Learned from Dockerizing Spark Workloads
Lessons Learned from Dockerizing Spark WorkloadsLessons Learned from Dockerizing Spark Workloads
Lessons Learned from Dockerizing Spark WorkloadsBlueData, Inc.
 
SD Big Data Monthly Meetup #4 - Session 2 - WANDisco
SD Big Data Monthly Meetup #4 - Session 2 - WANDiscoSD Big Data Monthly Meetup #4 - Session 2 - WANDisco
SD Big Data Monthly Meetup #4 - Session 2 - WANDiscoBig Data Joeℱ Rossi
 
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...SpringPeople
 
The Rise of NoSQL and Polyglot Persistence
The Rise of NoSQL and Polyglot PersistenceThe Rise of NoSQL and Polyglot Persistence
The Rise of NoSQL and Polyglot PersistenceAbdelmonaim Remani
 
HDFS Tiered Storage: Mounting Object Stores in HDFS
HDFS Tiered Storage: Mounting Object Stores in HDFSHDFS Tiered Storage: Mounting Object Stores in HDFS
HDFS Tiered Storage: Mounting Object Stores in HDFSDataWorks Summit
 
Polyglot Persistence - Two Great Tastes That Taste Great Together
Polyglot Persistence - Two Great Tastes That Taste Great TogetherPolyglot Persistence - Two Great Tastes That Taste Great Together
Polyglot Persistence - Two Great Tastes That Taste Great TogetherJohn Wood
 
Storage for VDI
Storage for VDIStorage for VDI
Storage for VDIHoward Marks
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsJonas Bonér
 
A Hitchhiker's Guide to NOSQL v1.0
A Hitchhiker's Guide to NOSQL v1.0A Hitchhiker's Guide to NOSQL v1.0
A Hitchhiker's Guide to NOSQL v1.0Krishna Sankar
 
Intro to cassandra
Intro to cassandraIntro to cassandra
Intro to cassandraAaron Ploetz
 
Introduction to hadoop V2
Introduction to hadoop V2Introduction to hadoop V2
Introduction to hadoop V2TarjeiRomtveit
 
Farming hadoop in_the_cloud
Farming hadoop in_the_cloudFarming hadoop in_the_cloud
Farming hadoop in_the_cloudSteve Loughran
 
Facebook keynote-nicolas-qcon
Facebook keynote-nicolas-qconFacebook keynote-nicolas-qcon
Facebook keynote-nicolas-qconYiwei Ma
 
Storage and-compute-hdfs-map reduce
Storage and-compute-hdfs-map reduceStorage and-compute-hdfs-map reduce
Storage and-compute-hdfs-map reduceChris Nauroth
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in JavaRuben BadarĂł
 
Hadoop Operations - Best Practices from the Field
Hadoop Operations - Best Practices from the FieldHadoop Operations - Best Practices from the Field
Hadoop Operations - Best Practices from the FieldDataWorks Summit
 
NoSQL Seminer
NoSQL SeminerNoSQL Seminer
NoSQL SeminerPartha Das
 
Dave Shuttleworth - Platform performance comparisons, bare metal and cloud ho...
Dave Shuttleworth - Platform performance comparisons, bare metal and cloud ho...Dave Shuttleworth - Platform performance comparisons, bare metal and cloud ho...
Dave Shuttleworth - Platform performance comparisons, bare metal and cloud ho...huguk
 

Was ist angesagt? (20)

Hadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
Hadoop World 2011: Advanced HBase Schema Design - Lars George, ClouderaHadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
Hadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
 
Lessons Learned from Dockerizing Spark Workloads
Lessons Learned from Dockerizing Spark WorkloadsLessons Learned from Dockerizing Spark Workloads
Lessons Learned from Dockerizing Spark Workloads
 
SD Big Data Monthly Meetup #4 - Session 2 - WANDisco
SD Big Data Monthly Meetup #4 - Session 2 - WANDiscoSD Big Data Monthly Meetup #4 - Session 2 - WANDisco
SD Big Data Monthly Meetup #4 - Session 2 - WANDisco
 
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
 
The Rise of NoSQL and Polyglot Persistence
The Rise of NoSQL and Polyglot PersistenceThe Rise of NoSQL and Polyglot Persistence
The Rise of NoSQL and Polyglot Persistence
 
NoSQL_Night
NoSQL_NightNoSQL_Night
NoSQL_Night
 
HDFS Tiered Storage: Mounting Object Stores in HDFS
HDFS Tiered Storage: Mounting Object Stores in HDFSHDFS Tiered Storage: Mounting Object Stores in HDFS
HDFS Tiered Storage: Mounting Object Stores in HDFS
 
Polyglot Persistence - Two Great Tastes That Taste Great Together
Polyglot Persistence - Two Great Tastes That Taste Great TogetherPolyglot Persistence - Two Great Tastes That Taste Great Together
Polyglot Persistence - Two Great Tastes That Taste Great Together
 
Storage for VDI
Storage for VDIStorage for VDI
Storage for VDI
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
 
A Hitchhiker's Guide to NOSQL v1.0
A Hitchhiker's Guide to NOSQL v1.0A Hitchhiker's Guide to NOSQL v1.0
A Hitchhiker's Guide to NOSQL v1.0
 
Intro to cassandra
Intro to cassandraIntro to cassandra
Intro to cassandra
 
Introduction to hadoop V2
Introduction to hadoop V2Introduction to hadoop V2
Introduction to hadoop V2
 
Farming hadoop in_the_cloud
Farming hadoop in_the_cloudFarming hadoop in_the_cloud
Farming hadoop in_the_cloud
 
Facebook keynote-nicolas-qcon
Facebook keynote-nicolas-qconFacebook keynote-nicolas-qcon
Facebook keynote-nicolas-qcon
 
Storage and-compute-hdfs-map reduce
Storage and-compute-hdfs-map reduceStorage and-compute-hdfs-map reduce
Storage and-compute-hdfs-map reduce
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in Java
 
Hadoop Operations - Best Practices from the Field
Hadoop Operations - Best Practices from the FieldHadoop Operations - Best Practices from the Field
Hadoop Operations - Best Practices from the Field
 
NoSQL Seminer
NoSQL SeminerNoSQL Seminer
NoSQL Seminer
 
Dave Shuttleworth - Platform performance comparisons, bare metal and cloud ho...
Dave Shuttleworth - Platform performance comparisons, bare metal and cloud ho...Dave Shuttleworth - Platform performance comparisons, bare metal and cloud ho...
Dave Shuttleworth - Platform performance comparisons, bare metal and cloud ho...
 

Ähnlich wie That ORM is Lying to You

Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen BrĂŠkken
 
Brian Bulkowski : what startups can learn from real-time bidding
Brian Bulkowski : what startups can learn from real-time biddingBrian Bulkowski : what startups can learn from real-time bidding
Brian Bulkowski : what startups can learn from real-time biddingAerospike
 
Why Traditional Databases Fail so Miserably to Scale with E-Commerce Site Growth
Why Traditional Databases Fail so Miserably to Scale with E-Commerce Site GrowthWhy Traditional Databases Fail so Miserably to Scale with E-Commerce Site Growth
Why Traditional Databases Fail so Miserably to Scale with E-Commerce Site GrowthClustrix
 
Introduction to assembler_programming_boston_2
Introduction to assembler_programming_boston_2Introduction to assembler_programming_boston_2
Introduction to assembler_programming_boston_2satyabrataDash18
 
Aerospike Architecture
Aerospike ArchitectureAerospike Architecture
Aerospike ArchitecturePeter Milne
 
CCS334 BIG DATA ANALYTICS Session 3 Distributed models.pptx
CCS334 BIG DATA ANALYTICS Session 3 Distributed models.pptxCCS334 BIG DATA ANALYTICS Session 3 Distributed models.pptx
CCS334 BIG DATA ANALYTICS Session 3 Distributed models.pptxAsst.prof M.Gokilavani
 
What enterprises can learn from Real Time Bidding (RTB)
What enterprises can learn from Real Time Bidding (RTB)What enterprises can learn from Real Time Bidding (RTB)
What enterprises can learn from Real Time Bidding (RTB)bigdatagurus_meetup
 
What enterprises can learn from Real Time Bidding
What enterprises can learn from Real Time BiddingWhat enterprises can learn from Real Time Bidding
What enterprises can learn from Real Time BiddingAerospike
 
A brave new world in mutable big data relational storage (Strata NYC 2017)
A brave new world in mutable big data  relational storage (Strata NYC 2017)A brave new world in mutable big data  relational storage (Strata NYC 2017)
A brave new world in mutable big data relational storage (Strata NYC 2017)Todd Lipcon
 
Glue con denver may 2015 sql to nosql
Glue con denver may 2015 sql to nosqlGlue con denver may 2015 sql to nosql
Glue con denver may 2015 sql to nosqlPeter Milne
 
Dynamo and NoSQL Databases
Dynamo and NoSQL DatabasesDynamo and NoSQL Databases
Dynamo and NoSQL DatabasesAmir Payberah
 
Google Developer Group Lublin 8 - Modern Lambda architecture in Big Data
Google Developer Group Lublin 8 - Modern Lambda architecture in Big Data Google Developer Group Lublin 8 - Modern Lambda architecture in Big Data
Google Developer Group Lublin 8 - Modern Lambda architecture in Big Data Hejwowski Piotr
 
Better sq lqueries
Better sq lqueriesBetter sq lqueries
Better sq lqueriesDave Stokes
 
Some news about the SW
Some news about the SWSome news about the SW
Some news about the SWIvan Herman
 
[db tech showcase Tokyo 2016] E32: My Life as a Disruptor by Jim Starkey
[db tech showcase Tokyo 2016] E32: My Life as a Disruptor by Jim Starkey[db tech showcase Tokyo 2016] E32: My Life as a Disruptor by Jim Starkey
[db tech showcase Tokyo 2016] E32: My Life as a Disruptor by Jim StarkeyInsight Technology, Inc.
 
Boston meetup : MySQL Innodb Cluster - May 1st 2017
Boston meetup : MySQL Innodb Cluster - May 1st  2017Boston meetup : MySQL Innodb Cluster - May 1st  2017
Boston meetup : MySQL Innodb Cluster - May 1st 2017Frederic Descamps
 
Recommendation engine using Aerospike and/OR MongoDB
Recommendation engine using Aerospike and/OR MongoDBRecommendation engine using Aerospike and/OR MongoDB
Recommendation engine using Aerospike and/OR MongoDBPeter Milne
 
Storing billions of images in a hybrid relational and NoSQL database using Or...
Storing billions of images in a hybrid relational and NoSQL database using Or...Storing billions of images in a hybrid relational and NoSQL database using Or...
Storing billions of images in a hybrid relational and NoSQL database using Or...Aris Prassinos
 
The tortoise and the ORM
The tortoise and the ORMThe tortoise and the ORM
The tortoise and the ORMFrikkie van Biljon
 
Introduction into CouchDB / Jan Lehnardt
Introduction into CouchDB / Jan LehnardtIntroduction into CouchDB / Jan Lehnardt
Introduction into CouchDB / Jan LehnardtBBC Web Developers
 

Ähnlich wie That ORM is Lying to You (20)

Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Brian Bulkowski : what startups can learn from real-time bidding
Brian Bulkowski : what startups can learn from real-time biddingBrian Bulkowski : what startups can learn from real-time bidding
Brian Bulkowski : what startups can learn from real-time bidding
 
Why Traditional Databases Fail so Miserably to Scale with E-Commerce Site Growth
Why Traditional Databases Fail so Miserably to Scale with E-Commerce Site GrowthWhy Traditional Databases Fail so Miserably to Scale with E-Commerce Site Growth
Why Traditional Databases Fail so Miserably to Scale with E-Commerce Site Growth
 
Introduction to assembler_programming_boston_2
Introduction to assembler_programming_boston_2Introduction to assembler_programming_boston_2
Introduction to assembler_programming_boston_2
 
Aerospike Architecture
Aerospike ArchitectureAerospike Architecture
Aerospike Architecture
 
CCS334 BIG DATA ANALYTICS Session 3 Distributed models.pptx
CCS334 BIG DATA ANALYTICS Session 3 Distributed models.pptxCCS334 BIG DATA ANALYTICS Session 3 Distributed models.pptx
CCS334 BIG DATA ANALYTICS Session 3 Distributed models.pptx
 
What enterprises can learn from Real Time Bidding (RTB)
What enterprises can learn from Real Time Bidding (RTB)What enterprises can learn from Real Time Bidding (RTB)
What enterprises can learn from Real Time Bidding (RTB)
 
What enterprises can learn from Real Time Bidding
What enterprises can learn from Real Time BiddingWhat enterprises can learn from Real Time Bidding
What enterprises can learn from Real Time Bidding
 
A brave new world in mutable big data relational storage (Strata NYC 2017)
A brave new world in mutable big data  relational storage (Strata NYC 2017)A brave new world in mutable big data  relational storage (Strata NYC 2017)
A brave new world in mutable big data relational storage (Strata NYC 2017)
 
Glue con denver may 2015 sql to nosql
Glue con denver may 2015 sql to nosqlGlue con denver may 2015 sql to nosql
Glue con denver may 2015 sql to nosql
 
Dynamo and NoSQL Databases
Dynamo and NoSQL DatabasesDynamo and NoSQL Databases
Dynamo and NoSQL Databases
 
Google Developer Group Lublin 8 - Modern Lambda architecture in Big Data
Google Developer Group Lublin 8 - Modern Lambda architecture in Big Data Google Developer Group Lublin 8 - Modern Lambda architecture in Big Data
Google Developer Group Lublin 8 - Modern Lambda architecture in Big Data
 
Better sq lqueries
Better sq lqueriesBetter sq lqueries
Better sq lqueries
 
Some news about the SW
Some news about the SWSome news about the SW
Some news about the SW
 
[db tech showcase Tokyo 2016] E32: My Life as a Disruptor by Jim Starkey
[db tech showcase Tokyo 2016] E32: My Life as a Disruptor by Jim Starkey[db tech showcase Tokyo 2016] E32: My Life as a Disruptor by Jim Starkey
[db tech showcase Tokyo 2016] E32: My Life as a Disruptor by Jim Starkey
 
Boston meetup : MySQL Innodb Cluster - May 1st 2017
Boston meetup : MySQL Innodb Cluster - May 1st  2017Boston meetup : MySQL Innodb Cluster - May 1st  2017
Boston meetup : MySQL Innodb Cluster - May 1st 2017
 
Recommendation engine using Aerospike and/OR MongoDB
Recommendation engine using Aerospike and/OR MongoDBRecommendation engine using Aerospike and/OR MongoDB
Recommendation engine using Aerospike and/OR MongoDB
 
Storing billions of images in a hybrid relational and NoSQL database using Or...
Storing billions of images in a hybrid relational and NoSQL database using Or...Storing billions of images in a hybrid relational and NoSQL database using Or...
Storing billions of images in a hybrid relational and NoSQL database using Or...
 
The tortoise and the ORM
The tortoise and the ORMThe tortoise and the ORM
The tortoise and the ORM
 
Introduction into CouchDB / Jan Lehnardt
Introduction into CouchDB / Jan LehnardtIntroduction into CouchDB / Jan Lehnardt
Introduction into CouchDB / Jan Lehnardt
 

KĂŒrzlich hochgeladen

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžDelhi Call girls
 
CALL ON ➄8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➄8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➄8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➄8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

KĂŒrzlich hochgeladen (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
 
CALL ON ➄8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➄8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➄8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➄8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Vip Call Girls Noida âžĄïž Delhi âžĄïž 9999965857 No Advance 24HRS Live
Vip Call Girls Noida âžĄïž Delhi âžĄïž 9999965857 No Advance 24HRS LiveVip Call Girls Noida âžĄïž Delhi âžĄïž 9999965857 No Advance 24HRS Live
Vip Call Girls Noida âžĄïž Delhi âžĄïž 9999965857 No Advance 24HRS Live
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

That ORM is Lying to You

  • 1. © 2014 Aerospike. All rights reserved â€č#â€ș That ORM is Lying to You Ronen Botzer Aerospike
  • 2. © 2014 Aerospike. All rights reserved â€č#â€ș Preamble ■ I owe you at least one slide that fits the abstract’s style.Âč ■ Your ORM is not unlike a crazy significant-other.ÂČ â–  You’ve been told you need to go steady. That passed-down logic is so old you forgot (or never knew) where it came from. ■ You’ve dated, now you’ve settled down. But you feel stuck. ■ ActiveRecord, Spring, Propel, SQLAlchemy, Storm. The names practically promised you’re going to get some action. But your ORM is more drama than action.Âł ■ You are scared to mention an end to the relationship. ■ Fear of going it alone. ■ Worry about the alternatives. ■ Fear of hysterical responses from the ORM community or others. ■ You may be in love, but others tell their horror stories. ■ I'm stopping now, since I'm approaching FIMS.⁎ ■ Let’s get to the backstory.⁔
  • 3. © 2014 Aerospike. All rights reserved â€č#â€ș Prehistory: The Relational Database Management System ■ 1970: ”A Relational Model of Data for Large Shared Data Banks" by Edgar F. Codd describes relational modeling.Âč ■ 1974: IBM starts developing System R (first commercial use in 1977). ■ Includes SEQUEL, a query language based on Codd’s paper, developed by Donald Chamberlain and Raymond Boyce.ÂČ â–  System R turns into SQL/DS(1981), which becomes DB2(1983). ■ 1977: Larry Ellison co-founds SDL after being inspired by the 1970 Codd paper. ■ 1979: Now RSI, the company releases the Oracle database, which includes an implementation of SQL. ■ While at IBM two UC Berkeley researchers, Eugene Wong and Michael Stonebraker are inspired by the Codd paper and initial System R work to create Ingres.
  • 4. © 2014 Aerospike. All rights reserved â€č#â€ș Prehistory: The RDBMS [continued] ■ 1974: Ingres prototype is open sourced and is worked on by teams of students. ■ Includes the Quel query language.Âč ■ After three years commercializing Ingres, Stonebraker returns to UC Berkeley in 1985 and starts work on Postgres.ÂČ â–  1984: An ex-Ingres team starts Sybase (first commercial release in 1987). ■ Sybase includes the T-SQL query language. ■ Sybase cooperates with Microsoft which licenses its product, rebranding it in 1992 as SQL Server. ■ 1985: Informix RDBMS includes the ISQL query engine. ■ 1995: Postgres replaces Quel with SQL closely mirroring Oracle’s SQL. Renames to PostgreSQL. ■ 1996: An open-source RDBMS named MySQL is released.
  • 5. © 2014 Aerospike. All rights reserved â€č#â€ș Here Come The Internets ■ 1989-1991: Tim Berners-Lee, while at CERN, works on an information system which he names WWW, that uses HTTP to transmit HTML from web server (CERN httpd) to web browsers (WorldWideWeb Browser). ■ 1993: A team at NCSA led by Marc Andreessen releases Mosaic, which becomes the first popular browser.Âč ■ Commercialization of the World-Wide Web begins around the mid-90s. ■ 1994: Netscape's Navigator browser and Commerce Server include the scripting language JavaScript. ■ 1995: Microsoft's Internet Explorer browser and Internet Information Server (IIS). ■ 1996: IIS gets an add-on scripting language, ASP.
  • 6. © 2014 Aerospike. All rights reserved â€č#â€ș Here Come The Internets [continued] ■ Individuals, then startups use open-source tools. ■ Server-side scripting mostly done through the Common Gateway Interface (CGI) using Perl. ■ 1997: PHP2/FI emerges as another popular CGI language, then as a web server module (SAPI). ■ 1996: Java shows up, promising one language to rule them all. jk, WORA, FTWÂč ■ 1999: Java 1.2. A shadow falls on Greenwood. Marketing call it: J2EE.
  • 7. © 2014 Aerospike. All rights reserved â€č#â€ș “You Need an RDBMS” ■ Server-side engineers look around for persistent data stores. ■ RDBMSs are what experienced engineers and recent computer science graduates are familiar with. ■ The open-source databases MySQL and PostgreSQL are picked up heavily by small projects and startups. ■ At first, scripts make direct use of SQL. ■ Data is loaded manually from SQL query results. ■ On writes, application-side data is broken up into one or more DML operations (INSERT/UPDATE). ■ The concept of a persistent data store becomes conflated with RDBMS at this point.
  • 8. © 2014 Aerospike. All rights reserved â€č#â€ș “You Need an ORM” ■ J2EE ❀ Patterns. 😍😍😍 ■ "You can’t be enterprise gradeℱ without them!" ■ Relevant patterns: Business Objects, Database Abstraction Layer (DBAL) / Data Access Layer (DAL), Data Access Objects (database specific mappers), and later Active Record (2003). ■ Incessant chatter by the Java marketing machine ensues.Âč ■ The "patterns" meme even invades the minds of once hacker-minded, scripting-oriented developers.ÂČ â–  Everybody and their grandmother writes an ORM. ■ 16 years later, this has not stopped.Âł ■ There are well over 100 published ORMs. ■ PHP, for example, is still spewing new ORMs.⁎ ■ You write your ORM or join one of many warring camps.
  • 9. © 2014 Aerospike. All rights reserved â€č#â€ș Should we be using an ORM to talk to the RDBMS?
  • 10. © 2014 Aerospike. All rights reserved â€č#â€ș The Good Aspects of ORM ■ CRUD operations on a single table have repetitive SQL/DML. An ORM reduces that boilerplate code. ■ Decent ORMs are mostly config-free. ■ Generate access methods for business objects by inspecting the schema of the matching tables. ■ Allegedly, ORMs allows ‘non-SQL’ developers to work against an RDBMS blissfully unaware. ■ Decent ORMs cache data, reducing the load on the RDBMS.Âč
  • 11. © 2014 Aerospike. All rights reserved â€č#â€ș Some Bad Aspects of ORM

  • 12. © 2014 Aerospike. All rights reserved â€č#â€ș The Bad: Leaky Abstraction ■ The notion that ORMs support ‘non-SQL’ developers is a hoax.Âč ■ Mapping new classes to the relational model requires an understanding of DDL. ■ Modifications to the data model (migrations) do too.ÂČ â–  When you use an ORM your code usually ends up looking like SQL anyway. Doctrine example: Âł $query = $conn->createQueryBuilder() ->select('u') ->from('users', 'u') ->where('u.id = :user_id') ->setParameter(':user_id', 1); SELECT * FROM users AS WHERE id = 1
  • 13. © 2014 Aerospike. All rights reserved â€č#â€ș The Bad: A Lowest Common Denominator Database ■ A DBAL is a good idea if you are writing very generic software for wide distribution, like a CMS.Âč ■ Popular DBALs are like politicians - they need to appeal to the dumbest database in the group.ÂČ â–  Like politicians, ORMs promote themselves with soothing authoritative statements about how all data persistence problems can be solved with one dogma
 ■ Lowest common denominator features miss out on optimizations specific to your database.Âł ■ Abstraction inversion: missing features must be emulated.⁎ ■ Abstractions slow down your application with extra code. ■ Functional dependency.⁔ ■ The notion that a DBAL allows you to switch databases with ease is silly.⁶
  • 14. © 2014 Aerospike. All rights reserved â€č#â€ș The Bad: Speed and Resource Consumption ■ CRUD operations are slower with an ORM.Âč ■ Using an ORM for Queries, especially ones JOINing tables is even slower. ■ Generated SQL is often hideously slow and expensive.ÂČ â–  SQL is a robust query language, native to the RDBMS. ■ If your ORM has problems coming up with the correct JOINs you will inevitably see slow queries that eat up a lot of CPU and memory. ■ ORMs facilitate bad coding. The “n+1” problem.Âł
  • 15. © 2014 Aerospike. All rights reserved â€č#â€ș – High Scalability blog ‘The Case Against ORM Frameworks In High Scalability Architectures’, 2008 “ORM frameworks are built to serve as wide an audience as possible and while their success is unquestionable in the commodity/middle market, they are not and cannot possibly be tooled to accommodate the atypical demands of high scalability architecture.”
  • 16. © 2014 Aerospike. All rights reserved â€č#â€ș Laurie Voss, CTO at npmjs "In Defense of SQL", 2010 http://seldo.com/weblog/2010/07/12/in_de fence_of_sql “ORM is slower than just using SQL, because abstraction layers always are. But unlike other abstraction layers, which make up for their performance hit with faster development, ORM layers add almost nothing.“ “I want to be very, very clear about this: ORM is a stupid idea.”
  • 17. © 2014 Aerospike. All rights reserved â€č#â€ș Mattias Geniar, Developer at Nucleus "Bad ORM is infinitely worse than bad SQL", 2012 http://ma.ttias.be/bad-orm-is-infinitely- worse-than-bad-sql/ “As more and more developers use only ORM to create applications, they lose their touch with the database interaction, the queries behind it, the reasoning of why to use a certain kind of query, the performance impact of an INNER or OUTER joins, ...”
  • 18. © 2014 Aerospike. All rights reserved â€č#â€ș Ted Neward, 2006 [Updated 2012] http://blogs.tedneward.com/2006/06/26/Th e+Vietnam+Of+Computer+Science.aspx “Object-Relational Mapping is the Vietnam of Computer Science”
  • 19. © 2014 Aerospike. All rights reserved â€č#â€ș Is an RDBMS The Right Data Store?
  • 20. © 2014 Aerospike. All rights reserved â€č#â€ș Do You Really Need an RDBMS? ■ The majority of ORMs are tightly coupled with RDBMS. ■ Impedance Mismatch.Âč ■ OO notions such as encapsulation (hiding representation), private/public accessibility, inheritance and polymorphism do not map to an RDBMs.ÂČ â–  Major difference in data types. RDBMSs only support scalar types such as integer and string.Âł ■ Manipulation of data in objects is imperative, and usually operates on lists and maps. In an RDBMS it’s declarative. ■ Transactional differences - granularity of transaction for object is an individual assignment modifying its attribute. RDBMSs use much larger sets of operations, and are inefficient at updating the value of a single field.
  • 21. © 2014 Aerospike. All rights reserved â€č#â€ș Do You Really Need an RDBMS? [continued] ■ Normalization kills web applications.Âč ■ The goal in the 70s and 80s when normalization was formalized by Codd and Boyce was for the data to be as small as possible. ■ The goal since the late 90s and web applications is speed. ■ No web application that is open to a global audience via desktop and mobile apps is even in third normal form.ÂČ â–  Web applications quickly devolve to lower forms of normalization (denormalization). ■ RESTful APIs are a particular example of modeling for the internet age which is essentially single-table access. http://example.com/api/:resource/:id
  • 22. © 2014 Aerospike. All rights reserved â€č#â€ș So
 what should I use in my application?
  • 23. © 2014 Aerospike. All rights reserved â€č#â€ș Perhaps You Actually Need a Key-Value Store ■ Don’t expect to go generic and get performance. ■ If you choose a specific database know why you’re doing so, and optimize your app to its characteristics. ■ Use minimal abstractions, as they make sense to your particular case (native client vs. ORM).Âč ■ Key-value stores are often a more natural kind of data store for a web application than an RDBMS.ÂČ â–  Support complex types which alleviate the need for a one:many relationship to be expressed as a JOIN between two tables. ■ If you’re using an RDBMS as a key-value store, STOP. Use something designed to do those operations much faster, with lower latency. ■ If your database is fast enough you don’t need a cache nor caching logic. Was caching your excuse? Less code means a leaner, faster application, with less opportunity for bugs. ■ Don't shard yourself.Âł
  • 24. © 2014 Aerospike. All rights reserved â€č#â€ș How do we do it?
  • 25. © 2014 Aerospike. All rights reserved â€č#â€ș WRITING RELIABLY WITH HIGH PERFORMANCE 1. Write sent to row master 2. Latch against simultaneous writes 3. Apply write to master memory and replica memory synchronously 4. Queue operations to disk 5. Signal completed transaction (optional storage commit wait) 6. Master applies conflict resolution policy (rollback/ rollforward) master replica 1. Cluster discovers new node via gossip protocol 2. Paxos vote determines new data organization 3. Partition migrations scheduled 4. When a partition migration starts, write journal starts on destination 5. Partition moves atomically 6. Journal is applied and source data deleted transactions continue Writing with Immediate Consistency Adding a Node
  • 26. © 2014 Aerospike. All rights reserved â€č#â€ș DATABASE OS FILE SYSTEM PAGE CACHE BLOCK INTERFACE SSD HDD BLOCK INTERFACE SSD SSD OPEN NVM SSD Ask me and I’ll tell you the answer.Ask me. I’ll look up the answer and then tell it to you. DATABASE HYBRID MEMORY SYSTEMℱ ‱Direct device access ‱Large Block Writes ‱Indexes in DRAM ‱Highly Parallelized ‱Log-structured FS “copy-on-write” ‱Fast restart with shared memory FLASH OPTIMIZED HIGH PERFORMANCE
  • 27. © 2014 Aerospike. All rights reserved â€č#â€ș SHARED-NOTHING SYSTEM:100% DATA AVAILABILITY ■ Every node in a cluster is identical, handles both transactions and long running tasks ■ Data is replicated synchronously with immediate consistency within the cluster ■ Data is replicated asynchronously across data centers OHIO Data Center
  • 28. © 2014 Aerospike. All rights reserved â€č#â€ș

Hinweis der Redaktion

  1. Hi, my name is Ronen Botzer, and if my shirt didn't give it away already, I'm an engineer at Aerospike. I help to get the clients for dynamic languages to a fully featured state. I wanted to thank Ed and Diana from SouthBay PHP and Claire from Scale Warriors of Silicon Valley for organizing this meetup. I've worked in a stream of startups since 1999. First as an engineer in several web teams. Next as a data engineer at an ad-network, a social network, and a mobile SDK vendor (Appcelerator), where we were handling larger volumes of data each time. Most recently I was the architect for a mobile parking startup called QuickPay. I have a hard time staying serious. You probably noticed that the abstract for this talk invoked a pseduo-relationship metaphor. Objects and relationships, get it? Yeah, that gets tired as a joke fairly quickly. I am guilty of doing pretty much everything I'm going to mention in this talk.
  2. We can expand on it over beers later, but here goes You fill in girlfriend/boyfriend as you see fit Ok, fine, there also names like Hibernate for the subdued "let's watch a period piece movie on the couch" metaphor. But in general, your ORM slows down your data access with its code abstractions. It produces suboptimal performance. Can someone decipher the acronym? How did we get stuck with applications "needing" an ORM layer above an RDBMS?
  3. An interesting guy who earned degrees in math and chemistry, served as a RAF pilot in WW2, and then worked for IBM as an actual ‘programmer’. He gets his PhD at UMich, and moves to IBM’s San Jose Research Center. Later renamed SQL due to copyright issues.
  4. A bad decision in hindsight, as during the early 80s Oracle’s SQL proves more popular, and is a reason for Ingres slipping in share of deployments. A post-Ingres database that includes his insights about system architecture.
  5. Who knows what's so special about Mosaic? Yes! a GUI!
  6. Can someone please translate WORA? Write Once Run Anywhere.
  7. Some software architects quit their day jobs and settle on the profitable business of spreading the Gospel of Patterns. Writing voluminous books they continue to unearth new ways for us all to get more enterprise-y. It was like Invasion of The Body Snatchers. Everybody you knew in the late 90s had at least one book about design patterns. If you acted like you found those cumbersome or a waste of time they’d point and go <hhhhhhh> Seriously, if a language is lucky and it had one gorilla show up early (like ActiveRecord along with Ruby-on-Rails) it will have ONLY 4-5 ORMs. Java, PHP? You’re in the dozens of known ORMs. Likely one ORM per-startup that never got published. There are well over 100 published ones Laravel has Eloquent ORM, and I’ve just seen a twitter shit storm of people critiquing it and threatening Taylor Otwell with statements like "You haven't seen what I've been working on the last four years
Be scared, be very scared". Well, I personally am scared.
  8. Which is one tell-tale sign that such a database is not designed to scale.
  9. An ORM user who is 'non-SQL' is a unicorn. If you see one, grab him by the bald head, rub it, and demand three wishes. :: A leaky abstraction refers to the way implementation details become visible through the abstraction when the operation is more complex (Joel Spolsky). Schemas are rigid, so developers need to have understanding of SQL, DML, and DDL. You can’t change a schema as easily as an object - you need migrations. Therefore you learn SQL anyway. For example ‘the best’ ORMs support a fluent style, which basically is pseudo SQL
  10. Something that has to run against some unknown data store. The web applications with the highest loads (Facebook, Twitter, MediaWiki) are not portable. Shocking fact: RDBMSs do not implement SQL the same way. Sometimes really good ones like hints for the query optimizer. When an ORM hides direct access to a database feature, then re-implements on the application-side. Auto increment. Your app is not just dependent on your database, but also on the DBAL. Now you can have data access and persistence bugs in two places, and you have to worry whether two technologies you depend on will become obsolete. Show of hands - does anybody think that switching a web application from one database to the next is trivial if you use a DBAL?
  11. ORMs are overhead, see the previous SELECT wrapper example. Allegedly you don’t need a specialist such as a DBA if you use an ORM. But if you want to figure out why your ORM is generating slow queries you’ll need to get one, or become an expert. At which point you need to hope your ORM makes it easy to switch to a raw query. Queries fetch individual relationships in a loop when we have a many:one relationships instead of a properly using a join.
  12. The philosophy and behavior of objects and RDBMSs doesn’t match up well. This is a big topic. Some ORMs like ActiveRecord do address class hierarchies with a ‘type’ column. Data structures on the application side are not - lists, maps, sets, etc. Complex data types are poorly expressed in RDBMSs.
  13. If you don't know what first, second, third, boyce-codd normal form, etc is, I won't get into it in detail now. Unless it wants to melt down early and often. Fail whales abound.
  14. WikiMedia example - direct access to MySQL and PostgreSQL If you’ve been viewing SQL as something ugly you need to abstract away from, hello! Use NoSQL. Your persistence operations become much closer to how your application side objects behave Stop making up for the inadequacies of your database by manually clustering. Remove sharding logic from your application. Again, faster and leaner application on top of a faster, leaner stack.
  15. * Doesn't hurt to have founders who have been at a big internet company and saw first hand how massive loads bring traditional databases to their knees. * What design works: with new hardware new designs can perform better. Always develop with the current and upcoming hardware in mind. optimize on those hardware technology advances - utilize all cores, make optimal use of memory, use the best disk access patterns (low IOPS bulk reads for example). voltDB wrote an in-memory column-oriented database with a SQL dialect, but thinks about rotational disks for storage. Redis runs fully in-memory with weak durability (1 second fsync at best for the AOF) Aerospike utilizes flash as storage and additional memory in a hybrid system with DRAM, because it is the most economical way to scale, while keeping speed advantage and predictable low latency as a feature.
  16. Aerospike is a real distributed database. Clustering was built-in from the very beginning and is core to the operation and performance on the database. It is not an after-the-fact bolted-on feature. masterless with replication Smart client connects and learns about the cluster topology. It only needs a single IP address. records are identified by a RIPEMD-160 digest of the PK. indexes are always 20-bytes. The client knows the partition map and will seek to write to the master and replica partitions synchronously. The client knows which partition to read a record from, and knows where the replica is for failover. Stop writing sharding logic
  17. Scaling in DRAM only is simply not economical. SSDs are formatted, no filesystem, memory mapped I/O. Raw device, direct access pattern. Indexes are kept in DRAM to save on an extra IOP. Enterprise feature: fast restart (shared-memory) Records ('rows') in sets ('tables') are kept contiguous for efficient bulk reads. Each time a write happens the record is written to a new block, with the previous one marked for GC. This ensures an even wear on the flash drive.