SlideShare une entreprise Scribd logo
1  sur  70
Not only SQL
   Mårten Gustafson
  Qbranch CODE tech-meet @ 2010-04-15
What?
“NoSQL is a movement promoting a loosely
defined class of non-relational data stores that
break with a long history of relational
databases” - Wikipedia
What?
“NoSQL is a movement promoting a loosely
defined class of non-relational data stores
that break with a long history of relational
databases” - Wikipedia
Not a single technique

Not a single type of data

Not a single type of use case
Why?

• Non-relational
• Schema-less
• “Easily” scalable
• REST/JSON API = web friendly
What’s out there?
                 Storage type        License      Implemented in
Amazon Dynamo      Key/Value            n/a               ?
   Cassandra      Columnfamily        ASL 2.0           Java
   CouchDB         Document           ASL 2.0          Erlang
   Dynomite        Key/Value       BSD/MIT-style       Erlang
     HBase        Columnfamily        ASL 2.0           Java
   MongoDB         Document         AGPL v3.0           C++
     Neo4J           Graph       AGPL v3.0 / Comm       Java
      Riak         Key/Value          ASL 2.0          Erlang
     Redis         Key/Value       BSD/MIT-style         C
    Scalaris       Key/Value          ASL 2.0          Erlang
 Tokyo Cabinet     Key/Value           LGPL              C
   Voldemort       Key/Value          ASL 2.0           Java
Distribution


• Master / Slave
• Master / Slave(s)
• Masterless (Master / Master)
Distribution
                       Masterless   Master/Slave   Hot standby
 Amazon Dynamo             X
     Cassandra             X
     CouchDB               X
     Dynomite              X
       HBase                             ?
     MongoDB                             X             X
      Neo4J*
        Riak               X
       Redis                             X
      Scalaris             X
   Tokyo Cabinet
     Voldemort             X
* Neo4J HA coming “soon”
Distribution
                           Masterless     Master/Slave
                                                                 ie
                                                         Hot standbyw
     Amazon Dynamo             X
                                                           d v
         Cassandra             X

                                                     ifie
                                                   l
         CouchDB               X
         Dynomite              X

                                           m p
                                          i
           HBase                               ?
         MongoDB

                                 y      s      X             X
          Neo4J*

                        e      r
                       v
            Riak               X


                     a
           Redis                               X


           is
          Scalaris             X



 h i     s
       Tokyo Cabinet
         Voldemort             X

T   * Neo4J HA coming “soon”
Common factor


   “...of the web...”
     Of the who?!
Of the web
“...Django may be built for the Web, but
CouchDB is built of the Web. I’ve never seen
software that so completely embraces the
philosophies behind HTTP. CouchDB
makes Django look old-school in the same way
that Django makes ASP look outdated”
- http://jacobian.org/writing/of-the-web/
Of the web

“...CouchDB may succeeded, and it may fail; who
knows. I’m sure of one thing, though — this is
what the software of the future looks like”
- http://jacobian.org/writing/of-the-web/
So freakin’ what?!



All your webish skillz and tools apply...
So freakin’ what?!
 language-, platform- and OS-neutral

load balancers                         proxies

                    MIME / Content-Type

   All your webish skillz and tools apply...

                 HTTP client libs (etag, if-modified-since, etc)
   caches
These guys can just suck it




  HTTP/REST is integration that works
                (YMMV)
Buckle Up Dorothy. Cause' Kansas, Is Going Bye-Bye
Key/Value Store


     I got keys but no locks
Riak

Decentralized key-value store
A flexible map/reduce engine
HTTP/JSON API
A database ideally suited for Web applications
The Ring
The Ring
            12     1
     11                    2

10                             3

9                              4

     8                     5
             7     6

          ring size = 12
The Ring


One Ring size to rule them all, One Ring size to
find them, One Ring size to bring them all and in
the cluster bind them...
Consistent Hashing
 Store/Save (PUT)
Consistent Hashing
 Store/Save (PUT)
Consistent Hashing
          Read (GET)
“I want “ is
answered by:
where is on
the ring?
Consistent Hashing
          Read (GET)
“I want “ is
answered by:
where is on
the ring?
Cluster

                                            Instance A


                                            Instance B


                                            Instance C


ring size = 12
instances = 3
ring size / nodes = ~slices per instances
Cluster

                                            Instance A


                                            Instance B


                                            Instance C


ring size = 12
instances = 3
ring size / nodes = ~slices per instances
Cluster - Read (GET)
  Instance A   Instance B   Instance C
Cluster - Read (GET)
I can haz    ?



                       Instance A   Instance B   Instance C

Hm,       lives in a
slice of the ring
owned by instance
C.
Cluster - Read (GET)
I can haz   ?



                 Instance A   Instance B   Instance C

                                                        Okidoki, now
     Hey C! I need                                      where’s he...a yeah
                                                        in my fourth slice
Cluster - Read (GET)
I can haz   ?
                                                         Here ya go


                Instance A     Instance B   Instance C

                     Cheers!
Riak “stuff”
Riak “stuff”




           Bucket
  Container/keyspace.
Determines number of
replicas for its contents
Riak “stuff”



                            Consistent Hashing
                                     Key hashing technique
                                     used to distribute keys
                                           on the ring



           Bucket
  Container/keyspace.
