SlideShare a Scribd company logo
NoSQL
    Death	
  to	
  Relational	
  Databases(?)
    bensco'ield	
  –	
  viget	
  labs
    rubyconf
    20	
  november	
  2009




Friday, November 20, 2009
Motivations



Friday, November 20, 2009
Performance



Friday, November 20, 2009
Friday, November 20, 2009
Scalability



Friday, November 20, 2009
Friday, November 20, 2009
Friday, November 20, 2009
Flexibility



Friday, November 20, 2009
Friday, November 20, 2009
Locus	
  of	
  Work



Friday, November 20, 2009
Charlie	
  Chaplin




                                                               Jet	
  Li



                            Hank	
  Mann

                                           Marian	
  Collier



Friday, November 20, 2009
Domain	
  Complexity



Friday, November 20, 2009
Friday, November 20, 2009
Taxonomy



Friday, November 20, 2009
Key-­‐Value	
  Stores



Friday, November 20, 2009
distributed	
  hash	
  tables



Friday, November 20, 2009
Dynamo
     GT.M
     PStore
     Redis



Friday, November 20, 2009
Column-­‐Oriented	
  Stores



Friday, November 20, 2009
semi-­‐structured



Friday, November 20, 2009
BigTable
     Cassandra
     HBase



Friday, November 20, 2009
Document-­‐Oriented	
  Stores



Friday, November 20, 2009
also	
  semi-­‐structured



Friday, November 20, 2009
CouchDB
     MongoDB
     RDDB
     Riak



Friday, November 20, 2009
Graph	
  Databases



Friday, November 20, 2009
graph	
  theory



Friday, November 20, 2009
ActiveRDF	
  
     AllegroGraph
     Neo4J



Friday, November 20, 2009
Comparisons



Friday, November 20, 2009
Performance



Friday, November 20, 2009
key-­‐value	
  stores
                            column-­‐oriented	
  stores
                            document-­‐oriented	
  stores
                            relational	
  databases
                            graph	
  databases


Friday, November 20, 2009
Scalability



Friday, November 20, 2009
key-­‐value	
  stores
                            column-­‐oriented	
  stores
                            document-­‐oriented	
  stores
                            relational	
  databases
                            graph	
  databases


Friday, November 20, 2009
Flexibility



Friday, November 20, 2009
key-­‐value	
  stores
                            document-­‐oriented	
  stores
                            graph	
  databases	
  
                            column-­‐oriented	
  stores
                            relational	
  databases


Friday, November 20, 2009
Locus	
  of	
  Work



Friday, November 20, 2009
key-­‐value	
  stores
                            column-­‐oriented	
  stores
                            document-­‐oriented	
  stores
                            relational	
  databases
                            graph	
  databases	
  


Friday, November 20, 2009
Domain	
  Complexity



Friday, November 20, 2009
key-­‐value	
  stores
                            column-­‐oriented	
  stores
                            document-­‐oriented	
  stores
                            relational	
  databases
                            graph	
  databases	
  


Friday, November 20, 2009
Examples



Friday, November 20, 2009
Redis



Friday, November 20, 2009
Data	
  Types
     strings
     lists
     sets




Friday, November 20, 2009
In-­‐Memory
     periodic	
  snapshots
     master-­‐slave	
  replication
     memory-­‐bound




Friday, November 20, 2009
require 'redis'

    gl = Redis.new

    # A string
    gl['name'] = 'Kyle Rayner'
    gl['name']
    gl.delete('name')

    # A list
    gl.push_tail 'to-dos', 'Lose Ion power'
    gl.push_tail 'to-dos', 'Mourn dead loved ones'
    gl.push_tail 'to-dos', 'Blow up zombie lanterns'

    gl.list_range('to-dos', 0, -1)




Friday, November 20, 2009
Tokyo	
  Cabinet



Friday, November 20, 2009
Data	
  Types
     strings
     tables!




Friday, November 20, 2009
Related	
  Projects
     tyrant
     dystopia
     promenade




Friday, November 20, 2009
require 'rufus/tokyo'

    # Key-value
    leagues = Rufus::Tokyo::Cabinet.new('jl.tch')
    leagues['JLI'] = [
      'Batman', 'Black Canary',
      'Blue Beetle', 'Captain Marvel',
      'Doctor Light', 'Doctor Fate',
      'Guy Gardner','Martian Manhunter',
      'Mister Miracle'
    ].to_yaml

    YAML.load(leagues['JLI'])




