Forget the ORM!
  Persistent data with
Non-traditional Databases
              By Randal L. Schwartz,
      Stonehenge Consulting Services, Inc.
          <merlyn@stonehenge.com>
      http://www.stonehenge.com/merlyn/
          version 1.2 at 13 April 2010
What we are covering
What we are covering


• What is an Object-Relational-Mapper?
What we are covering


• What is an Object-Relational-Mapper?
• Why is it evil?
What we are covering


• What is an Object-Relational-Mapper?
• Why is it evil?
• What are the alternatives?
Brief review of ORMs
Brief review of ORMs

• Objects in memory
Brief review of ORMs

• Objects in memory
• Tables in RDBMS
Brief review of ORMs

• Objects in memory
• Tables in RDBMS
• Load objects from tables
Brief review of ORMs

• Objects in memory
• Tables in RDBMS
• Load objects from tables
• Store objects (and changes) back to tables
Brief review of ORMs

• Objects in memory
• Tables in RDBMS
• Load objects from tables
• Store objects (and changes) back to tables
• Typically mapped one attribute per column
Brief review of ORMs

• Objects in memory
• Tables in RDBMS
• Load objects from tables
• Store objects (and changes) back to tables
• Typically mapped one attribute per column
• Occasionally more complex mappings
But things change
But things change

• Object attributes get updated
But things change

• Object attributes get updated
• New objects get created
But things change

• Object attributes get updated
• New objects get created
• Need to map that back to the RDB
But things change

• Object attributes get updated
• New objects get created
• Need to map that back to the RDB
• Updates often require custom SQL
But things change

• Object attributes get updated
• New objects get created
• Need to map that back to the RDB
• Updates often require custom SQL
 • Or live with updating more than needed
But things change

• Object attributes get updated
• New objects get created
• Need to map that back to the RDB
• Updates often require custom SQL
 • Or live with updating more than needed
• Detecting what has changed can be hard
One-to-many messes
One-to-many messes

• Messy when an attribute is a reference
One-to-many messes

• Messy when an attribute is a reference
 • Or a non-DB data type, like a set
One-to-many messes

• Messy when an attribute is a reference
 • Or a non-DB data type, like a set
• Mapping involves joins
One-to-many messes

• Messy when an attribute is a reference
 • Or a non-DB data type, like a set
• Mapping involves joins
 • Left joins to get child rows
One-to-many messes

• Messy when an attribute is a reference
 • Or a non-DB data type, like a set
• Mapping involves joins
 • Left joins to get child rows
 • Or multiple trips to get joined data
One-to-many messes

• Messy when an attribute is a reference
 • Or a non-DB data type, like a set
• Mapping involves joins
 • Left joins to get child rows
 • Or multiple trips to get joined data
• Either way, expensive
Why this is bad
Why this is bad
• If your car were an ORM...
Why this is bad
• If your car were an ORM...
 • Reduce it to parts each night in garage
Why this is bad
• If your car were an ORM...
 • Reduce it to parts each night in garage
 • Rebuild it each morning
Why this is bad
• If your car were an ORM...
 • Reduce it to parts each night in garage
 • Rebuild it each morning
• Is this sane in the 21st century?
Why this is bad
• If your car were an ORM...
 • Reduce it to parts each night in garage
 • Rebuild it each morning
• Is this sane in the 21st century?
• Most ORMs generate the SQL on the fly
Why this is bad
• If your car were an ORM...
 • Reduce it to parts each night in garage
 • Rebuild it each morning
• Is this sane in the 21st century?
• Most ORMs generate the SQL on the fly
 • Recompiling text on each hit?
Why this is bad
• If your car were an ORM...
 • Reduce it to parts each night in garage
 • Rebuild it each morning
• Is this sane in the 21st century?
• Most ORMs generate the SQL on the fly
 • Recompiling text on each hit?
• Often called the “object relational
  impedence mismatch”
How to solve it
How to solve it
• Rectangles don’t fit today’s data
How to solve it
• Rectangles don’t fit today’s data
• Solution: Don’t store rectangles
How to solve it
• Rectangles don’t fit today’s data
• Solution: Don’t store rectangles
• Also known as “NoSQL” solutions
How to solve it
• Rectangles don’t fit today’s data
• Solution: Don’t store rectangles
• Also known as “NoSQL” solutions
• Two main options:
How to solve it
• Rectangles don’t fit today’s data
• Solution: Don’t store rectangles
• Also known as “NoSQL” solutions
• Two main options:
 • Document storage (typically JSON)
How to solve it
• Rectangles don’t fit today’s data
• Solution: Don’t store rectangles
• Also known as “NoSQL” solutions
• Two main options:
 • Document storage (typically JSON)
 • Object storage
How to solve it
• Rectangles don’t fit today’s data
• Solution: Don’t store rectangles
• Also known as “NoSQL” solutions
• Two main options:
 • Document storage (typically JSON)
 • Object storage
• (Generally) not possible if other apps still
  need the data as RDB
Dropping ACID
Dropping ACID

• Automicity, Consistency, Isolation,
  Durability
Dropping ACID

• Automicity, Consistency, Isolation,
  Durability
• Often expressed through transactions
Dropping ACID

• Automicity, Consistency, Isolation,
  Durability
• Often expressed through transactions
• Most NoSQL offer no multi-update ACID
Dropping ACID

• Automicity, Consistency, Isolation,
  Durability
• Often expressed through transactions
• Most NoSQL offer no multi-update ACID
 • But atomic within a single doc update
Dropping ACID

• Automicity, Consistency, Isolation,
  Durability
• Often expressed through transactions
• Most NoSQL offer no multi-update ACID
 • But atomic within a single doc update
• Thus, think about your “schema” carefully
Dropping ACID

• Automicity, Consistency, Isolation,
  Durability
• Often expressed through transactions
• Most NoSQL offer no multi-update ACID
 • But atomic within a single doc update
• Thus, think about your “schema” carefully
 • Ensure single doc update suffices
Eric Brewer’s CAP
Eric Brewer’s CAP
• Consistency
Eric Brewer’s CAP
• Consistency
 • All working, or not working
Eric Brewer’s CAP
• Consistency
 • All working, or not working
 • Yes, this is the “A” in ACID
Eric Brewer’s CAP
• Consistency
 • All working, or not working
 • Yes, this is the “A” in ACID
• Availability
Eric Brewer’s CAP
• Consistency
 • All working, or not working
 • Yes, this is the “A” in ACID
• Availability
 • Is the service up and running?
Eric Brewer’s CAP
• Consistency
 • All working, or not working
 • Yes, this is the “A” in ACID
• Availability
 • Is the service up and running?
• Partition Tolerance
Eric Brewer’s CAP
• Consistency
 • All working, or not working
 • Yes, this is the “A” in ACID
• Availability
 • Is the service up and running?
• Partition Tolerance
 • Can parts of it go offline safely?
Eric Brewer’s CAP
• Consistency
 • All working, or not working
 • Yes, this is the “A” in ACID
• Availability
 • Is the service up and running?
• Partition Tolerance
 • Can parts of it go offline safely?
• .... Pick any two
Current solutions
Current solutions

• Document store
Current solutions

• Document store
• Graph
Current solutions

• Document store
• Graph
• Key/Value in RAM/Disk
Current solutions

• Document store
• Graph
• Key/Value in RAM/Disk
• Key/Value on Disk
Current solutions

• Document store
• Graph
• Key/Value in RAM/Disk
• Key/Value on Disk
• Tabular
Current solutions

• Document store
• Graph
• Key/Value in RAM/Disk
• Key/Value on Disk
• Tabular
• Object Database
Document Store
Document Store

• CouchDB
Document Store

• CouchDB
• MongoDB
Document Store

• CouchDB
• MongoDB
• Apache Jackrabbit
Document Store

• CouchDB
• MongoDB
• Apache Jackrabbit
• XML Databases
Document Store

• CouchDB
• MongoDB
• Apache Jackrabbit
• XML Databases
 • MarkLogic Server
Document Store

• CouchDB
• MongoDB
• Apache Jackrabbit
• XML Databases
 • MarkLogic Server
 • GemFire
Document Store

• CouchDB
• MongoDB
• Apache Jackrabbit
• XML Databases
 • MarkLogic Server
 • GemFire
 • eXist
CouchDB
CouchDB
• Open source (Erlang, Apache 2.0)
CouchDB
• Open source (Erlang, Apache 2.0)
• Stores JSON documents
CouchDB
• Open source (Erlang, Apache 2.0)
• Stores JSON documents
 • Uses SpiderMonkey for processing
CouchDB
• Open source (Erlang, Apache 2.0)
• Stores JSON documents
 • Uses SpiderMonkey for processing
• Provides “views”
CouchDB
• Open source (Erlang, Apache 2.0)
• Stores JSON documents
 • Uses SpiderMonkey for processing
• Provides “views”
 • Aggregate functions
CouchDB
• Open source (Erlang, Apache 2.0)
• Stores JSON documents
 • Uses SpiderMonkey for processing