Determines number of
replicas for its contents
Shares state, bucket
and ring knowledge
   in the cluster
                                Riak “stuff”
              Gossiping




                             Consistent Hashing
                                      Key hashing technique
                                      used to distribute keys
                                            on the ring



            Bucket
   Container/keyspace.
 Determines number of
 replicas for its contents
Shares state, bucket
and ring knowledge
   in the cluster
                                Riak “stuff”
              Gossiping




                             Consistent Hashing
                                      Key hashing technique
                                      used to distribute keys
                                            on the ring                 Hinted Handoff
                                                                 Covering for a
            Bucket                                              failed “neighbor”
                                                                node while gone
   Container/keyspace.
 Determines number of
 replicas for its contents
Shares state, bucket
and ring knowledge
   in the cluster
                                Riak “stuff”                                   Allows retrieval of
                                                                             “weakly” linked objects

              Gossiping                                            Links



                             Consistent Hashing
                                      Key hashing technique
                                      used to distribute keys
                                            on the ring                 Hinted Handoff
                                                                 Covering for a
            Bucket                                              failed “neighbor”
                                                                node while gone
   Container/keyspace.
 Determines number of
 replicas for its contents
Shares state, bucket
and ring knowledge
   in the cluster
                                 Riak “stuff”                                      Allows retrieval of
                                                                                 “weakly” linked objects

              Gossiping                                                Links



                             Consistent Hashing
                                          Key hashing technique
                                          used to distribute keys
                                                on the ring                 Hinted Handoff
                                     Merkle Tree                     Covering for a
            Bucket                Data structure for
                                                                    failed “neighbor”
                                                                    node while gone
   Container/keyspace.         efficient summary about
 Determines number of             objects. Gossiped.
 replicas for its contents
Shares state, bucket
and ring knowledge
   in the cluster
                                 Riak “stuff”                                        Allows retrieval of
                                                                                   “weakly” linked objects

              Gossiping                                                Links


                                                                     Node
                             Consistent Hashing                        One server. Runs
                                                                      vnodes which claims
                                                                          partitions.
                                          Key hashing technique
                                          used to distribute keys
                                                on the ring                 Hinted Handoff
                                     Merkle Tree                     Covering for a
            Bucket                Data structure for
                                                                    failed “neighbor”
                                                                    node while gone
   Container/keyspace.         efficient summary about
 Determines number of             objects. Gossiped.
 replicas for its contents
Shares state, bucket
and ring knowledge
   in the cluster
                                 Riak “stuff”                                          Allows retrieval of
                                                                                     “weakly” linked objects
                                           Partition
              Gossiping                                                  Links
                                  One slice (part) of the ring.




                                                                       Node
                             Consistent Hashing                          One server. Runs
                                                                        vnodes which claims
                                                                            partitions.
                                            Key hashing technique
                                            used to distribute keys
                                                  on the ring                 Hinted Handoff
                                     Merkle Tree                       Covering for a
            Bucket                Data structure for
                                                                      failed “neighbor”
                                                                      node while gone
   Container/keyspace.         efficient summary about
 Determines number of             objects. Gossiped.
 replicas for its contents
Shares state, bucket
and ring knowledge
   in the cluster
                                 Riak “stuff”                                          Allows retrieval of
                                                                                     “weakly” linked objects
                                           Partition
              Gossiping                                                  Links
                                  One slice (part) of the ring.




                                                                       Node
Auto correction of
out-of-date objects
                             Consistent Hashing                          One server. Runs
                                                                        vnodes which claims
                                                                            partitions.
                 Read Repair                Key hashing technique
                                            used to distribute keys
                                                  on the ring                 Hinted Handoff
                                     Merkle Tree                       Covering for a
            Bucket                Data structure for
                                                                      failed “neighbor”
                                                                      node while gone
   Container/keyspace.         efficient summary about
 Determines number of             objects. Gossiped.
 replicas for its contents
Shares state, bucket
and ring knowledge
   in the cluster
                                 Riak “stuff”                                          Allows retrieval of
                                                                                     “weakly” linked objects
                                           Partition
              Gossiping                                                  Links
                                  One slice (part) of the ring.




                                                                       Node
Auto correction of
out-of-date objects
                             Consistent Hashing                          One server. Runs
                                                                        vnodes which claims
                                                                            partitions.
                 Read Repair                Key hashing technique
                                            used to distribute keys
                                                  on the ring                 Hinted Handoff
                                     Merkle Tree                       Covering for a
            Bucket                Data structure for
                                                                      failed “neighbor”
                                                                      node while gone         Number of copies
   Container/keyspace.         efficient summary about                                         of the same object
 Determines number of
 replicas for its contents
                                  objects. Gossiped.                    Replica                  in the cluster
Shares state, bucket
 and ring knowledge
    in the cluster
                                    Riak “stuff”                                          Allows retrieval of
                                                                                        “weakly” linked objects
                                              Partition
                Gossiping                                                   Links
   The complete “space”,             One slice (part) of the ring.