Friday, November 20, 2009
require 'rufus/tokyo'

    # Table
    big7 = Rufus::Tokyo::Table.new('big7.tct')

    big7['s']               =   {'name'   =>   'Superman', 'role' => 'deus ex machina'}
    big7['b']               =   {'name'   =>   'Batman', 'role' => 'mastermind'}
    big7['gl']              =   {'name'   =>   'Green Lantern', 'role' => 'space cop'}
    big7['f']               =   {'name'   =>   'Flash', 'role' => 'speedster'}
    big7['mm']              =   {'name'   =>   'Martian Manhunter', 'role' => '?'}
    big7['ww']              =   {'name'   =>   'Wonder Woman', 'role' => 'hitter'}
    big7['a']               =   {'name'   =>   'Aquaman', 'role' => 'fish-talking'}

    big7.query {|q|
      q.add_condition 'role', :streq, 'fish-talking'
    }




Friday, November 20, 2009
Cassandra



Friday, November 20, 2009
Genealogy
     Dynamo
     BigTable




Friday, November 20, 2009
Column-­‐Oriented
     columns
     supercolumns
     column	
  families




Friday, November 20, 2009
Distributed
     automatic	
  replication
     eventual	
  consistency
     easy	
  expansion




Friday, November 20, 2009
Availability
     weak	
  reads
     quorum	
  reads




Friday, November 20, 2009
require 'cassandra'

          op = Cassandra.new('OnePiece')

          op.insert(:People, '1', {'name' => 'Luffy'})
          op.insert(:People, '2', {'name' => 'Crocodile'})
          op.insert(:People, '3', {'name' => 'Mr. 3'})

          op.insert(:Fights, '1', {'opponents' => {UUID.new => '2'}})
          op.insert(:Fights, '1', {'opponents' => {UUID.new => '3'}})

          luffy_fights = op.get(:Fights, '1', 'opponents')
          luffy_fights.map {|t, opp| op.get(:People, opp, 'name')}




Friday, November 20, 2009
CouchDB



Friday, November 20, 2009
Web-­‐Inspired
     JSON	
  storage
     HTTP	
  /	
  RESTful	
  interface




Friday, November 20, 2009
Views
     predeVined,	
  updated	
  incrementally
     javascript	
  for	
  map/reduce




Friday, November 20, 2009
Updates
     full,	
  including	
  embedded	
  documents




Friday, November 20, 2009
require 'couchrest'

    konoha = CouchRest.database!('http://127.0.0.1:5984/konoha')
    naruto = konoha.save_doc {
      'name' => 'Naruto Uzumaki',
      'chakra' => 'wind'
    }
    shikamaru = konoha.save_doc {
      'name' => 'Shikamaru Nara',
      'chunin' => true
    }

    konoha.save_doc {
      '_id' => '_design/first',
      :views => {
        :chunin => {
          :map => 'function(doc){if(doc.chunin){emit(null, doc);}}'
        }
      }
    }

    puts konoha.views('first/chunin')['rows'].inspect



Friday, November 20, 2009
MongoDB



Friday, November 20, 2009
Storage
     binary	
  JSON	
  documents




Friday, November 20, 2009
Access
     native	
  clients




Friday, November 20, 2009
Queries
     dynamic
     index-­‐based




Friday, November 20, 2009
Updates
     allows	
  partial	
  updates




Friday, November 20, 2009
require 'mongo'

          avengers = Mongo::Connection.new.db('avengers')
          members = avengers.collection('members')

          members.insert    {'name'   =>   'Ant-Man'}
          members.insert    {'name'   =>   'Hulk'}
          members.insert    {'name'   =>   'Iron Man'}
          members.insert    {'name'   =>   'Thor'}
          members.insert    {'name'   =>   'Wasp'}

          members.create_index('name')

          pym = members.find {'name' => 'Ant-Man'}
          pym['name'] = 'Giant-Man'
          pym.save

          members.remove {'name' => 'Hulk'}

          members.insert {'name' => 'Captain America'}




Friday, November 20, 2009
Neo4J



Friday, November 20, 2009
Structure
     nodes	
  and	
  edges
     key-­‐value	
  pairs




Friday, November 20, 2009
Queries
     lucene




Friday, November 20, 2009
require 'neo4j'

    class Person
      include Neo4j::NodeMixin

         property :name, :mutant
         index :name, :mutant

         has_n :interests
         has_n :dates
         has_n :marriages

      def initialize(name, mutant = true)
        name = name
        mutant = mutant
      end
    end




Friday, November 20, 2009
Neo4j::Transaction.run do
      magneto = Person.new('Magneto')
      esme = Person.new('Esme')
      rogue = Person.new('Rogue')
      magda = Person.new('Magda', false)
      wasp = Person.new('Wasp', false)

         magneto.interests << wasp
         magneto.marriages << magda
         magneto.dates << rogue

      esme.interests << magneto
      magda.marriages << magneto
      rogue.dates << magneto
    end