• Provides “views”
 • Aggregate functions
 • Scales with map/reduce
CouchDB
• Open source (Erlang, Apache 2.0)
• Stores JSON documents
 • Uses SpiderMonkey for processing
• Provides “views”
 • Aggregate functions
 • Scales with map/reduce
• RESTful API
CouchDB
• Open source (Erlang, Apache 2.0)
• Stores JSON documents
 • Uses SpiderMonkey for processing
• Provides “views”
 • Aggregate functions
 • Scales with map/reduce
• RESTful API
• FLOSS Weekly #36
MongoDB
MongoDB
• Open source (C++, GNU AGPL3)
MongoDB
• Open source (C++, GNU AGPL3)
• Wire/Storage protocol is BSON
MongoDB
• Open source (C++, GNU AGPL3)
• Wire/Storage protocol is BSON
• Embedded JavaScript for map/reduce
MongoDB
• Open source (C++, GNU AGPL3)
• Wire/Storage protocol is BSON
• Embedded JavaScript for map/reduce
• Interactive JavaScript shell
MongoDB
• Open source (C++, GNU AGPL3)
• Wire/Storage protocol is BSON
• Embedded JavaScript for map/reduce
• Interactive JavaScript shell
• In-place updates
MongoDB
• Open source (C++, GNU AGPL3)
• Wire/Storage protocol is BSON
• Embedded JavaScript for map/reduce
• Interactive JavaScript shell
• In-place updates
• Replication
MongoDB
• Open source (C++, GNU AGPL3)
• Wire/Storage protocol is BSON
• Embedded JavaScript for map/reduce
• Interactive JavaScript shell
• In-place updates
• Replication
• Auto-sharding
MongoDB
• Open source (C++, GNU AGPL3)
• Wire/Storage protocol is BSON
• Embedded JavaScript for map/reduce
• Interactive JavaScript shell
• In-place updates
• Replication
• Auto-sharding
• Bindings for many languages
MongoDB
• Open source (C++, GNU AGPL3)
• Wire/Storage protocol is BSON
• Embedded JavaScript for map/reduce
• Interactive JavaScript shell
• In-place updates
• Replication
• Auto-sharding
• Bindings for many languages
• FLOSS Weekly #105
Apache Jackrabbit
Apache Jackrabbit
• Open source (Java, Apache 2.0)
Apache Jackrabbit
• Open source (Java, Apache 2.0)
• XML content on disk
Apache Jackrabbit
• Open source (Java, Apache 2.0)
• XML content on disk
 • Implements Java Content Repository API
Apache Jackrabbit
• Open source (Java, Apache 2.0)
• XML content on disk
 • Implements Java Content Repository API
• Full text and XPath search
Apache Jackrabbit
• Open source (Java, Apache 2.0)
• XML content on disk
 • Implements Java Content Repository API
• Full text and XPath search
• Versioning, transactions, observation
Apache Jackrabbit
• Open source (Java, Apache 2.0)
• XML content on disk
 • Implements Java Content Repository API
• Full text and XPath search
• Versioning, transactions, observation
• Authentication
Apache Jackrabbit
• Open source (Java, Apache 2.0)
• XML content on disk
 • Implements Java Content Repository API
• Full text and XPath search
• Versioning, transactions, observation
• Authentication
• Object persistence using Object Content
  Manager
MarkLogic Server
MarkLogic Server
• Not open-source
MarkLogic Server
• Not open-source
• XML database
MarkLogic Server
• Not open-source
• XML database
 • Implements XQuery
MarkLogic Server
• Not open-source
• XML database
 • Implements XQuery
• Full-text and structured search
MarkLogic Server
• Not open-source
• XML database
 • Implements XQuery
• Full-text and structured search
• Native geospatial searches
MarkLogic Server
• Not open-source
• XML database
 • Implements XQuery
• Full-text and structured search
• Native geospatial searches
• In heavy use by their customers
MarkLogic Server
• Not open-source
• XML database
 • Implements XQuery
• Full-text and structured search
• Native geospatial searches
• In heavy use by their customers
• Scalable to “hundreds of terabytes”
MarkLogic Server
• Not open-source
• XML database
 • Implements XQuery
• Full-text and structured search
• Native geospatial searches
• In heavy use by their customers
• Scalable to “hundreds of terabytes”
• Both native and RESTful APIs
GemFire
GemFire

• Not open-source
GemFire

• Not open-source
• Mostly-in-memory distributed object cache
GemFire

• Not open-source
• Mostly-in-memory distributed object cache
• Change notification
GemFire

• Not open-source
• Mostly-in-memory distributed object cache
• Change notification
• Highly available
GemFire

• Not open-source
• Mostly-in-memory distributed object cache
• Change notification
• Highly available
• Object Query Language compatible
GemFire

• Not open-source
• Mostly-in-memory distributed object cache
• Change notification
• Highly available
• Object Query Language compatible
• Native Java/C++/C# objects
GemFire

• Not open-source
• Mostly-in-memory distributed object cache
• Change notification
• Highly available
• Object Query Language compatible
• Native Java/C++/C# objects
• Persistence to file system, databases, etc
eXist
eXist
• Open source (Java, LGPL)
eXist
• Open source (Java, LGPL)
• Native XML queries
eXist
• Open source (Java, LGPL)
• Native XML queries
 • XQuery, XPath, XSLT, XUpdate
eXist
• Open source (Java, LGPL)
• Native XML queries
 • XQuery, XPath, XSLT, XUpdate
• Rich APIs: REST, WebDAV, SOAP
eXist
• Open source (Java, LGPL)
• Native XML queries
 • XQuery, XPath, XSLT, XUpdate
• Rich APIs: REST, WebDAV, SOAP
• Can serve entire webapps!
eXist
• Open source (Java, LGPL)
• Native XML queries
 • XQuery, XPath, XSLT, XUpdate
• Rich APIs: REST, WebDAV, SOAP
• Can serve entire webapps!
• Used by large installations
eXist
• Open source (Java, LGPL)
• Native XML queries
 • XQuery, XPath, XSLT, XUpdate
• Rich APIs: REST, WebDAV, SOAP
• Can serve entire webapps!
• Used by large installations
 • US State Department (history.state.gov)
eXist
• Open source (Java, LGPL)
• Native XML queries
 • XQuery, XPath, XSLT, XUpdate
• Rich APIs: REST, WebDAV, SOAP
• Can serve entire webapps!
• Used by large installations
 • US State Department (history.state.gov)
• FLOSS Weekly #97
Graph
Graph


• InfoGrid
Graph


• InfoGrid
• Neo4J
Graph


• InfoGrid
• Neo4J
• AllegroGraph
InfoGrid
InfoGrid

• Open source (Java, AGPL3)
InfoGrid

• Open source (Java, AGPL3)
• GraphDatabase stores nodes and edges
InfoGrid

• Open source (Java, AGPL3)
• GraphDatabase stores nodes and edges
• MeshBase - self contained
InfoGrid

• Open source (Java, AGPL3)
• GraphDatabase stores nodes and edges
• MeshBase - self contained
• NetMeshBase - distributed knowledge
InfoGrid

• Open source (Java, AGPL3)
• GraphDatabase stores nodes and edges
• MeshBase - self contained
• NetMeshBase - distributed knowledge
• API in front of other SQL and NoSQL DBs
InfoGrid

• Open source (Java, AGPL3)
• GraphDatabase stores nodes and edges
• MeshBase - self contained
• NetMeshBase - distributed knowledge
• API in front of other SQL and NoSQL DBs
• Includes components for authentication
Neo4j
Neo4j
• Open source (Java, AGPL3)
Neo4j
• Open source (Java, AGPL3)
 • Commercial support/version available
Neo4j
• Open source (Java, AGPL3)
 • Commercial support/version available
• Java objects on disk
Neo4j
• Open source (Java, AGPL3)
 • Commercial support/version available
• Java objects on disk
• Transactional
Neo4j
• Open source (Java, AGPL3)
 • Commercial support/version available
• Java objects on disk
• Transactional
• Scalable (several billion nodes on single
  machine)
Neo4j
• Open source (Java, AGPL3)
 • Commercial support/version available
• Java objects on disk
• Transactional
• Scalable (several billion nodes on single
  machine)
• Small footprint (JAR under 500KB)
Neo4j
• Open source (Java, AGPL3)
 • Commercial support/version available
• Java objects on disk
• Transactional
• Scalable (several billion nodes on single
  machine)