divided into partitions which
    are claimed by vnodes


     Ring                                                                 Node
 Auto correction of
 out-of-date objects
                                Consistent Hashing                          One server. Runs
                                                                           vnodes which claims
                                                                               partitions.
                   Read Repair                 Key hashing technique
                                               used to distribute keys
                                                     on the ring                 Hinted Handoff
                                        Merkle Tree                       Covering for a
              Bucket                 Data structure for
                                                                         failed “neighbor”
                                                                         node while gone         Number of copies
     Container/keyspace.          efficient summary about                                         of the same object
   Determines number of
   replicas for its contents
                                     objects. Gossiped.                    Replica                  in the cluster
Shares state, bucket
 and ring knowledge
    in the cluster
                                    Riak “stuff”                                           Allows retrieval of
                                                                                         “weakly” linked objects
                                              Partition
                Gossiping                                                     Links
   The complete “space”,             One slice (part) of the ring.
divided into partitions which

                                Vector Clock
    are claimed by vnodes
                                                                Conflic detection
                                                              technique for objects.
     Ring                                                                  Node
 Auto correction of
 out-of-date objects
                                Consistent Hashing                           One server. Runs
                                                                            vnodes which claims
                                                                                partitions.
                   Read Repair                 Key hashing technique
                                               used to distribute keys
                                                     on the ring                       Hinted Handoff
                                        Merkle Tree                       Covering for a
              Bucket                 Data structure for
                                                                         failed “neighbor”
                                                                         node while gone          Number of copies
     Container/keyspace.          efficient summary about                                          of the same object
   Determines number of
   replicas for its contents
                                     objects. Gossiped.                    Replica                   in the cluster
Shares state, bucket
 and ring knowledge
    in the cluster
                                    Riak “stuff”                                           Allows retrieval of
                                                                                         “weakly” linked objects
                                              Partition
                Gossiping                                                     Links
   The complete “space”,             One slice (part) of the ring.
                                                                                          Vnode
divided into partitions which

                                Vector Clock
    are claimed by vnodes
                                                                Conflic detection
                                                              technique for objects.
     Ring                                                                  Node                     Runs in a node
                                                                                                    and claims one
 Auto correction of
 out-of-date objects
                                Consistent Hashing                           One server. Runs
                                                                            vnodes which claims
                                                                                                    partition on the
                                                                                                           ring
                                                                                partitions.
                   Read Repair                 Key hashing technique
                                               used to distribute keys
                                                     on the ring                       Hinted Handoff
                                        Merkle Tree                       Covering for a
              Bucket                 Data structure for
                                                                         failed “neighbor”
                                                                         node while gone          Number of copies
     Container/keyspace.          efficient summary about                                          of the same object
   Determines number of
   replicas for its contents
                                     objects. Gossiped.                    Replica                   in the cluster
Riak - Takeaways

• No single point of failure
• Choose your levels for:
 • availability
 • consistency
 • partition tolerance
But wait, there’s more...

•   Binary data + Content-Type = whatever

    •   MP3’s, Images, Text, ...

•   Map/Reduce

    •   Local data, parallel
This slide intentionally left blank
Document Store


      Relax
CouchDB

Document oriented databased
Kick ass replication
HTTP/JSON API
Map/reduce view (index) definitions
World view
One document == JSON
One document == One record
Many documents == One database
Many databases == One instance
No schema
World view

Documents can
  have attachments (binary + mime type)
  be rendered differently (HTML, XML)
A document
                                                       Key, either you
                                                    choose it or CouchDB
                                                       does it for you
{
    "_id": "b098445d587b1f347e48e1a79301de02",
    "_rev": "1-80bfd8302e0f08eec2396c8107cafc19",
    "platform": {
       "browser": "mozilla",
       "version": "1.9.1.8"
    },
    "timestamp": 1270131033337
                                                       Revision
}                                                      number
Views

Filter
Collate
Aggregate
Views
{
    "_id": "b098445d587b1f347e48e1a79301de02",
    "_rev": "1-80bfd8302e0f08eec2396c8107cafc19",
    "platform": {
       "browser": "mozilla",
       "version": "1.9.1.8"
    },
    "timestamp": 1270131033337
}

+
function(doc)
{
  emit(doc.platform.browser, doc.platform.version);
}

=
{
    "total_rows": 1,
    "offset": 0,
    "rows": [
      "id": "b098445d587b1f347e48e1a79301de02",
      "key": "mozilla",
      "value": "1.9.1.8"
    ]
Views
Views are stored
     as an accessible web resource
     on disk
     and incrementally updated
     as well as replicated with the database
Replication
Peer to peer
Online/Offline
Conflict detection and resolution
Any number of nodes
     Local
     Remote
Replication
Replication
Replication
Replication
Replication
CouchDB “stuff”
CouchDB “stuff”


                          Append only
        Hence, won’t corrupt
            its data files
CouchDB “stuff”
       MVCC

Multi version concurrency control.
 Writers do not block readers.
 Readers do not block writers.                         Append only
                                     Hence, won’t corrupt
                                         its data files
CouchDB “stuff”
                             BDCRR
       MVCC                              Bi-directional, conflict
                                         resolving, replication
Multi version concurrency control.
 Writers do not block readers.
 Readers do not block writers.                          Append only
                                     Hence, won’t corrupt
                                         its data files
CouchDB “stuff”
                                      BDCRR
                MVCC                              Bi-directional, conflict
                                                  resolving, replication
         Multi version concurrency control.
          Writers do not block readers.
          Readers do not block writers.                          Append only

             Compaction                       Hence, won’t corrupt
                                                  its data files

Append only will cause data files to
grow. Compaction to the rescue, in
the background - for your pleasure.
CouchDB “stuff”
                                      BDCRR
                MVCC                                   Bi-directional, conflict
                                                       resolving, replication
         Multi version concurrency control.
          Writers do not block readers.
          Readers do not block writers.                               Append only

             Compaction                           Hence, won’t corrupt
                                                      its data files

Append only will cause data files to
grow. Compaction to the rescue, in                                     ACID
the background - for your pleasure.            Awesome, Cool,
                                              Impressive, Dope
CouchDB - Takeaways

• Kick ass replication
• Views are fast
• Can host and serve complete webapps
Outro

• Test one or more NoSQL thingys
• Get familiar with Brewers CAP theorem
• Get familiar with the Dynamo paper
Over and out.

Mårten Gustafson
@martengustafson

http://marten.gustafson.pp.se/

marten.gustafson@gmail.com

Contenu connexe

Tendances

Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Hiroshi SHIBATA
 
Thousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OThousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OGeorge Cao
 
Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)Chris Richardson
 