Friday, November 20, 2009
magneto = Person.find(:name => 'Magneto')

    # Who likes Magneto?
    magneto.relationships.incoming(:interests).nodes

    # Which non-mutants has Magneto dated?
    magneto.dates{ !mutant? }.to_a




Friday, November 20, 2009
Simulations



Friday, November 20, 2009
Structure



Friday, November 20, 2009
people
    {
      ‘name’:‘Jimmy Olsen’
      ‘title’:‘Superman’s Pal’
      ‘company_id’:12441
    }

    companies
    {
      _id:12441
      ‘name’:‘Daily Planet’
    }




Friday, November 20, 2009
Lack	
  of	
  Structure



Friday, November 20, 2009
mysql> SELECT * FROM people LIMIT 1 G
    *************************** 1. row ***************************
         id: 1
    content: ---
    company: Daily Planet
    name: Jimmy Olsen
    title: Superman’s Pal




Friday, November 20, 2009
mysql> desc people;
    +-------+-------------+------+-----+---------+-------+
    | Field | Type        | Null | Key | Default | Extra |
    +-------+-------------+------+-----+---------+-------+
    | id    | int(11)     | YES |      | NULL    |       |
    | name | varchar(50) | YES |       | NULL    |       |
    +-------+-------------+------+-----+---------+-------+


    mysql> desc attributes;
    +-----------+--------------+------+-----+---------+-------+
    | Field     | Type         | Null | Key | Default | Extra |
    +-----------+--------------+------+-----+---------+-------+
    | id        | int(11)      | YES |      | NULL    |       |
    | person_id | int(11)      | YES |      | NULL    |       |
    | attribute | varchar(50) | YES |       | NULL    |       |
    | value     | varchar(100) | YES |      | NULL    |       |
    +-----------+--------------+------+-----+---------+-------+




Friday, November 20, 2009
Not	
  Only	
  SQL



Friday, November 20, 2009
Caching



Friday, November 20, 2009
Already	
  in	
  Use
     memcached




Friday, November 20, 2009
Logging



Friday, November 20, 2009
Rails	
  Log	
  Replacement
     http://github.com/peburrows/mongo_db_logger




Friday, November 20, 2009
Hybrid	
  Domains



Friday, November 20, 2009
different	
  domains



Friday, November 20, 2009
Publishing
     e-­‐commerce
     documents




Friday, November 20, 2009
Dating
     e-­‐commerce
     social	
  graph




Friday, November 20, 2009
different	
  scales



Friday, November 20, 2009
Photo	
  Sharing
     user	
  accounts
     uploaded	
  photos




Friday, November 20, 2009
Next	
  Steps



Friday, November 20, 2009
Explore



Friday, November 20, 2009
Database	
  List
      http://internetmindmap.com/database_software


      NoSQL	
  Google	
  Group
      http://groups.google.com/group/nosql-­‐discussion


      NoSQL	
  Ecosystem
      http://www.rackspacecloud.com/blog/2009/11/09/nosql-­‐ecosystem/


      Wave!

Friday, November 20, 2009
Ignore	
  the	
  Database



Friday, November 20, 2009
Logical	
  Modeling	
  First
     be	
  mindful




Friday, November 20, 2009
Change	
  the	
  Default



Friday, November 20, 2009
Application	
  Templates
     start	
  with	
  something	
  new




Friday, November 20, 2009
bensco'ield
     @bsco'ield
     ben.sco'ield@viget.com
     http:/    /spkr8.com/bscoVield
     http:/    /viget.com/extend
     http:	
   /benscoVield.com
          /




Friday, November 20, 2009

More Related Content

PDF
Robb broome rubyconf x presentation for publication
PDF
Javascript the New Parts v2
PDF
Modernizes your objective C - Oliviero
PDF
Realm to Json & Royal
PDF
Functional Scala 2020
PDF
Tomasz Nurkiewicz - Programowanie reaktywne: czego się nauczyłem
PDF
Introduce to Rust-A Powerful System Language
PDF
Everything is Permitted: Extending Built-ins
Robb broome rubyconf x presentation for publication
Javascript the New Parts v2
Modernizes your objective C - Oliviero
Realm to Json & Royal
Functional Scala 2020
Tomasz Nurkiewicz - Programowanie reaktywne: czego się nauczyłem
Introduce to Rust-A Powerful System Language
Everything is Permitted: Extending Built-ins

Viewers also liked (18)