• Small footprint (JAR under 500KB)
• RDF mappings
AllegroGraph
AllegroGraph
• Free versions (not open source)
AllegroGraph
• Free versions (not open source)
• Holds Resource Description Frameworks
AllegroGraph
• Free versions (not open source)
• Holds Resource Description Frameworks
• From Franz, Inc (Franz Lisp, etc)
AllegroGraph
• Free versions (not open source)
• Holds Resource Description Frameworks
• From Franz, Inc (Franz Lisp, etc)
• Interfaces in many common languages
AllegroGraph
• Free versions (not open source)
• Holds Resource Description Frameworks
• From Franz, Inc (Franz Lisp, etc)
• Interfaces in many common languages
• Active development
AllegroGraph
• Free versions (not open source)
• Holds Resource Description Frameworks
• From Franz, Inc (Franz Lisp, etc)
• Interfaces in many common languages
• Active development
• In use by FLOSS/commercial/government
AllegroGraph
• Free versions (not open source)
• Holds Resource Description Frameworks
• From Franz, Inc (Franz Lisp, etc)
• Interfaces in many common languages
• Active development
• In use by FLOSS/commercial/government
• Queries with SPARQL
AllegroGraph
• Free versions (not open source)
• Holds Resource Description Frameworks
• From Franz, Inc (Franz Lisp, etc)
• Interfaces in many common languages
• Active development
• In use by FLOSS/commercial/government
• Queries with SPARQL
 • ... Protocol and RDF Query Language
Key/Value in RAM/Disk
Key/Value in RAM/Disk



• memcached
Key/Value in RAM/Disk



• memcached
• Redis
Memcached
Memcached
• Open source (C, BSD)
Memcached
• Open source (C, BSD)
• LRU cache (data may be lost)
Memcached
• Open source (C, BSD)
• LRU cache (data may be lost)
• Developed for LiveJournal
Memcached
• Open source (C, BSD)
• LRU cache (data may be lost)
• Developed for LiveJournal
 • used by many large sites
Memcached
• Open source (C, BSD)
• LRU cache (data may be lost)
• Developed for LiveJournal
 • used by many large sites
• Simple key/value storage
Memcached
• Open source (C, BSD)
• LRU cache (data may be lost)
• Developed for LiveJournal
 • used by many large sites
• Simple key/value storage
 • Keys up to 120 bytes, values 1 MB
Memcached
• Open source (C, BSD)
• LRU cache (data may be lost)
• Developed for LiveJournal
 • used by many large sites
• Simple key/value storage
 • Keys up to 120 bytes, values 1 MB
• Clientside horizontal scaling
Memcached
• Open source (C, BSD)
• LRU cache (data may be lost)
• Developed for LiveJournal
 • used by many large sites
• Simple key/value storage
 • Keys up to 120 bytes, values 1 MB
• Clientside horizontal scaling
• Can also store on disk (memcachedb)
Redis
Redis
• Open source (C, BSD)
Redis
• Open source (C, BSD)
 • Development funded by VMWare
Redis
• Open source (C, BSD)
 • Development funded by VMWare
• Similar to Memcached (key/value pair)
Redis
• Open source (C, BSD)
 • Development funded by VMWare
• Similar to Memcached (key/value pair)
• Values can be lists, sets, hashes
Redis
• Open source (C, BSD)
 • Development funded by VMWare
• Similar to Memcached (key/value pair)
• Values can be lists, sets, hashes
• Master/slave replication supported
Redis
• Open source (C, BSD)
 • Development funded by VMWare
• Similar to Memcached (key/value pair)
• Values can be lists, sets, hashes
• Master/slave replication supported
• Many client languages available
Redis
• Open source (C, BSD)
 • Development funded by VMWare
• Similar to Memcached (key/value pair)
• Values can be lists, sets, hashes
• Master/slave replication supported
• Many client languages available
• Used by many big sites
Redis
• Open source (C, BSD)
 • Development funded by VMWare
• Similar to Memcached (key/value pair)
• Values can be lists, sets, hashes
• Master/slave replication supported
• Many client languages available
• Used by many big sites
 • Github, Craigslist, Engine Yard, Guardian
Redis
• Open source (C, BSD)
 • Development funded by VMWare
• Similar to Memcached (key/value pair)
• Values can be lists, sets, hashes
• Master/slave replication supported
• Many client languages available
• Used by many big sites
 • Github, Craigslist, Engine Yard, Guardian
• Can also store on disk
Key/Value on Disk
Key/Value on Disk

• Amazon SimpleDB
Key/Value on Disk

• Amazon SimpleDB
• Berkeley DB
Key/Value on Disk

• Amazon SimpleDB
• Berkeley DB
• Tokyo Cabinet
Key/Value on Disk

• Amazon SimpleDB
• Berkeley DB
• Tokyo Cabinet
• Cassandra
Key/Value on Disk

• Amazon SimpleDB
• Berkeley DB
• Tokyo Cabinet
• Cassandra
• GT.M
Amazon SimpleDB
Amazon SimpleDB

• Built by Amazon in Erlang
Amazon SimpleDB

• Built by Amazon in Erlang
• Supports EC2 applications
Amazon SimpleDB

• Built by Amazon in Erlang
• Supports EC2 applications
• Highly scalable
Amazon SimpleDB

• Built by Amazon in Erlang
• Supports EC2 applications
• Highly scalable
• “Eventual” Consistency
Amazon SimpleDB

• Built by Amazon in Erlang
• Supports EC2 applications
• Highly scalable
• “Eventual” Consistency
• Items have query-able attributes
Amazon SimpleDB

• Built by Amazon in Erlang
• Supports EC2 applications
• Highly scalable
• “Eventual” Consistency
• Items have query-able attributes
• No text search
Amazon SimpleDB

• Built by Amazon in Erlang
• Supports EC2 applications
• Highly scalable
• “Eventual” Consistency
• Items have query-able attributes
• No text search
 • Build your own indexes
Berkeley DB
Berkeley DB

• Open source (C, Sleepycat)
Berkeley DB

• Open source (C, Sleepycat)
• Enhancement of original DBM from AT&T
Berkeley DB

• Open source (C, Sleepycat)
• Enhancement of original DBM from AT&T
• Key/value pairs in various storage formats
Berkeley DB

• Open source (C, Sleepycat)
• Enhancement of original DBM from AT&T
• Key/value pairs in various storage formats
• Transactional locking, HA features
Berkeley DB

• Open source (C, Sleepycat)
• Enhancement of original DBM from AT&T
• Key/value pairs in various storage formats
• Transactional locking, HA features
• Widely used
Tokyo Cabinet
Tokyo Cabinet
• Open source (C, LGPL)
Tokyo Cabinet
• Open source (C, LGPL)
• Successor to GDBM and QDBM
Tokyo Cabinet
• Open source (C, LGPL)
• Successor to GDBM and QDBM
 • Very efficient in both space and speed
Tokyo Cabinet
• Open source (C, LGPL)
• Successor to GDBM and QDBM
 • Very efficient in both space and speed
• Simple key/value pairs
Tokyo Cabinet
• Open source (C, LGPL)
• Successor to GDBM and QDBM
 • Very efficient in both space and speed
• Simple key/value pairs
• Multiple storage strategies
Tokyo Cabinet
• Open source (C, LGPL)
• Successor to GDBM and QDBM
 • Very efficient in both space and speed
• Simple key/value pairs
• Multiple storage strategies
• Multiple client language interfaces
Tokyo Cabinet
• Open source (C, LGPL)
• Successor to GDBM and QDBM
 • Very efficient in both space and speed
• Simple key/value pairs
• Multiple storage strategies
• Multiple client language interfaces
• Local storage only: no network interface
Tokyo Cabinet
• Open source (C, LGPL)
• Successor to GDBM and QDBM
 • Very efficient in both space and speed
• Simple key/value pairs
• Multiple storage strategies
• Multiple client language interfaces
• Local storage only: no network interface
 • But see Tokyo Tyrant
Cassandra
Cassandra

• Open source (Java, Apache 2)
Cassandra

• Open source (Java, Apache 2)
• Originally developed at Facebook
Cassandra

• Open source (Java, Apache 2)
• Originally developed at Facebook
• Uses key-column-value storage
Cassandra

• Open source (Java, Apache 2)
• Originally developed at Facebook
• Uses key-column-value storage
• High availability/elastic through replication
Cassandra

• Open source (Java, Apache 2)
• Originally developed at Facebook
• Uses key-column-value storage
• High availability/elastic through replication
• Used by Facebook, Digg, Twitter, Rackspace
Cassandra

• Open source (Java, Apache 2)
• Originally developed at Facebook
• Uses key-column-value storage
• High availability/elastic through replication
• Used by Facebook, Digg, Twitter, Rackspace
• Eventually consistent
Cassandra

• Open source (Java, Apache 2)
• Originally developed at Facebook
• Uses key-column-value storage
• High availability/elastic through replication
• Used by Facebook, Digg, Twitter, Rackspace
• Eventually consistent
 • Queries can ask “majority” or “all”
GT.M
GT.M

• Open Source (Mumps, GPL)
GT.M

• Open Source (Mumps, GPL)
 • Commercial support from Fidelity
GT.M

• Open Source (Mumps, GPL)
 • Commercial support from Fidelity
• Distributed persistence of key/value pairs
GT.M

• Open Source (Mumps, GPL)
 • Commercial support from Fidelity
• Distributed persistence of key/value pairs
• Transactions via optimistic concurrency
GT.M

• Open Source (Mumps, GPL)
 • Commercial support from Fidelity
• Distributed persistence of key/value pairs
• Transactions via optimistic concurrency
 • Everything you read must be unchanged