Apache Con Us2007 Jcr In Action
Apache Con Us2007 Jcr In ActionApache Con Us2007 Jcr In Action
Apache Con Us2007 Jcr In Actionday
 
Storing VMs with Cinder and Ceph RBD.pdf
Storing VMs with Cinder and Ceph RBD.pdfStoring VMs with Cinder and Ceph RBD.pdf
Storing VMs with Cinder and Ceph RBD.pdfOpenStack Foundation
 
What you need to know about ceph
What you need to know about cephWhat you need to know about ceph
What you need to know about cephEmma Haruka Iwao
 
QCT Ceph Solution - Design Consideration and Reference Architecture
QCT Ceph Solution - Design Consideration and Reference ArchitectureQCT Ceph Solution - Design Consideration and Reference Architecture
QCT Ceph Solution - Design Consideration and Reference ArchitecturePatrick McGarry
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleSean Cribbs
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Chris Richardson
 
Openstack with ceph
Openstack with cephOpenstack with ceph
Openstack with cephIan Colle
 
Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Chris Richardson
 
The container revolution, and what it means to operators.pptx
The container revolution, and what it means to operators.pptxThe container revolution, and what it means to operators.pptx
The container revolution, and what it means to operators.pptxRobert Starmer
 
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho and Riak at GOTO Stockholm:  "Don't Use My Database."Basho and Riak at GOTO Stockholm:  "Don't Use My Database."
Basho and Riak at GOTO Stockholm: "Don't Use My Database."Basho Technologies
 
DConf2015 - Using D for Development of Large Scale Primary Storage
DConf2015 - Using D for Development  of Large Scale Primary StorageDConf2015 - Using D for Development  of Large Scale Primary Storage
DConf2015 - Using D for Development of Large Scale Primary StorageLiran Zvibel
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017 Karan Singh
 
Developing polyglot persistence applications #javaone 2012
Developing polyglot persistence applications  #javaone 2012Developing polyglot persistence applications  #javaone 2012
Developing polyglot persistence applications #javaone 2012Chris Richardson
 
New Ceph capabilities and Reference Architectures
New Ceph capabilities and Reference ArchitecturesNew Ceph capabilities and Reference Architectures
New Ceph capabilities and Reference ArchitecturesKamesh Pemmaraju
 
Introduction to Tokyo Products
Introduction to Tokyo ProductsIntroduction to Tokyo Products
Introduction to Tokyo ProductsMikio Hirabayashi
 

Tendances (20)

Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 
librados
libradoslibrados
librados
 
Thousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OThousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/O
 
Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)
 
Apache Con Us2007 Jcr In Action
Apache Con Us2007 Jcr In ActionApache Con Us2007 Jcr In Action
Apache Con Us2007 Jcr In Action
 
Storing VMs with Cinder and Ceph RBD.pdf
Storing VMs with Cinder and Ceph RBD.pdfStoring VMs with Cinder and Ceph RBD.pdf
Storing VMs with Cinder and Ceph RBD.pdf
 
What you need to know about ceph
What you need to know about cephWhat you need to know about ceph
What you need to know about ceph
 
QCT Ceph Solution - Design Consideration and Reference Architecture
QCT Ceph Solution - Design Consideration and Reference ArchitectureQCT Ceph Solution - Design Consideration and Reference Architecture
QCT Ceph Solution - Design Consideration and Reference Architecture
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with Ripple
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)
 
Openstack with ceph
Openstack with cephOpenstack with ceph
Openstack with ceph
 
Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)
 
The container revolution, and what it means to operators.pptx
The container revolution, and what it means to operators.pptxThe container revolution, and what it means to operators.pptx
The container revolution, and what it means to operators.pptx
 
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho and Riak at GOTO Stockholm:  "Don't Use My Database."Basho and Riak at GOTO Stockholm:  "Don't Use My Database."
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
 
DConf2015 - Using D for Development of Large Scale Primary Storage
DConf2015 - Using D for Development  of Large Scale Primary StorageDConf2015 - Using D for Development  of Large Scale Primary Storage
DConf2015 - Using D for Development of Large Scale Primary Storage
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017
 