PDF
Introduction of Redis as NoSQL Database
PDF
NoSQL @ CodeMash 2010
KEY
2010-11-12 Databases overview
PPTX
Introduction to Relational Databases
PDF
Course Review - Lecture 13 - Introduction to Databases (1007156ANR)
PDF
Choosing a Next Gen Database: the New World Order of NoSQL, NewSQL, and MySQL
PDF
NewSQL Database Overview
PDF
Key-Value Stores: a practical overview
PDF
SAS/Tableau integration
PPT
Lecture 3 multimedia databases
PDF
Advanced SQL - Lecture 6 - Introduction to Databases (1007156ANR)
PDF
NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)
PDF
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
PPT
5 Data Modeling for NoSQL 1/2
PDF
DBMS Architectures and Features - Lecture 7 - Introduction to Databases (1007...
PPTX
Relational databases vs Non-relational databases
PPTX
Should I move my database to the cloud?
PPTX
Big data architectures and the data lake
Introduction of Redis as NoSQL Database
NoSQL @ CodeMash 2010
2010-11-12 Databases overview
Introduction to Relational Databases
Course Review - Lecture 13 - Introduction to Databases (1007156ANR)
Choosing a Next Gen Database: the New World Order of NoSQL, NewSQL, and MySQL
NewSQL Database Overview
Key-Value Stores: a practical overview
SAS/Tableau integration
Lecture 3 multimedia databases
Advanced SQL - Lecture 6 - Introduction to Databases (1007156ANR)
NoSQL Databases - Lecture 12 - Introduction to Databases (1007156ANR)
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
5 Data Modeling for NoSQL 1/2
DBMS Architectures and Features - Lecture 7 - Introduction to Databases (1007...
Relational databases vs Non-relational databases
Should I move my database to the cloud?
Big data architectures and the data lake
Ad

Similar to NoSQL: Death to Relational Databases(?) (14)

PDF
eIFL General Assembly
PDF
Impactos no design com programação funcional
PDF
Prototype & Scriptaculous
PDF
Webinar: MongoDB on the JVM
PDF
Latinoware Rails 2009
PDF
Javascript the Language of the Web
PDF
2009, o ano do Ruby on Rails no Brasil - CaelumDay 2009
PDF
Semcomp de São Carlos
PDF
Macruby - RubyConf Presentation 2010
PDF
14 Ddply
PDF
The State of NoSQL
PDF
Standing on the shoulders of giants with JRuby
PDF
Software livre e padrões abertos no desenvolvimento Web
PDF
Apache Hadoop Talk at QCon
eIFL General Assembly
Impactos no design com programação funcional
Prototype & Scriptaculous
Webinar: MongoDB on the JVM
Latinoware Rails 2009
Javascript the Language of the Web
2009, o ano do Ruby on Rails no Brasil - CaelumDay 2009
Semcomp de São Carlos
Macruby - RubyConf Presentation 2010
14 Ddply
The State of NoSQL
Standing on the shoulders of giants with JRuby
Software livre e padrões abertos no desenvolvimento Web
Apache Hadoop Talk at QCon
Ad

More from Ben Scofield (20)

PDF
How to Be Awesome in 2.5 Steps
PDF
Building Cloud Castles - LRUG
PDF
Great Developers Steal
PDF
Thinking Small
PDF
Open Source: A Call to Arms
PDF
Ship It
PDF
Building Cloud Castles
PDF
Intentionality: Choice and Mastery
PDF
Mastery or Mediocrity
PDF
With a Mighty Hammer
PDF
Mind Control - DevNation Atlanta
PDF
Understanding Mastery
PDF
Mind Control: Psychology for the Web
KEY
Charlotte.rb - "Comics" Is Hard
KEY
The Future of Data
PDF
WindyCityRails - "Comics" Is Hard
PDF
"Comics" Is Hard: Alternative Databases
KEY
Mind Control on the Web
KEY
How the Geeks Inherited the Earth
PDF
And the Greatest of These Is ... Space
How to Be Awesome in 2.5 Steps
Building Cloud Castles - LRUG
Great Developers Steal
Thinking Small
Open Source: A Call to Arms
Ship It
Building Cloud Castles
Intentionality: Choice and Mastery
Mastery or Mediocrity
With a Mighty Hammer
Mind Control - DevNation Atlanta
Understanding Mastery
Mind Control: Psychology for the Web
Charlotte.rb - "Comics" Is Hard
The Future of Data
WindyCityRails - "Comics" Is Hard
"Comics" Is Hard: Alternative Databases
Mind Control on the Web
How the Geeks Inherited the Earth
And the Greatest of These Is ... Space

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
KodekX | Application Modernization Development
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Spectral efficient network and resource selection model in 5G networks
KodekX | Application Modernization Development
Dropbox Q2 2025 Financial Results & Investor Presentation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
sap open course for s4hana steps from ECC to s4
Reach Out and Touch Someone: Haptics and Empathic Computing
Per capita expenditure prediction using model stacking based on satellite ima...
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology
Digital-Transformation-Roadmap-for-Companies.pptx
Teaching material agriculture food technology

NoSQL: Death to Relational Databases(?)