GT.M

• Open Source (Mumps, GPL)
 • Commercial support from Fidelity
• Distributed persistence of key/value pairs
• Transactions via optimistic concurrency
 • Everything you read must be unchanged
• Mumps-to-C-to-Mumps APIs
Tabular
Tabular


• Mnesia
Tabular


• Mnesia
• Hbase
Tabular


• Mnesia
• Hbase
• Hypertable
Mnesia
Mnesia

• Open source (Erlang, Erlang license)
Mnesia

• Open source (Erlang, Erlang license)
• Key/value pairs
Mnesia

• Open source (Erlang, Erlang license)
• Key/value pairs
 • Value is any Erlang datatype
Mnesia

• Open source (Erlang, Erlang license)
• Key/value pairs
 • Value is any Erlang datatype
• Live reconfiguration
Mnesia

• Open source (Erlang, Erlang license)
• Key/value pairs
 • Value is any Erlang datatype
• Live reconfiguration
• Supports transactions and distribution
Hbase
Hbase

• Open source (Java, Apache 2)
Hbase

• Open source (Java, Apache 2)
• Mimics Google’s “BigTable”
Hbase

• Open source (Java, Apache 2)
• Mimics Google’s “BigTable”
 • Push map/reduce down to shards
Hbase

• Open source (Java, Apache 2)
• Mimics Google’s “BigTable”
 • Push map/reduce down to shards
• Runs on Hadoop Distributed File System
Hbase

• Open source (Java, Apache 2)
• Mimics Google’s “BigTable”
 • Push map/reduce down to shards
• Runs on Hadoop Distributed File System
• Java, REST, Thrift APIs
Hbase

• Open source (Java, Apache 2)
• Mimics Google’s “BigTable”
 • Push map/reduce down to shards
• Runs on Hadoop Distributed File System
• Java, REST, Thrift APIs
• Might be the DB behind Bing
Hypertable
Hypertable


• Open source (C++, GPL 2)
Hypertable


• Open source (C++, GPL 2)
• Yet another BigTable clone
Hypertable


• Open source (C++, GPL 2)
• Yet another BigTable clone
• Designed for highly scalable data storage
Object database
Object database

• Db4o
Object database

• Db4o
• InterSystems Cache
Object database

• Db4o
• InterSystems Cache
• ZODB
Object database

• Db4o
• InterSystems Cache
• ZODB
• GemStone/S
Object database