XenSummit - 08/28/2012
XenSummit - 08/28/2012XenSummit - 08/28/2012
XenSummit - 08/28/2012
 
Developing polyglot persistence applications #javaone 2012
Developing polyglot persistence applications  #javaone 2012Developing polyglot persistence applications  #javaone 2012
Developing polyglot persistence applications #javaone 2012
 
New Ceph capabilities and Reference Architectures
New Ceph capabilities and Reference ArchitecturesNew Ceph capabilities and Reference Architectures
New Ceph capabilities and Reference Architectures
 
Introduction to Tokyo Products
Introduction to Tokyo ProductsIntroduction to Tokyo Products
Introduction to Tokyo Products
 

Similaire à NoSQL @ Qbranch -2010-04-15

Cassandra for Sysadmins
Cassandra for SysadminsCassandra for Sysadmins
Cassandra for SysadminsNathan Milford
 
Accelerating NoSQL
Accelerating NoSQLAccelerating NoSQL
Accelerating NoSQLsunnygleason
 
Sparse Content Map Storage System
Sparse Content Map Storage SystemSparse Content Map Storage System
Sparse Content Map Storage Systemianeboston
 
DreamObjects - Ceph Day Nov 2012
DreamObjects - Ceph Day Nov 2012DreamObjects - Ceph Day Nov 2012
DreamObjects - Ceph Day Nov 2012Ceph Community
 
NoSQL Data Stores: Introduzione alle Basi di Dati Non Relazionali
NoSQL Data Stores: Introduzione alle Basi di Dati Non RelazionaliNoSQL Data Stores: Introduzione alle Basi di Dati Non Relazionali
NoSQL Data Stores: Introduzione alle Basi di Dati Non RelazionaliSteve Maraspin
 
On Rails with Apache Cassandra
On Rails with Apache CassandraOn Rails with Apache Cassandra
On Rails with Apache CassandraStu Hood
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataRoger Xia
 
Acunu & OCaml: Experience Report, CUFP
Acunu & OCaml: Experience Report, CUFPAcunu & OCaml: Experience Report, CUFP
Acunu & OCaml: Experience Report, CUFPAcunu
 
The DynaSlave Plugin
The DynaSlave PluginThe DynaSlave Plugin
The DynaSlave PluginBrian Moyles
 
Sparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With SparkSparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With SparkIan Pointer
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMarakana Inc.
 
Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...Chris Richardson
 
Building Reliable Cloud Storage with Riak and CloudStack - Andy Gross, Chief ...
Building Reliable Cloud Storage with Riak and CloudStack - Andy Gross, Chief ...Building Reliable Cloud Storage with Riak and CloudStack - Andy Gross, Chief ...
Building Reliable Cloud Storage with Riak and CloudStack - Andy Gross, Chief ...buildacloud
 
Ceph LISA'12 Presentation
Ceph LISA'12 PresentationCeph LISA'12 Presentation
Ceph LISA'12 PresentationCeph Community
 

Similaire à NoSQL @ Qbranch -2010-04-15 (20)

Cassandra for Sysadmins
Cassandra for SysadminsCassandra for Sysadmins
Cassandra for Sysadmins
 
No Sql
No SqlNo Sql
No Sql
 
Cassandra
CassandraCassandra
Cassandra
 
Accelerating NoSQL
Accelerating NoSQLAccelerating NoSQL
Accelerating NoSQL
 
Sparse Content Map Storage System
Sparse Content Map Storage SystemSparse Content Map Storage System
Sparse Content Map Storage System
 
NoSQL
NoSQLNoSQL
NoSQL
 
DreamObjects - Ceph Day Nov 2012
DreamObjects - Ceph Day Nov 2012DreamObjects - Ceph Day Nov 2012
DreamObjects - Ceph Day Nov 2012
 
Cassandra
CassandraCassandra
Cassandra
 
NoSQL Data Stores: Introduzione alle Basi di Dati Non Relazionali
NoSQL Data Stores: Introduzione alle Basi di Dati Non RelazionaliNoSQL Data Stores: Introduzione alle Basi di Dati Non Relazionali
NoSQL Data Stores: Introduzione alle Basi di Dati Non Relazionali
 
Cassandra勉強会
Cassandra勉強会Cassandra勉強会
Cassandra勉強会
 
On Rails with Apache Cassandra
On Rails with Apache CassandraOn Rails with Apache Cassandra
On Rails with Apache Cassandra
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Hbase jdd
Hbase jddHbase jdd
Hbase jdd
 
Acunu & OCaml: Experience Report, CUFP
Acunu & OCaml: Experience Report, CUFPAcunu & OCaml: Experience Report, CUFP
Acunu & OCaml: Experience Report, CUFP
 
The DynaSlave Plugin
The DynaSlave PluginThe DynaSlave Plugin
The DynaSlave Plugin
 
Sparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With SparkSparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With Spark
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
 
Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...
 
Building Reliable Cloud Storage with Riak and CloudStack - Andy Gross, Chief ...
Building Reliable Cloud Storage with Riak and CloudStack - Andy Gross, Chief ...Building Reliable Cloud Storage with Riak and CloudStack - Andy Gross, Chief ...
Building Reliable Cloud Storage with Riak and CloudStack - Andy Gross, Chief ...
 