• Db4o
• InterSystems Cache
• ZODB
• GemStone/S
• Magma
Db4o
Db4o
• Open source (Java/C#, GPL)
Db4o
• Open source (Java/C#, GPL)
 • Commercial license/support available
Db4o
• Open source (Java/C#, GPL)
 • Commercial license/support available
• Supports object persistence
Db4o
• Open source (Java/C#, GPL)
 • Commercial license/support available
• Supports object persistence
 • both Java and dot-net
Db4o
• Open source (Java/C#, GPL)
 • Commercial license/support available
• Supports object persistence
 • both Java and dot-net
• Can replicate to traditional RDBMS
Db4o
• Open source (Java/C#, GPL)
 • Commercial license/support available
• Supports object persistence
 • both Java and dot-net
• Can replicate to traditional RDBMS
• Supports class migration
Db4o
• Open source (Java/C#, GPL)
 • Commercial license/support available
• Supports object persistence
 • both Java and dot-net
• Can replicate to traditional RDBMS
• Supports class migration
 • ... if you provide the code
Db4o
• Open source (Java/C#, GPL)
 • Commercial license/support available
• Supports object persistence
 • both Java and dot-net
• Can replicate to traditional RDBMS
• Supports class migration
 • ... if you provide the code
• Large community
InterSystems Cache
InterSystems Cache

• Commercial
InterSystems Cache

• Commercial
• “World’s fastest object database”
InterSystems Cache

• Commercial
• “World’s fastest object database”
• Cross-platform
InterSystems Cache

• Commercial
• “World’s fastest object database”
• Cross-platform
• Persistence of multidimensional arrays
InterSystems Cache

• Commercial
• “World’s fastest object database”
• Cross-platform
• Persistence of multidimensional arrays
 • Similar to MUMPS/Pick data
InterSystems Cache

• Commercial
• “World’s fastest object database”
• Cross-platform
• Persistence of multidimensional arrays
 • Similar to MUMPS/Pick data
• Can be embedded in web pages
ZODB
ZODB

• Open source (Python, Zope license)
ZODB

• Open source (Python, Zope license)
• “Seamless object persistence”
ZODB

• Open source (Python, Zope license)
• “Seamless object persistence”
• Transactions, MVCC
ZODB

• Open source (Python, Zope license)
• “Seamless object persistence”
• Transactions, MVCC
• Scaling across a network
ZODB

• Open source (Python, Zope license)
• “Seamless object persistence”
• Transactions, MVCC
• Scaling across a network
• Widely used
ZODB

• Open source (Python, Zope license)
• “Seamless object persistence”
• Transactions, MVCC
• Scaling across a network
• Widely used
• Zope Replication Services (commercial)
GemStone/S
GemStone/S
• Commercial (free license for small apps)
GemStone/S
• Commercial (free license for small apps)
• Smalltalk objects just “persist”
GemStone/S
• Commercial (free license for small apps)
• Smalltalk objects just “persist”
 • Includes Java interface
GemStone/S
• Commercial (free license for small apps)
• Smalltalk objects just “persist”
 • Includes Java interface
• Automatic and/or guided class upgrades
GemStone/S
• Commercial (free license for small apps)
• Smalltalk objects just “persist”
 • Includes Java interface
• Automatic and/or guided class upgrades
• Horizontally scaleable
GemStone/S
• Commercial (free license for small apps)
• Smalltalk objects just “persist”
 • Includes Java interface
• Automatic and/or guided class upgrades
• Horizontally scaleable
 • OOCL manages 40% of overseas traffic
GemStone/S
• Commercial (free license for small apps)
• Smalltalk objects just “persist”
 • Includes Java interface
• Automatic and/or guided class upgrades
• Horizontally scaleable
 • OOCL manages 40% of overseas traffic
 • JPM’s Kapital created the financial crisis :)
GemStone/S
• Commercial (free license for small apps)
• Smalltalk objects just “persist”
 • Includes Java interface
• Automatic and/or guided class upgrades
• Horizontally scaleable
 • OOCL manages 40% of overseas traffic
 • JPM’s Kapital created the financial crisis :)
• Integrates with Seaside
GemStone/S
• Commercial (free license for small apps)
• Smalltalk objects just “persist”
 • Includes Java interface
• Automatic and/or guided class upgrades
• Horizontally scaleable
 • OOCL manages 40% of overseas traffic
 • JPM’s Kapital created the financial crisis :)
• Integrates with Seaside
 • Web apps with transparent persistence
Magma
Magma

• Open source (Squeak Smalltalk, MIT)
Magma

• Open source (Squeak Smalltalk, MIT)
• Transparent Smalltalk object persistence
Magma

• Open source (Squeak Smalltalk, MIT)
• Transparent Smalltalk object persistence
• “Free GemStone/S”
Magma

• Open source (Squeak Smalltalk, MIT)
• Transparent Smalltalk object persistence
• “Free GemStone/S”
• Client-server model
Magma

• Open source (Squeak Smalltalk, MIT)
• Transparent Smalltalk object persistence
• “Free GemStone/S”
• Client-server model
• HA mode (multiple slaves ready for master)
Magma

• Open source (Squeak Smalltalk, MIT)
• Transparent Smalltalk object persistence
• “Free GemStone/S”
• Client-server model
• HA mode (multiple slaves ready for master)
• Transaction-based (commit/rollback)
Magma

• Open source (Squeak Smalltalk, MIT)
• Transparent Smalltalk object persistence
• “Free GemStone/S”
• Client-server model
• HA mode (multiple slaves ready for master)
• Transaction-based (commit/rollback)
• Works nicely with Seaside
In summary
In summary


• Lots of ways to not use SQL
In summary


• Lots of ways to not use SQL
• Many open source
In summary


• Lots of ways to not use SQL
• Many open source
 • Many commercially supported
In summary


• Lots of ways to not use SQL
• Many open source
 • Many commercially supported
• Don’t assume you need an ORM!
How to contact me
How to contact me


• Email: merlyn@stonehenge.com
How to contact me


• Email: merlyn@stonehenge.com
• Twitter: @merlyn
How to contact me


• Email: merlyn@stonehenge.com
• Twitter: @merlyn
• Website: www.stonehenge.com
How to contact me


• Email: merlyn@stonehenge.com
• Twitter: @merlyn
• Website: www.stonehenge.com
• Phone: +1 503 777 0095

Forget The ORM!

  • 1.
    Forget the ORM! Persistent data with Non-traditional Databases By Randal L. Schwartz, Stonehenge Consulting Services, Inc. <merlyn@stonehenge.com> http://www.stonehenge.com/merlyn/ version 1.2 at 13 April 2010
  • 2.
    What we arecovering
  • 3.
    What we arecovering • What is an Object-Relational-Mapper?
  • 4.
    What we arecovering • What is an Object-Relational-Mapper? • Why is it evil?
  • 5.
    What we arecovering • What is an Object-Relational-Mapper? • Why is it evil? • What are the alternatives?
  • 6.
  • 7.
    Brief review ofORMs • Objects in memory
  • 8.
    Brief review ofORMs • Objects in memory • Tables in RDBMS
  • 9.
    Brief review ofORMs • Objects in memory • Tables in RDBMS • Load objects from tables
  • 10.
    Brief review ofORMs • Objects in memory • Tables in RDBMS • Load objects from tables • Store objects (and changes) back to tables
  • 11.
    Brief review ofORMs • Objects in memory • Tables in RDBMS • Load objects from tables • Store objects (and changes) back to tables • Typically mapped one attribute per column
  • 12.
    Brief review ofORMs • Objects in memory • Tables in RDBMS • Load objects from tables • Store objects (and changes) back to tables • Typically mapped one attribute per column • Occasionally more complex mappings
  • 13.
  • 14.
    But things change •Object attributes get updated
  • 15.
    But things change •Object attributes get updated • New objects get created
  • 16.
    But things change •Object attributes get updated • New objects get created • Need to map that back to the RDB
  • 17.
    But things change •Object attributes get updated • New objects get created • Need to map that back to the RDB • Updates often require custom SQL
  • 18.
    But things change •Object attributes get updated • New objects get created • Need to map that back to the RDB • Updates often require custom SQL • Or live with updating more than needed
  • 19.
    But things change •Object attributes get updated • New objects get created • Need to map that back to the RDB • Updates often require custom SQL • Or live with updating more than needed • Detecting what has changed can be hard
  • 20.
  • 21.
    One-to-many messes • Messywhen an attribute is a reference
  • 22.
    One-to-many messes • Messywhen an attribute is a reference • Or a non-DB data type, like a set
  • 23.
    One-to-many messes • Messywhen an attribute is a reference • Or a non-DB data type, like a set • Mapping involves joins
  • 24.
    One-to-many messes • Messywhen an attribute is a reference • Or a non-DB data type, like a set • Mapping involves joins • Left joins to get child rows
  • 25.
    One-to-many messes • Messywhen an attribute is a reference • Or a non-DB data type, like a set • Mapping involves joins • Left joins to get child rows • Or multiple trips to get joined data
  • 26.
    One-to-many messes • Messywhen an attribute is a reference • Or a non-DB data type, like a set • Mapping involves joins • Left joins to get child rows • Or multiple trips to get joined data • Either way, expensive
  • 27.
  • 28.
    Why this isbad • If your car were an ORM...
  • 29.
    Why this isbad • If your car were an ORM... • Reduce it to parts each night in garage
  • 30.
    Why this isbad • If your car were an ORM... • Reduce it to parts each night in garage • Rebuild it each morning
  • 31.
    Why this isbad • If your car were an ORM... • Reduce it to parts each night in garage • Rebuild it each morning • Is this sane in the 21st century?
  • 32.
    Why this isbad • If your car were an ORM... • Reduce it to parts each night in garage • Rebuild it each morning • Is this sane in the 21st century? • Most ORMs generate the SQL on the fly
  • 33.
    Why this isbad • If your car were an ORM... • Reduce it to parts each night in garage • Rebuild it each morning • Is this sane in the 21st century? • Most ORMs generate the SQL on the fly • Recompiling text on each hit?
  • 34.
    Why this isbad • If your car were an ORM... • Reduce it to parts each night in garage • Rebuild it each morning • Is this sane in the 21st century? • Most ORMs generate the SQL on the fly • Recompiling text on each hit? • Often called the “object relational impedence mismatch”
  • 35.
  • 36.
    How to solveit • Rectangles don’t fit today’s data
  • 37.
    How to solveit • Rectangles don’t fit today’s data • Solution: Don’t store rectangles
  • 38.
    How to solveit • Rectangles don’t fit today’s data • Solution: Don’t store rectangles • Also known as “NoSQL” solutions
  • 39.
    How to solveit • Rectangles don’t fit today’s data • Solution: Don’t store rectangles • Also known as “NoSQL” solutions • Two main options:
  • 40.
    How to solveit • Rectangles don’t fit today’s data • Solution: Don’t store rectangles • Also known as “NoSQL” solutions • Two main options: • Document storage (typically JSON)
  • 41.
    How to solveit • Rectangles don’t fit today’s data • Solution: Don’t store rectangles • Also known as “NoSQL” solutions • Two main options: • Document storage (typically JSON) • Object storage
  • 42.
    How to solveit • Rectangles don’t fit today’s data • Solution: Don’t store rectangles • Also known as “NoSQL” solutions • Two main options: • Document storage (typically JSON) • Object storage • (Generally) not possible if other apps still need the data as RDB
  • 43.
  • 44.
    Dropping ACID • Automicity,Consistency, Isolation, Durability
  • 45.
    Dropping ACID • Automicity,Consistency, Isolation, Durability • Often expressed through transactions
  • 46.
    Dropping ACID • Automicity,Consistency, Isolation, Durability • Often expressed through transactions • Most NoSQL offer no multi-update ACID
  • 47.
    Dropping ACID • Automicity,Consistency, Isolation, Durability • Often expressed through transactions • Most NoSQL offer no multi-update ACID • But atomic within a single doc update
  • 48.
    Dropping ACID • Automicity,Consistency, Isolation, Durability • Often expressed through transactions • Most NoSQL offer no multi-update ACID • But atomic within a single doc update • Thus, think about your “schema” carefully
  • 49.
    Dropping ACID • Automicity,Consistency, Isolation, Durability • Often expressed through transactions • Most NoSQL offer no multi-update ACID • But atomic within a single doc update • Thus, think about your “schema” carefully • Ensure single doc update suffices
  • 50.
  • 51.
  • 52.
    Eric Brewer’s CAP •Consistency • All working, or not working
  • 53.
    Eric Brewer’s CAP •Consistency • All working, or not working • Yes, this is the “A” in ACID
  • 54.
    Eric Brewer’s CAP •Consistency • All working, or not working • Yes, this is the “A” in ACID • Availability
  • 55.
    Eric Brewer’s CAP •Consistency • All working, or not working • Yes, this is the “A” in ACID • Availability • Is the service up and running?
  • 56.
    Eric Brewer’s CAP •Consistency • All working, or not working • Yes, this is the “A” in ACID • Availability • Is the service up and running? • Partition Tolerance
  • 57.
    Eric Brewer’s CAP •Consistency • All working, or not working • Yes, this is the “A” in ACID • Availability • Is the service up and running? • Partition Tolerance • Can parts of it go offline safely?
  • 58.
    Eric Brewer’s CAP •Consistency • All working, or not working • Yes, this is the “A” in ACID • Availability • Is the service up and running? • Partition Tolerance • Can parts of it go offline safely? • .... Pick any two
  • 59.
  • 60.
  • 61.
  • 62.
    Current solutions • Documentstore • Graph • Key/Value in RAM/Disk
  • 63.
    Current solutions • Documentstore • Graph • Key/Value in RAM/Disk • Key/Value on Disk
  • 64.
    Current solutions • Documentstore • Graph • Key/Value in RAM/Disk • Key/Value on Disk • Tabular
  • 65.
    Current solutions • Documentstore • Graph • Key/Value in RAM/Disk • Key/Value on Disk • Tabular • Object Database
  • 66.
  • 67.
  • 68.
  • 69.
    Document Store • CouchDB •MongoDB • Apache Jackrabbit
  • 70.
    Document Store • CouchDB •MongoDB • Apache Jackrabbit • XML Databases
  • 71.
    Document Store • CouchDB •MongoDB • Apache Jackrabbit • XML Databases • MarkLogic Server
  • 72.
    Document Store • CouchDB •MongoDB • Apache Jackrabbit • XML Databases • MarkLogic Server • GemFire
  • 73.
    Document Store • CouchDB •MongoDB • Apache Jackrabbit • XML Databases • MarkLogic Server • GemFire • eXist
  • 74.
  • 75.
    CouchDB • Open source(Erlang, Apache 2.0)
  • 76.
    CouchDB • Open source(Erlang, Apache 2.0) • Stores JSON documents
  • 77.
    CouchDB • Open source(Erlang, Apache 2.0) • Stores JSON documents • Uses SpiderMonkey for processing
  • 78.
    CouchDB • Open source(Erlang, Apache 2.0) • Stores JSON documents • Uses SpiderMonkey for processing • Provides “views”
  • 79.
    CouchDB • Open source(Erlang, Apache 2.0) • Stores JSON documents • Uses SpiderMonkey for processing • Provides “views” • Aggregate functions
  • 80.
    CouchDB • Open source(Erlang, Apache 2.0) • Stores JSON documents • Uses SpiderMonkey for processing • Provides “views” • Aggregate functions • Scales with map/reduce
  • 81.
    CouchDB • Open source(Erlang, Apache 2.0) • Stores JSON documents • Uses SpiderMonkey for processing • Provides “views” • Aggregate functions • Scales with map/reduce • RESTful API
  • 82.
    CouchDB • Open source(Erlang, Apache 2.0) • Stores JSON documents • Uses SpiderMonkey for processing • Provides “views” • Aggregate functions • Scales with map/reduce • RESTful API • FLOSS Weekly #36
  • 83.
  • 84.
    MongoDB • Open source(C++, GNU AGPL3)
  • 85.
    MongoDB • Open source(C++, GNU AGPL3) • Wire/Storage protocol is BSON
  • 86.
    MongoDB • Open source(C++, GNU AGPL3) • Wire/Storage protocol is BSON • Embedded JavaScript for map/reduce
  • 87.
    MongoDB • Open source(C++, GNU AGPL3) • Wire/Storage protocol is BSON • Embedded JavaScript for map/reduce • Interactive JavaScript shell
  • 88.
    MongoDB • Open source(C++, GNU AGPL3) • Wire/Storage protocol is BSON • Embedded JavaScript for map/reduce • Interactive JavaScript shell • In-place updates
  • 89.
    MongoDB • Open source(C++, GNU AGPL3) • Wire/Storage protocol is BSON • Embedded JavaScript for map/reduce • Interactive JavaScript shell • In-place updates • Replication
  • 90.
    MongoDB • Open source(C++, GNU AGPL3) • Wire/Storage protocol is BSON • Embedded JavaScript for map/reduce • Interactive JavaScript shell • In-place updates • Replication • Auto-sharding
  • 91.
    MongoDB • Open source(C++, GNU AGPL3) • Wire/Storage protocol is BSON • Embedded JavaScript for map/reduce • Interactive JavaScript shell • In-place updates • Replication • Auto-sharding • Bindings for many languages
  • 92.
    MongoDB • Open source(C++, GNU AGPL3) • Wire/Storage protocol is BSON • Embedded JavaScript for map/reduce • Interactive JavaScript shell • In-place updates • Replication • Auto-sharding • Bindings for many languages • FLOSS Weekly #105
  • 93.
  • 94.
    Apache Jackrabbit • Opensource (Java, Apache 2.0)
  • 95.
    Apache Jackrabbit • Opensource (Java, Apache 2.0) • XML content on disk
  • 96.
    Apache Jackrabbit • Opensource (Java, Apache 2.0) • XML content on disk • Implements Java Content Repository API
  • 97.
    Apache Jackrabbit • Opensource (Java, Apache 2.0) • XML content on disk • Implements Java Content Repository API • Full text and XPath search
  • 98.
    Apache Jackrabbit • Opensource (Java, Apache 2.0) • XML content on disk • Implements Java Content Repository API • Full text and XPath search • Versioning, transactions, observation
  • 99.
    Apache Jackrabbit • Opensource (Java, Apache 2.0) • XML content on disk • Implements Java Content Repository API • Full text and XPath search • Versioning, transactions, observation • Authentication
  • 100.
    Apache Jackrabbit • Opensource (Java, Apache 2.0) • XML content on disk • Implements Java Content Repository API • Full text and XPath search • Versioning, transactions, observation • Authentication • Object persistence using Object Content Manager
  • 101.
  • 102.
  • 103.
    MarkLogic Server • Notopen-source • XML database
  • 104.
    MarkLogic Server • Notopen-source • XML database • Implements XQuery
  • 105.
    MarkLogic Server • Notopen-source • XML database • Implements XQuery • Full-text and structured search
  • 106.
    MarkLogic Server • Notopen-source • XML database • Implements XQuery • Full-text and structured search • Native geospatial searches
  • 107.
    MarkLogic Server • Notopen-source • XML database • Implements XQuery • Full-text and structured search • Native geospatial searches • In heavy use by their customers
  • 108.
    MarkLogic Server • Notopen-source • XML database • Implements XQuery • Full-text and structured search • Native geospatial searches • In heavy use by their customers • Scalable to “hundreds of terabytes”
  • 109.
    MarkLogic Server • Notopen-source • XML database • Implements XQuery • Full-text and structured search • Native geospatial searches • In heavy use by their customers • Scalable to “hundreds of terabytes” • Both native and RESTful APIs
  • 110.
  • 111.
  • 112.
    GemFire • Not open-source •Mostly-in-memory distributed object cache
  • 113.
    GemFire • Not open-source •Mostly-in-memory distributed object cache • Change notification
  • 114.
    GemFire • Not open-source •Mostly-in-memory distributed object cache • Change notification • Highly available
  • 115.
    GemFire • Not open-source •Mostly-in-memory distributed object cache • Change notification • Highly available • Object Query Language compatible
  • 116.
    GemFire • Not open-source •Mostly-in-memory distributed object cache • Change notification • Highly available • Object Query Language compatible • Native Java/C++/C# objects
  • 117.
    GemFire • Not open-source •Mostly-in-memory distributed object cache • Change notification • Highly available • Object Query Language compatible • Native Java/C++/C# objects • Persistence to file system, databases, etc
  • 118.
  • 119.
  • 120.
    eXist • Open source(Java, LGPL) • Native XML queries
  • 121.
    eXist • Open source(Java, LGPL) • Native XML queries • XQuery, XPath, XSLT, XUpdate
  • 122.
    eXist • Open source(Java, LGPL) • Native XML queries • XQuery, XPath, XSLT, XUpdate • Rich APIs: REST, WebDAV, SOAP
  • 123.
    eXist • Open source(Java, LGPL) • Native XML queries • XQuery, XPath, XSLT, XUpdate • Rich APIs: REST, WebDAV, SOAP • Can serve entire webapps!
  • 124.
    eXist • Open source(Java, LGPL) • Native XML queries • XQuery, XPath, XSLT, XUpdate • Rich APIs: REST, WebDAV, SOAP • Can serve entire webapps! • Used by large installations
  • 125.
    eXist • Open source(Java, LGPL) • Native XML queries • XQuery, XPath, XSLT, XUpdate • Rich APIs: REST, WebDAV, SOAP • Can serve entire webapps! • Used by large installations • US State Department (history.state.gov)
  • 126.
    eXist • Open source(Java, LGPL) • Native XML queries • XQuery, XPath, XSLT, XUpdate • Rich APIs: REST, WebDAV, SOAP • Can serve entire webapps! • Used by large installations • US State Department (history.state.gov) • FLOSS Weekly #97
  • 127.
  • 128.
  • 129.
  • 130.
  • 131.
  • 132.
  • 133.
    InfoGrid • Open source(Java, AGPL3) • GraphDatabase stores nodes and edges
  • 134.
    InfoGrid • Open source(Java, AGPL3) • GraphDatabase stores nodes and edges • MeshBase - self contained
  • 135.
    InfoGrid • Open source(Java, AGPL3) • GraphDatabase stores nodes and edges • MeshBase - self contained • NetMeshBase - distributed knowledge
  • 136.
    InfoGrid • Open source(Java, AGPL3) • GraphDatabase stores nodes and edges • MeshBase - self contained • NetMeshBase - distributed knowledge • API in front of other SQL and NoSQL DBs
  • 137.
    InfoGrid • Open source(Java, AGPL3) • GraphDatabase stores nodes and edges • MeshBase - self contained • NetMeshBase - distributed knowledge • API in front of other SQL and NoSQL DBs • Includes components for authentication
  • 138.
  • 139.
    Neo4j • Open source(Java, AGPL3)
  • 140.
    Neo4j • Open source(Java, AGPL3) • Commercial support/version available
  • 141.
    Neo4j • Open source(Java, AGPL3) • Commercial support/version available • Java objects on disk
  • 142.
    Neo4j • Open source(Java, AGPL3) • Commercial support/version available • Java objects on disk • Transactional
  • 143.
    Neo4j • Open source(Java, AGPL3) • Commercial support/version available • Java objects on disk • Transactional • Scalable (several billion nodes on single machine)
  • 144.
    Neo4j • Open source(Java, AGPL3) • Commercial support/version available • Java objects on disk • Transactional • Scalable (several billion nodes on single machine) • Small footprint (JAR under 500KB)
  • 145.
    Neo4j • Open source(Java, AGPL3) • Commercial support/version available • Java objects on disk • Transactional • Scalable (several billion nodes on single machine) • Small footprint (JAR under 500KB) • RDF mappings
  • 146.
  • 147.
  • 148.
    AllegroGraph • Free versions(not open source) • Holds Resource Description Frameworks
  • 149.
    AllegroGraph • Free versions(not open source) • Holds Resource Description Frameworks • From Franz, Inc (Franz Lisp, etc)
  • 150.
    AllegroGraph • Free versions(not open source) • Holds Resource Description Frameworks • From Franz, Inc (Franz Lisp, etc) • Interfaces in many common languages
  • 151.
    AllegroGraph • Free versions(not open source) • Holds Resource Description Frameworks • From Franz, Inc (Franz Lisp, etc) • Interfaces in many common languages • Active development
  • 152.
    AllegroGraph • Free versions(not open source) • Holds Resource Description Frameworks • From Franz, Inc (Franz Lisp, etc) • Interfaces in many common languages • Active development • In use by FLOSS/commercial/government
  • 153.
    AllegroGraph • Free versions(not open source) • Holds Resource Description Frameworks • From Franz, Inc (Franz Lisp, etc) • Interfaces in many common languages • Active development • In use by FLOSS/commercial/government • Queries with SPARQL
  • 154.
    AllegroGraph • Free versions(not open source) • Holds Resource Description Frameworks • From Franz, Inc (Franz Lisp, etc) • Interfaces in many common languages • Active development • In use by FLOSS/commercial/government • Queries with SPARQL • ... Protocol and RDF Query Language
  • 155.
  • 156.
  • 157.
    Key/Value in RAM/Disk •memcached • Redis
  • 158.
  • 159.
  • 160.
    Memcached • Open source(C, BSD) • LRU cache (data may be lost)
  • 161.
    Memcached • Open source(C, BSD) • LRU cache (data may be lost) • Developed for LiveJournal
  • 162.
    Memcached • Open source(C, BSD) • LRU cache (data may be lost) • Developed for LiveJournal • used by many large sites
  • 163.
    Memcached • Open source(C, BSD) • LRU cache (data may be lost) • Developed for LiveJournal • used by many large sites • Simple key/value storage
  • 164.
    Memcached • Open source(C, BSD) • LRU cache (data may be lost) • Developed for LiveJournal • used by many large sites • Simple key/value storage • Keys up to 120 bytes, values 1 MB
  • 165.
    Memcached • Open source(C, BSD) • LRU cache (data may be lost) • Developed for LiveJournal • used by many large sites • Simple key/value storage • Keys up to 120 bytes, values 1 MB • Clientside horizontal scaling
  • 166.
    Memcached • Open source(C, BSD) • LRU cache (data may be lost) • Developed for LiveJournal • used by many large sites • Simple key/value storage • Keys up to 120 bytes, values 1 MB • Clientside horizontal scaling • Can also store on disk (memcachedb)
  • 167.
  • 168.
  • 169.
    Redis • Open source(C, BSD) • Development funded by VMWare
  • 170.
    Redis • Open source(C, BSD) • Development funded by VMWare • Similar to Memcached (key/value pair)
  • 171.
    Redis • Open source(C, BSD) • Development funded by VMWare • Similar to Memcached (key/value pair) • Values can be lists, sets, hashes
  • 172.
    Redis • Open source(C, BSD) • Development funded by VMWare • Similar to Memcached (key/value pair) • Values can be lists, sets, hashes • Master/slave replication supported
  • 173.
    Redis • Open source(C, BSD) • Development funded by VMWare • Similar to Memcached (key/value pair) • Values can be lists, sets, hashes • Master/slave replication supported • Many client languages available
  • 174.
    Redis • Open source(C, BSD) • Development funded by VMWare • Similar to Memcached (key/value pair) • Values can be lists, sets, hashes • Master/slave replication supported • Many client languages available • Used by many big sites
  • 175.
    Redis • Open source(C, BSD) • Development funded by VMWare • Similar to Memcached (key/value pair) • Values can be lists, sets, hashes • Master/slave replication supported • Many client languages available • Used by many big sites • Github, Craigslist, Engine Yard, Guardian
  • 176.
    Redis • Open source(C, BSD) • Development funded by VMWare • Similar to Memcached (key/value pair) • Values can be lists, sets, hashes • Master/slave replication supported • Many client languages available • Used by many big sites • Github, Craigslist, Engine Yard, Guardian • Can also store on disk
  • 177.
  • 178.
    Key/Value on Disk •Amazon SimpleDB
  • 179.
    Key/Value on Disk •Amazon SimpleDB • Berkeley DB
  • 180.
    Key/Value on Disk •Amazon SimpleDB • Berkeley DB • Tokyo Cabinet
  • 181.
    Key/Value on Disk •Amazon SimpleDB • Berkeley DB • Tokyo Cabinet • Cassandra
  • 182.
    Key/Value on Disk •Amazon SimpleDB • Berkeley DB • Tokyo Cabinet • Cassandra • GT.M
  • 183.
  • 184.
    Amazon SimpleDB • Builtby Amazon in Erlang
  • 185.
    Amazon SimpleDB • Builtby Amazon in Erlang • Supports EC2 applications
  • 186.
    Amazon SimpleDB • Builtby Amazon in Erlang • Supports EC2 applications • Highly scalable
  • 187.
    Amazon SimpleDB • Builtby Amazon in Erlang • Supports EC2 applications • Highly scalable • “Eventual” Consistency
  • 188.
    Amazon SimpleDB • Builtby Amazon in Erlang • Supports EC2 applications • Highly scalable • “Eventual” Consistency • Items have query-able attributes
  • 189.
    Amazon SimpleDB • Builtby Amazon in Erlang • Supports EC2 applications • Highly scalable • “Eventual” Consistency • Items have query-able attributes • No text search
  • 190.
    Amazon SimpleDB • Builtby Amazon in Erlang • Supports EC2 applications • Highly scalable • “Eventual” Consistency • Items have query-able attributes • No text search • Build your own indexes
  • 191.
  • 192.
    Berkeley DB • Opensource (C, Sleepycat)
  • 193.
    Berkeley DB • Opensource (C, Sleepycat) • Enhancement of original DBM from AT&T
  • 194.
    Berkeley DB • Opensource (C, Sleepycat) • Enhancement of original DBM from AT&T • Key/value pairs in various storage formats
  • 195.
    Berkeley DB • Opensource (C, Sleepycat) • Enhancement of original DBM from AT&T • Key/value pairs in various storage formats • Transactional locking, HA features
  • 196.
    Berkeley DB • Opensource (C, Sleepycat) • Enhancement of original DBM from AT&T • Key/value pairs in various storage formats • Transactional locking, HA features • Widely used
  • 197.
  • 198.
    Tokyo Cabinet • Opensource (C, LGPL)
  • 199.
    Tokyo Cabinet • Opensource (C, LGPL) • Successor to GDBM and QDBM
  • 200.
    Tokyo Cabinet • Opensource (C, LGPL) • Successor to GDBM and QDBM • Very efficient in both space and speed
  • 201.
    Tokyo Cabinet • Opensource (C, LGPL) • Successor to GDBM and QDBM • Very efficient in both space and speed • Simple key/value pairs
  • 202.
    Tokyo Cabinet • Opensource (C, LGPL) • Successor to GDBM and QDBM • Very efficient in both space and speed • Simple key/value pairs • Multiple storage strategies
  • 203.
    Tokyo Cabinet • Opensource (C, LGPL) • Successor to GDBM and QDBM • Very efficient in both space and speed • Simple key/value pairs • Multiple storage strategies • Multiple client language interfaces
  • 204.
    Tokyo Cabinet • Opensource (C, LGPL) • Successor to GDBM and QDBM • Very efficient in both space and speed • Simple key/value pairs • Multiple storage strategies • Multiple client language interfaces • Local storage only: no network interface
  • 205.
    Tokyo Cabinet • Opensource (C, LGPL) • Successor to GDBM and QDBM • Very efficient in both space and speed • Simple key/value pairs • Multiple storage strategies • Multiple client language interfaces • Local storage only: no network interface • But see Tokyo Tyrant
  • 206.
  • 207.
    Cassandra • Open source(Java, Apache 2)
  • 208.
    Cassandra • Open source(Java, Apache 2) • Originally developed at Facebook
  • 209.
    Cassandra • Open source(Java, Apache 2) • Originally developed at Facebook • Uses key-column-value storage
  • 210.
    Cassandra • Open source(Java, Apache 2) • Originally developed at Facebook • Uses key-column-value storage • High availability/elastic through replication
  • 211.
    Cassandra • Open source(Java, Apache 2) • Originally developed at Facebook • Uses key-column-value storage • High availability/elastic through replication • Used by Facebook, Digg, Twitter, Rackspace
  • 212.
    Cassandra • Open source(Java, Apache 2) • Originally developed at Facebook • Uses key-column-value storage • High availability/elastic through replication • Used by Facebook, Digg, Twitter, Rackspace • Eventually consistent
  • 213.
    Cassandra • Open source(Java, Apache 2) • Originally developed at Facebook • Uses key-column-value storage • High availability/elastic through replication • Used by Facebook, Digg, Twitter, Rackspace • Eventually consistent • Queries can ask “majority” or “all”
  • 214.
  • 215.
  • 216.
    GT.M • Open Source(Mumps, GPL) • Commercial support from Fidelity
  • 217.
    GT.M • Open Source(Mumps, GPL) • Commercial support from Fidelity • Distributed persistence of key/value pairs
  • 218.
    GT.M • Open Source(Mumps, GPL) • Commercial support from Fidelity • Distributed persistence of key/value pairs • Transactions via optimistic concurrency
  • 219.
    GT.M • Open Source(Mumps, GPL) • Commercial support from Fidelity • Distributed persistence of key/value pairs • Transactions via optimistic concurrency • Everything you read must be unchanged
  • 220.
    GT.M • Open Source(Mumps, GPL) • Commercial support from Fidelity • Distributed persistence of key/value pairs • Transactions via optimistic concurrency • Everything you read must be unchanged • Mumps-to-C-to-Mumps APIs
  • 221.
  • 222.
  • 223.
  • 224.
  • 225.
  • 226.
    Mnesia • Open source(Erlang, Erlang license)
  • 227.
    Mnesia • Open source(Erlang, Erlang license) • Key/value pairs
  • 228.
    Mnesia • Open source(Erlang, Erlang license) • Key/value pairs • Value is any Erlang datatype
  • 229.
    Mnesia • Open source(Erlang, Erlang license) • Key/value pairs • Value is any Erlang datatype • Live reconfiguration
  • 230.
    Mnesia • Open source(Erlang, Erlang license) • Key/value pairs • Value is any Erlang datatype • Live reconfiguration • Supports transactions and distribution
  • 231.
  • 232.
    Hbase • Open source(Java, Apache 2)
  • 233.
    Hbase • Open source(Java, Apache 2) • Mimics Google’s “BigTable”
  • 234.
    Hbase • Open source(Java, Apache 2) • Mimics Google’s “BigTable” • Push map/reduce down to shards
  • 235.
    Hbase • Open source(Java, Apache 2) • Mimics Google’s “BigTable” • Push map/reduce down to shards • Runs on Hadoop Distributed File System
  • 236.
    Hbase • Open source(Java, Apache 2) • Mimics Google’s “BigTable” • Push map/reduce down to shards • Runs on Hadoop Distributed File System • Java, REST, Thrift APIs
  • 237.
    Hbase • Open source(Java, Apache 2) • Mimics Google’s “BigTable” • Push map/reduce down to shards • Runs on Hadoop Distributed File System • Java, REST, Thrift APIs • Might be the DB behind Bing
  • 238.
  • 239.
  • 240.
    Hypertable • Open source(C++, GPL 2) • Yet another BigTable clone
  • 241.
    Hypertable • Open source(C++, GPL 2) • Yet another BigTable clone • Designed for highly scalable data storage
  • 242.
  • 243.
  • 244.
    Object database • Db4o •InterSystems Cache
  • 245.
    Object database • Db4o •InterSystems Cache • ZODB
  • 246.
    Object database • Db4o •InterSystems Cache • ZODB • GemStone/S
  • 247.
    Object database • Db4o •InterSystems Cache • ZODB • GemStone/S • Magma
  • 248.
  • 249.
    Db4o • Open source(Java/C#, GPL)
  • 250.
    Db4o • Open source(Java/C#, GPL) • Commercial license/support available
  • 251.
    Db4o • Open source(Java/C#, GPL) • Commercial license/support available • Supports object persistence
  • 252.
    Db4o • Open source(Java/C#, GPL) • Commercial license/support available • Supports object persistence • both Java and dot-net
  • 253.
    Db4o • Open source(Java/C#, GPL) • Commercial license/support available • Supports object persistence • both Java and dot-net • Can replicate to traditional RDBMS
  • 254.
    Db4o • Open source(Java/C#, GPL) • Commercial license/support available • Supports object persistence • both Java and dot-net • Can replicate to traditional RDBMS • Supports class migration
  • 255.
    Db4o • Open source(Java/C#, GPL) • Commercial license/support available • Supports object persistence • both Java and dot-net • Can replicate to traditional RDBMS • Supports class migration • ... if you provide the code
  • 256.
    Db4o • Open source(Java/C#, GPL) • Commercial license/support available • Supports object persistence • both Java and dot-net • Can replicate to traditional RDBMS • Supports class migration • ... if you provide the code • Large community
  • 257.
  • 258.
  • 259.
    InterSystems Cache • Commercial •“World’s fastest object database”
  • 260.
    InterSystems Cache • Commercial •“World’s fastest object database” • Cross-platform
  • 261.
    InterSystems Cache • Commercial •“World’s fastest object database” • Cross-platform • Persistence of multidimensional arrays
  • 262.
    InterSystems Cache • Commercial •“World’s fastest object database” • Cross-platform • Persistence of multidimensional arrays • Similar to MUMPS/Pick data
  • 263.
    InterSystems Cache • Commercial •“World’s fastest object database” • Cross-platform • Persistence of multidimensional arrays • Similar to MUMPS/Pick data • Can be embedded in web pages
  • 264.
  • 265.
    ZODB • Open source(Python, Zope license)
  • 266.
    ZODB • Open source(Python, Zope license) • “Seamless object persistence”
  • 267.
    ZODB • Open source(Python, Zope license) • “Seamless object persistence” • Transactions, MVCC
  • 268.
    ZODB • Open source(Python, Zope license) • “Seamless object persistence” • Transactions, MVCC • Scaling across a network
  • 269.
    ZODB • Open source(Python, Zope license) • “Seamless object persistence” • Transactions, MVCC • Scaling across a network • Widely used
  • 270.
    ZODB • Open source(Python, Zope license) • “Seamless object persistence” • Transactions, MVCC • Scaling across a network • Widely used • Zope Replication Services (commercial)
  • 271.
  • 272.
    GemStone/S • Commercial (freelicense for small apps)
  • 273.
    GemStone/S • Commercial (freelicense for small apps) • Smalltalk objects just “persist”
  • 274.
    GemStone/S • Commercial (freelicense for small apps) • Smalltalk objects just “persist” • Includes Java interface
  • 275.
    GemStone/S • Commercial (freelicense for small apps) • Smalltalk objects just “persist” • Includes Java interface • Automatic and/or guided class upgrades
  • 276.
    GemStone/S • Commercial (freelicense for small apps) • Smalltalk objects just “persist” • Includes Java interface • Automatic and/or guided class upgrades • Horizontally scaleable
  • 277.
    GemStone/S • Commercial (freelicense for small apps) • Smalltalk objects just “persist” • Includes Java interface • Automatic and/or guided class upgrades • Horizontally scaleable • OOCL manages 40% of overseas traffic
  • 278.
    GemStone/S • Commercial (freelicense for small apps) • Smalltalk objects just “persist” • Includes Java interface • Automatic and/or guided class upgrades • Horizontally scaleable • OOCL manages 40% of overseas traffic • JPM’s Kapital created the financial crisis :)
  • 279.
    GemStone/S • Commercial (freelicense for small apps) • Smalltalk objects just “persist” • Includes Java interface • Automatic and/or guided class upgrades • Horizontally scaleable • OOCL manages 40% of overseas traffic • JPM’s Kapital created the financial crisis :) • Integrates with Seaside
  • 280.
    GemStone/S • Commercial (freelicense for small apps) • Smalltalk objects just “persist” • Includes Java interface • Automatic and/or guided class upgrades • Horizontally scaleable • OOCL manages 40% of overseas traffic • JPM’s Kapital created the financial crisis :) • Integrates with Seaside • Web apps with transparent persistence
  • 281.
  • 282.
    Magma • Open source(Squeak Smalltalk, MIT)
  • 283.
    Magma • Open source(Squeak Smalltalk, MIT) • Transparent Smalltalk object persistence
  • 284.
    Magma • Open source(Squeak Smalltalk, MIT) • Transparent Smalltalk object persistence • “Free GemStone/S”
  • 285.
    Magma • Open source(Squeak Smalltalk, MIT) • Transparent Smalltalk object persistence • “Free GemStone/S” • Client-server model
  • 286.
    Magma • Open source(Squeak Smalltalk, MIT) • Transparent Smalltalk object persistence • “Free GemStone/S” • Client-server model • HA mode (multiple slaves ready for master)
  • 287.
    Magma • Open source(Squeak Smalltalk, MIT) • Transparent Smalltalk object persistence • “Free GemStone/S” • Client-server model • HA mode (multiple slaves ready for master) • Transaction-based (commit/rollback)
  • 288.
    Magma • Open source(Squeak Smalltalk, MIT) • Transparent Smalltalk object persistence • “Free GemStone/S” • Client-server model • HA mode (multiple slaves ready for master) • Transaction-based (commit/rollback) • Works nicely with Seaside
  • 289.
  • 290.
    In summary • Lotsof ways to not use SQL
  • 291.
    In summary • Lotsof ways to not use SQL • Many open source
  • 292.
    In summary • Lotsof ways to not use SQL • Many open source • Many commercially supported
  • 293.
    In summary • Lotsof ways to not use SQL • Many open source • Many commercially supported • Don’t assume you need an ORM!
  • 294.
  • 295.
    How to contactme • Email: merlyn@stonehenge.com
  • 296.
    How to contactme • Email: merlyn@stonehenge.com • Twitter: @merlyn
  • 297.
    How to contactme • Email: merlyn@stonehenge.com • Twitter: @merlyn • Website: www.stonehenge.com
  • 298.
    How to contactme • Email: merlyn@stonehenge.com • Twitter: @merlyn • Website: www.stonehenge.com • Phone: +1 503 777 0095