Ceph LISA'12 Presentation
Ceph LISA'12 PresentationCeph LISA'12 Presentation
Ceph LISA'12 Presentation
 

Plus de Mårten Gustafson

2011 05-12 nosql-fritidsresor
2011 05-12 nosql-fritidsresor2011 05-12 nosql-fritidsresor
2011 05-12 nosql-fritidsresorMårten Gustafson
 
2011-06-01-stockholm-devops-blitz
2011-06-01-stockholm-devops-blitz2011-06-01-stockholm-devops-blitz
2011-06-01-stockholm-devops-blitzMårten Gustafson
 
2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-english2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-englishMårten Gustafson
 
2010-11-12 Databases overview
2010-11-12 Databases overview2010-11-12 Databases overview
2010-11-12 Databases overviewMårten Gustafson
 
WebSphere Message Broker In Shared Runtime Environments
WebSphere Message Broker In Shared Runtime EnvironmentsWebSphere Message Broker In Shared Runtime Environments
WebSphere Message Broker In Shared Runtime EnvironmentsMårten Gustafson
 
WebSphere Message Broker v6.x Overview - 2008-01-09
WebSphere Message Broker v6.x Overview - 2008-01-09WebSphere Message Broker v6.x Overview - 2008-01-09
WebSphere Message Broker v6.x Overview - 2008-01-09Mårten Gustafson
 

Plus de Mårten Gustafson (6)

2011 05-12 nosql-fritidsresor
2011 05-12 nosql-fritidsresor2011 05-12 nosql-fritidsresor
2011 05-12 nosql-fritidsresor
 
2011-06-01-stockholm-devops-blitz
2011-06-01-stockholm-devops-blitz2011-06-01-stockholm-devops-blitz
2011-06-01-stockholm-devops-blitz
 
2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-english2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-english
 
2010-11-12 Databases overview
2010-11-12 Databases overview2010-11-12 Databases overview
2010-11-12 Databases overview
 
WebSphere Message Broker In Shared Runtime Environments
WebSphere Message Broker In Shared Runtime EnvironmentsWebSphere Message Broker In Shared Runtime Environments
WebSphere Message Broker In Shared Runtime Environments
 
WebSphere Message Broker v6.x Overview - 2008-01-09
WebSphere Message Broker v6.x Overview - 2008-01-09WebSphere Message Broker v6.x Overview - 2008-01-09
WebSphere Message Broker v6.x Overview - 2008-01-09
 

Dernier

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Dernier (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

NoSQL @ Qbranch -2010-04-15

  • 1. Not only SQL Mårten Gustafson Qbranch CODE tech-meet @ 2010-04-15
  • 2. What? “NoSQL is a movement promoting a loosely defined class of non-relational data stores that break with a long history of relational databases” - Wikipedia
  • 3. What? “NoSQL is a movement promoting a loosely defined class of non-relational data stores that break with a long history of relational databases” - Wikipedia Not a single technique Not a single type of data Not a single type of use case
  • 4. Why? • Non-relational • Schema-less • “Easily” scalable • REST/JSON API = web friendly
  • 5. What’s out there? Storage type License Implemented in Amazon Dynamo Key/Value n/a ? Cassandra Columnfamily ASL 2.0 Java CouchDB Document ASL 2.0 Erlang Dynomite Key/Value BSD/MIT-style Erlang HBase Columnfamily ASL 2.0 Java MongoDB Document AGPL v3.0 C++ Neo4J Graph AGPL v3.0 / Comm Java Riak Key/Value ASL 2.0 Erlang Redis Key/Value BSD/MIT-style C Scalaris Key/Value ASL 2.0 Erlang Tokyo Cabinet Key/Value LGPL C Voldemort Key/Value ASL 2.0 Java
  • 6. Distribution • Master / Slave • Master / Slave(s) • Masterless (Master / Master)
  • 7. Distribution Masterless Master/Slave Hot standby Amazon Dynamo X Cassandra X CouchDB X Dynomite X HBase ? MongoDB X X Neo4J* Riak X Redis X Scalaris X Tokyo Cabinet Voldemort X * Neo4J HA coming “soon”
  • 8. Distribution Masterless Master/Slave ie Hot standbyw Amazon Dynamo X d v Cassandra X ifie l CouchDB X Dynomite X m p i HBase ? MongoDB y s X X Neo4J* e r v Riak X a Redis X is Scalaris X h i s Tokyo Cabinet Voldemort X T * Neo4J HA coming “soon”
  • 9. Common factor “...of the web...” Of the who?!
  • 10. Of the web “...Django may be built for the Web, but CouchDB is built of the Web. I’ve never seen software that so completely embraces the philosophies behind HTTP. CouchDB makes Django look old-school in the same way that Django makes ASP look outdated” - http://jacobian.org/writing/of-the-web/
  • 11. Of the web “...CouchDB may succeeded, and it may fail; who knows. I’m sure of one thing, though — this is what the software of the future looks like” - http://jacobian.org/writing/of-the-web/
  • 12. So freakin’ what?! All your webish skillz and tools apply...
  • 13. So freakin’ what?! language-, platform- and OS-neutral load balancers proxies MIME / Content-Type All your webish skillz and tools apply... HTTP client libs (etag, if-modified-since, etc) caches
  • 14. These guys can just suck it HTTP/REST is integration that works (YMMV)
  • 15. Buckle Up Dorothy. Cause' Kansas, Is Going Bye-Bye
  • 16. Key/Value Store I got keys but no locks
  • 17. Riak Decentralized key-value store A flexible map/reduce engine HTTP/JSON API A database ideally suited for Web applications
  • 19. The Ring 12 1 11 2 10 3 9 4 8 5 7 6 ring size = 12
  • 20. The Ring One Ring size to rule them all, One Ring size to find them, One Ring size to bring them all and in the cluster bind them...
  • 23. Consistent Hashing Read (GET) “I want “ is answered by: where is on the ring?
  • 24. Consistent Hashing Read (GET) “I want “ is answered by: where is on the ring?
  • 25. Cluster Instance A Instance B Instance C ring size = 12 instances = 3 ring size / nodes = ~slices per instances
  • 26. Cluster Instance A Instance B Instance C ring size = 12 instances = 3 ring size / nodes = ~slices per instances
  • 27. Cluster - Read (GET) Instance A Instance B Instance C
  • 28. Cluster - Read (GET) I can haz ? Instance A Instance B Instance C Hm, lives in a slice of the ring owned by instance C.
  • 29. Cluster - Read (GET) I can haz ? Instance A Instance B Instance C Okidoki, now Hey C! I need where’s he...a yeah in my fourth slice
  • 30. Cluster - Read (GET) I can haz ? Here ya go Instance A Instance B Instance C Cheers!
  • 32. Riak “stuff” Bucket Container/keyspace. Determines number of replicas for its contents
  • 33. Riak “stuff” Consistent Hashing Key hashing technique used to distribute keys on the ring Bucket Container/keyspace. Determines number of replicas for its contents
  • 34. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Gossiping Consistent Hashing Key hashing technique used to distribute keys on the ring Bucket Container/keyspace. Determines number of replicas for its contents
  • 35. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Gossiping Consistent Hashing Key hashing technique used to distribute keys on the ring Hinted Handoff Covering for a Bucket failed “neighbor” node while gone Container/keyspace. Determines number of replicas for its contents
  • 36. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Allows retrieval of “weakly” linked objects Gossiping Links Consistent Hashing Key hashing technique used to distribute keys on the ring Hinted Handoff Covering for a Bucket failed “neighbor” node while gone Container/keyspace. Determines number of replicas for its contents
  • 37. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Allows retrieval of “weakly” linked objects Gossiping Links Consistent Hashing Key hashing technique used to distribute keys on the ring Hinted Handoff Merkle Tree Covering for a Bucket Data structure for failed “neighbor” node while gone Container/keyspace. efficient summary about Determines number of objects. Gossiped. replicas for its contents
  • 38. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Allows retrieval of “weakly” linked objects Gossiping Links Node Consistent Hashing One server. Runs vnodes which claims partitions. Key hashing technique used to distribute keys on the ring Hinted Handoff Merkle Tree Covering for a Bucket Data structure for failed “neighbor” node while gone Container/keyspace. efficient summary about Determines number of objects. Gossiped. replicas for its contents
  • 39. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Allows retrieval of “weakly” linked objects Partition Gossiping Links One slice (part) of the ring. Node Consistent Hashing One server. Runs vnodes which claims partitions. Key hashing technique used to distribute keys on the ring Hinted Handoff Merkle Tree Covering for a Bucket Data structure for failed “neighbor” node while gone Container/keyspace. efficient summary about Determines number of objects. Gossiped. replicas for its contents
  • 40. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Allows retrieval of “weakly” linked objects Partition Gossiping Links One slice (part) of the ring. Node Auto correction of out-of-date objects Consistent Hashing One server. Runs vnodes which claims partitions. Read Repair Key hashing technique used to distribute keys on the ring Hinted Handoff Merkle Tree Covering for a Bucket Data structure for failed “neighbor” node while gone Container/keyspace. efficient summary about Determines number of objects. Gossiped. replicas for its contents
  • 41. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Allows retrieval of “weakly” linked objects Partition Gossiping Links One slice (part) of the ring. Node Auto correction of out-of-date objects Consistent Hashing One server. Runs vnodes which claims partitions. Read Repair Key hashing technique used to distribute keys on the ring Hinted Handoff Merkle Tree Covering for a Bucket Data structure for failed “neighbor” node while gone Number of copies Container/keyspace. efficient summary about of the same object Determines number of replicas for its contents objects. Gossiped. Replica in the cluster
  • 42. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Allows retrieval of “weakly” linked objects Partition Gossiping Links The complete “space”, One slice (part) of the ring. divided into partitions which are claimed by vnodes Ring Node Auto correction of out-of-date objects Consistent Hashing One server. Runs vnodes which claims partitions. Read Repair Key hashing technique used to distribute keys on the ring Hinted Handoff Merkle Tree Covering for a Bucket Data structure for failed “neighbor” node while gone Number of copies Container/keyspace. efficient summary about of the same object Determines number of replicas for its contents objects. Gossiped. Replica in the cluster
  • 43. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Allows retrieval of “weakly” linked objects Partition Gossiping Links The complete “space”, One slice (part) of the ring. divided into partitions which Vector Clock are claimed by vnodes Conflic detection technique for objects. Ring Node Auto correction of out-of-date objects Consistent Hashing One server. Runs vnodes which claims partitions. Read Repair Key hashing technique used to distribute keys on the ring Hinted Handoff Merkle Tree Covering for a Bucket Data structure for failed “neighbor” node while gone Number of copies Container/keyspace. efficient summary about of the same object Determines number of replicas for its contents objects. Gossiped. Replica in the cluster
  • 44. Shares state, bucket and ring knowledge in the cluster Riak “stuff” Allows retrieval of “weakly” linked objects Partition Gossiping Links The complete “space”, One slice (part) of the ring. Vnode divided into partitions which Vector Clock are claimed by vnodes Conflic detection technique for objects. Ring Node Runs in a node and claims one Auto correction of out-of-date objects Consistent Hashing One server. Runs vnodes which claims partition on the ring partitions. Read Repair Key hashing technique used to distribute keys on the ring Hinted Handoff Merkle Tree Covering for a Bucket Data structure for failed “neighbor” node while gone Number of copies Container/keyspace. efficient summary about of the same object Determines number of replicas for its contents objects. Gossiped. Replica in the cluster
  • 45. Riak - Takeaways • No single point of failure • Choose your levels for: • availability • consistency • partition tolerance
  • 46. But wait, there’s more... • Binary data + Content-Type = whatever • MP3’s, Images, Text, ... • Map/Reduce • Local data, parallel
  • 48. Document Store Relax
  • 49. CouchDB Document oriented databased Kick ass replication HTTP/JSON API Map/reduce view (index) definitions
  • 50. World view One document == JSON One document == One record Many documents == One database Many databases == One instance No schema
  • 51. World view Documents can have attachments (binary + mime type) be rendered differently (HTML, XML)
  • 52. A document Key, either you choose it or CouchDB does it for you { "_id": "b098445d587b1f347e48e1a79301de02", "_rev": "1-80bfd8302e0f08eec2396c8107cafc19", "platform": { "browser": "mozilla", "version": "1.9.1.8" }, "timestamp": 1270131033337 Revision } number
  • 54. Views { "_id": "b098445d587b1f347e48e1a79301de02", "_rev": "1-80bfd8302e0f08eec2396c8107cafc19", "platform": { "browser": "mozilla", "version": "1.9.1.8" }, "timestamp": 1270131033337 } + function(doc) { emit(doc.platform.browser, doc.platform.version); } = { "total_rows": 1, "offset": 0, "rows": [ "id": "b098445d587b1f347e48e1a79301de02", "key": "mozilla", "value": "1.9.1.8" ]
  • 55. Views Views are stored as an accessible web resource on disk and incrementally updated as well as replicated with the database
  • 56. Replication Peer to peer Online/Offline Conflict detection and resolution Any number of nodes Local Remote
  • 63. CouchDB “stuff” Append only Hence, won’t corrupt its data files
  • 64. CouchDB “stuff” MVCC Multi version concurrency control. Writers do not block readers. Readers do not block writers. Append only Hence, won’t corrupt its data files
  • 65. CouchDB “stuff” BDCRR MVCC Bi-directional, conflict resolving, replication Multi version concurrency control. Writers do not block readers. Readers do not block writers. Append only Hence, won’t corrupt its data files
  • 66. CouchDB “stuff” BDCRR MVCC Bi-directional, conflict resolving, replication Multi version concurrency control. Writers do not block readers. Readers do not block writers. Append only Compaction Hence, won’t corrupt its data files Append only will cause data files to grow. Compaction to the rescue, in the background - for your pleasure.
  • 67. CouchDB “stuff” BDCRR MVCC Bi-directional, conflict resolving, replication Multi version concurrency control. Writers do not block readers. Readers do not block writers. Append only Compaction Hence, won’t corrupt its data files Append only will cause data files to grow. Compaction to the rescue, in ACID the background - for your pleasure. Awesome, Cool, Impressive, Dope
  • 68. CouchDB - Takeaways • Kick ass replication • Views are fast • Can host and serve complete webapps
  • 69. Outro • Test one or more NoSQL thingys • Get familiar with Brewers CAP theorem • Get familiar with the Dynamo paper
  • 70. Over and out. Mårten Gustafson @martengustafson http://marten.gustafson.pp.se/ marten.gustafson@gmail.com

Notes de l'éditeur

  1. * Relational not always most suitable model * Schema-less gives freedom * Non-relational gives interesting scalability capabilities (which most provides) * Most provides REST/JSON API ** Very suitable for web dev’t ** Easy peasy to use, regardless of environment
  2. * Hinted handoff
  3. * Hinted handoff
  4. * Hinted handoff
  5. * Hinted handoff
  6. * Hinted handoff
  7. * Hinted handoff
  8. * Hinted handoff
  9. * Hinted handoff
  10. * Hinted handoff
  11. * Hinted handoff
  12. * Hinted handoff
  13. * Hinted handoff
  14. * Hinted handoff
  15. * Hinted handoff
  16. * Hinted handoff
  17. * Hinted handoff
  18. collation - assembling in proper numerical or logical sequence
  19. Simplified view explanation