SlideShare a Scribd company logo
1 of 51
Download to read offline
A highly scalable, eventually consistent, distributed,
                        structured key-value store.




Wednesday, December 16, 2009
Why

                   • Scaling existing Relational
                          Databases is hard.
                   • Sharding is one solution, but
                          makes your RDBMS unusuable.
                   • Operational Nightmare.

Wednesday, December 16, 2009
The Bigdata Age
              • Scale horizontally, just add more
                     servers
              • Cluster growth. Load balance
                     automatically
              • Flexible schemas
              • Key-Oriented Queries
              • High Availability, 24 x 7 x 365
Wednesday, December 16, 2009
Cassandra Design
                 •      High availability.

                 •      Eventual consistency.

                 •      Incremental scalability.

                 •      Optimistic Replication.

                 •      Low total cost of ownership.

                 •      Tunable tradeoffs between consistency &
                        latency.

                 •      Minimal administration.

Wednesday, December 16, 2009
General Data Models
                                         "contents:"         "anchor:cnnsi.com"        "anchor:my.look.ca"

     Key-Value
                                           "<html>..."       t3
            "com.cnn.www"                <html>
                                         "<html>..."      t5        "CNN"        t9        "CNN.com"          t8
                                       "<html>..."     t6




Figure 1: A slice of an example table that stores Web pages. The row name is a reversed URL. The contents column family con-
tains the page contents, and the anchor column family contains the text of any anchors that reference the page. CNN’s home page
                                           "contents:"        "anchor:cnnsi.com" "anchor:my.look.ca"
is referenced by both the Sports Illustrated and the MY-look home pages, so the row contains columns named anchor:cnnsi.com
 Key-Columns
and anchor:my.look.ca. Each anchor cell has one version; the contents column has three versions, at timestamps t 3 , t5 , and t6 .

                                         "<html>..."        t
           "com.cnn.www"               "<html>..."a variety3
                                                         t5        "CNN"         t         "CNN.com"          t8
  We settled on this data model after examining
                                    "<html>..."                    Column Families
                                                                             9
                                                      t6
of potential uses of a Bigtable-like system. As one con-
crete example that drove some of our design decisions,             Column keys are grouped into sets called column fami-
suppose we want to keep a copy of a large collection of            lies, which form the basic unit of access control. All data
web pages and related information that could be used by            stored in a column family is usually of the same type (we
Figure 1: A slice of an example table that stores Web pages. The compress a reversed URL. The contents column family con-
many different projects; let us call this particular table row name is data in the same column family together). A
tains the page contents, and the anchor column family contains the column family must be createdthe page. CNN’s home page
                                                                   text of any anchors that reference before data can be stored
the Webtable. In Webtable, we would use URLs as row
                                                                   under any row contains columns named anchor:cnnsi.com
is referenced by both the Sports Illustrated and the MY-look home pages, so thecolumn key in that family; after a family has
keys, various aspects ofEach anchor as column names, and contents column has three versions, at timestamps t , t , and t .
and anchor:my.look.ca. web pages cell has one version; the         been created, any column key within the family can be
                                                                                                                 3 5       6
store the contents of the web pages in the contents: col-
umn under the timestamps when they were fetched, as                used. It is our intent that the number of distinct column
                                                                 Bigtable: Ain a table be small (in the hundreds at most), - Google Inc
                                                                   families Families Storage System for Structured Data and
                                                                             Distributed
illustrated in Figure 1. model after examining a variety
    We settled on this data                                        Column
of potential uses16, 2009
                    of a Bigtable-like system. As one con-         that families rarely change during operation. In contrast,
Wednesday, December
General Data Models
                                         "contents:"         "anchor:cnnsi.com"        "anchor:my.look.ca"

     Key-Value
                                           "<html>..."       t3
            "com.cnn.www"                <html>
                                         "<html>..."      t5        "CNN"        t9        "CNN.com"          t8
                                       "<html>..."     t6




Figure 1: A slice of an example table that stores Web pages. The row name is a reversed URL. The contents column family con-
tains the page contents, and the anchor column family contains the text of any anchors that reference the page. CNN’s home page
                                           "contents:"        "anchor:cnnsi.com" "anchor:my.look.ca"
is referenced by both the Sports Illustrated and the MY-look home pages, so the row contains columns named anchor:cnnsi.com
 Key-Columns
and anchor:my.look.ca. Each anchor cell has one version; the contents column has three versions, at timestamps t 3 , t5 , and t6 .

                                         "<html>..."        t
           "com.cnn.www"               "<html>..."a variety3
                                                         t5        "CNN"         t         "CNN.com"          t8
  We settled on this data model after examining
                                    "<html>..."                    Column Families
                                                                             9
                                                      t6
of potential uses of a Bigtable-like system. As one con-
crete example that drove some of our design decisions,             Column keys are grouped into sets called column fami-
suppose we want to keep a copy of a large collection of            lies, which form the basic unit of access control. All data
                                     Column Family
web pages and related information that could be used by            stored in a column Family usually of the same type (we
                                                                            Column family is
Figure 1: A slice of an example table that stores Web pages. The compress a reversed URL. The contents column family con-
many different projects; let us call this particular table row name is data in the same column family together). A
tains the page contents, and the anchor column family contains the column family must be createdthe page. CNN’s home page
                                                                   text of any anchors that reference before data can be stored
the Webtable. In Webtable, we would use URLs as row
                                                                   under any row contains columns named anchor:cnnsi.com
is referenced by both the Sports Illustrated and the MY-look home pages, so thecolumn key in that family; after a family has
keys, various aspects ofEach anchor as column names, and contents column has three versions, at timestamps t , t , and t .
andColumn Family web pages cell has one version; the Group” in Google’s Bigtable terminologycan be
     anchor:my.look.ca. is also named a “Locality                  been created, any column key within the family 6
                                                                                                                 3 5
store the contents of the web pages in the contents: col-
umn under the timestamps when they were fetched, as                used. It is our intent that the number of distinct column
                                                                 Bigtable: Ain a table be small (in the hundreds at most), - Google Inc
                                                                   families Families Storage System for Structured Data and
                                                                             Distributed
illustrated in Figure 1. model after examining a variety
    We settled on this data                                        Column
of potential uses16, 2009
                    of a Bigtable-like system. As one con-         that families rarely change during operation. In contrast,
Wednesday, December
STORAGE LAYOUTS




Wednesday, December 16, 2009
Row-based Storage
                     Row-Based storage



                   • Pros:GoodRead/Write of adisk and in cache) in
                     Pros:                            single row
                          a single IO operation
                               locality of access (on            of
                            different columns
                   • Cons:Cons: If you a single row scan a IO operation.
                            Read/write of want to is a single only

                          one column youscan only one column, you still
                             But if you want to
                                                still read all data.
                               read all.   Design Patterns for Distributed Non-Relational Databases - Todd Lipcon, Cloudera

Wednesday, December 16, 2009
Columnar Storage
                          Columnar storage



               • Pros: good locality of access for
                 Pros:
                      differentfor a given column is stored sequentially
                           Data columns
                         Scanning a single column (eg aggregate queries) is
               •      Cons: Reading a single row may
                         fast
                      seek once per column
                      Cons:
                               Reading a Design Patterns for Distributed Non-Relational Databases - Todd Lipcon, Cloudera
                                          single row may seek once per column.
Wednesday, December 16, 2009
Columnar Storage with Locality Groups
                     with Column Family



               • Pros: Scanning a single column
                    (aggregate queries) is fast
                   Columns are organized into families (“locality
                   groups”)
               •    Cons: Reading a single row may
                   Benefits of row-based layout within a group.
                    seek once per column
                   Benefits of column-based - Non-Relational have- Todd Lipcon, Cloudera
                                Design Patterns for Distributed
                                                                don’t Databases to read
                   groups you don’t care about.
Wednesday, December 16, 2009
Log Structured Merge
                            Trees
        Convert random writes to sequential writes.

   •      Writes go to a commit log and in-memory storage (Memtable)

   •      The Memtable is occasionally flushed to disk (SSTable)

   •      The SSTables are periodically compacted into one.



                               The log-structured merge-tree (LSM-tree) P. E. O’Neil, E. Cheng, D. Gawlick, and E. J. O’Neil.

Wednesday, December 16, 2009
Write Operations
                                 Write                 Read




                                            Memtable          RAM

                               Commit Log   SSTable



 (DISK)                                     SSTable           DISK
                                            SSTable




Wednesday, December 16, 2009
Read Operations
                                 Write                 Read




                                            Memtable          RAM

                               Commit Log   SSTable



 (DISK)                                     SSTable           DISK
                                            SSTable




Wednesday, December 16, 2009
Read Operations
                                 Write                       Read




                                            Memtable                RAM

                               Commit Log   SSTable



 (DISK)                                     SSTable                 DISK
                                            SSTable




                                                  Bloom Filter
Wednesday, December 16, 2009
Flush Memtable
                                 Write                 Read




                                            Memtable          RAM

                               Commit Log   SSTable



 (DISK)                                     SSTable           DISK
                                            SSTable




Wednesday, December 16, 2009
Flush Memtable


                                                 RAM
                                     SSTable 4


                                     SSTable 3

 (DISK)                              SSTable 2
                                                 DISK
                                     SSTable 1




Wednesday, December 16, 2009
Compactation


                                                                  RAM
                                    SSTable 4


                                    SSTable 3

 (DISK)                             SSTable 2
                                                     SSTable 1'
                                                                  DISK
                                    SSTable 1




                                            Merge Sort
Wednesday, December 16, 2009
Compactation


                                                 RAM



 (DISK)                             SSTable 1'
                                                 DISK



Wednesday, December 16, 2009
Write Operations
                                 Write                    Read




                                            Memtable             RAM

                               Commit Log   SSTable



 (DISK)                                     SSTable
                                             SSTable 1'
                                                                 DISK
                                            SSTable




Wednesday, December 16, 2009
WRITE PROPERTIES
                   • No locks in the critical path
                   • Sequential disk access
                   • Behaves like a write back Cache
                   • Append support without read ahead
                   • Atomicity guarantee for a key
                   • “Always Writable” –accept writes during
                          failure scenarios


Wednesday, December 16, 2009
CAP Theorem
                   • CONSISTENCY:
                          ...how and whether a system is left in a consistent state after an
                          operation.


                   • AVAILABILITY:
                          refers to system such that it is ensured to remain operational over
                          some period of time.


                   • PARTITION-TOLERANCE:
                          Ability for a system to continue to operate in the presence of a
                          network partitions.




Wednesday, December 16, 2009
Eventual Consistency
                   • As t! !, readers will see writes.
                   • In a steady state, the system is
                          guaranteed to eventually return the
                          las written value.
                   • Examples: DNS or MySQL slave
                          replication.


Wednesday, December 16, 2009
Partitioning Scheme: Consistent Hashing


                                          h(key)




Wednesday, December 16, 2009
Partitioning Scheme: Consistent Hashing




                                       key previously
                                        owned by A
Wednesday, December 16, 2009
Partitioning Scheme: Consistent Hashing




Wednesday, December 16, 2009
Partitioning Scheme: Replication




                                                     N=3




Wednesday, December 16, 2009
Read Repair
                                                        Client


                                                 Query       Result

                                                      Cassandra Cluster


                                         Closest replica     Result
                                                       Replica A


                                                      Digest Query
                               Digest Response                            Digest Response


                                          Replica B                   Replica C



Wednesday, December 16, 2009
Read Repair
                                                        Client


                                                 Query       Result

                                                      Cassandra Cluster


                                         Closest replica     Result
                                                                                  Read repair if digests differ
                                                       Replica A


                                                      Digest Query
                               Digest Response                            Digest Response


                                          Replica B                   Replica C



Wednesday, December 16, 2009
Cluster Memebership

                 •      Gossip protocol is used for cluster membership.

                 •      Super lightweight with mathematically provable
                        properties.

                 •      State disseminated in O(log2 N) rounds where
                        N is the number of nodes in the cluster.

                 •      A member merges the list with its own list.

                 •      Every T seconds each member increments its
                        heartbeat counter and selects one other
                        member to send its list to.


Wednesday, December 16, 2009
Gossip Algorithm




Wednesday, December 16, 2009
Gossip Algorithm: Round 1




Wednesday, December 16, 2009
Gossip Algorithm: Round 2




Wednesday, December 16, 2009
Gossip Algorithm: Round 3




Wednesday, December 16, 2009
Gossip Algorithm: Round 4




Wednesday, December 16, 2009
DATA MODEL




Wednesday, December 16, 2009
Hierarchy

                  • ClusterName
                  • KeySpace      / Database / Delicious
                  • ColumFamily   / Table    / Users
                  • key           / ID        / 12345
                  • column        / Attribute / email



Wednesday, December 16, 2009
DATA MODEL:Columns
              COLUMN FAMILY: Users


                               Name         Name         Name         Name         Name
                  !"#          Value        Value        Value        Value        Value
                               Timestamp    Timestamp    Timestamp    Timestamp    Timestamp

                               name         lastname     likes
                  $%&'()(      Pablo        Delgado      Sugar
                               #timestamp   #timestamp   #timestamp


                               name         lastname
                  %*)+*,+      Antonio      Garrote
                               #timestamp   #timestamp


                               name         lastname     age          language     updated_at
                  -%./+        Mauro        Pompilio     25           es           2009/05/03
                               #timestamp   #timestamp   #timestamp   #timestamp   #timestamp




Wednesday, December 16, 2009
DATA MODEL:Columns
              COLUMN FAMILY: Users


                               Name         Name         Name         Name         Name
                  !"#          Value        Value        Value        Value        Value
                               Timestamp    Timestamp    Timestamp    Timestamp    Timestamp

                               name         lastname     likes
                                                                      ordered column keys
                  $%&'()(      Pablo        Delgado      Sugar
                               #timestamp   #timestamp   #timestamp


                               name         lastname
                  %*)+*,+      Antonio      Garrote
                               #timestamp   #timestamp


                               name         lastname     age          language     updated_at
                  -%./+        Mauro        Pompilio     25           es           2009/05/03
                               #timestamp   #timestamp   #timestamp   #timestamp   #timestamp




                    ordered keys

Wednesday, December 16, 2009
DATA MODEL: SuperColumns


        COLUMN FAMILY: Tags

                               Name               Name       Name



            KEY




                               beach              mountain



            pablete




Wednesday, December 16, 2009
DATA MODEL: SuperColumns


        COLUMN FAMILY: Tags

                               Name               Name              Name



            KEY




                               beach              mountain
                                                             ordered supercolumn keys
            pablete




             ordered keys



Wednesday, December 16, 2009
DATA MODEL: SuperColumns


        COLUMN FAMILY: Tags

                               Name                                Name                  Name
                                Name        Name        Name        Name         Name     Name    Name
                                Title       Title       Title       Title        Title    Title   Title
            KEY
                                Name                                Name                  Name    Name
                                Title                               Title                 Title   Title




                               beach                               mountain
                                9876        843         777          1234
                                san-diego   barcelona   cadaques     barcelona

            pablete
                                654         555         78
                                                                     888
                                niza        sicilia     trapani
                                                                     andorra




Wednesday, December 16, 2009
DATA MODEL: SuperColumns


        COLUMN FAMILY: Tags

                               Name                                Name                    Name
                                Name        Name        Name        Name         Name       Name     Name
                                Title       Title       Title       Title        Title      Title    Title
            KEY
                                Name                                Name                    Name     Name
                                Title                               Title                   Title    Title




                               beach                               mountain         ordered supercolumn keys
                                9876        843         777          1234
                                san-diego   barcelona   cadaques     barcelona      ordered column keys
            pablete
                                654         555         78
                                                                     888
                                niza        sicilia     trapani
                                                                     andorra




             ordered keys



Wednesday, December 16, 2009
Ruby Thrift Client
         !"#$%!"&'()*+,,+-.!+'
         !"#$%!"&'()*+,,+-.!+/*0-,1+-1,'
         !"#$%!"&'()*+,,+-.!+/123",'
         !"#$%!"&'33'

         1!+-,30!1&4&56!%71889$77"!".5!+-,30!1(-":;56!%7188<0*="1(-":;>?0*+?60,1>@&>ABCD>EE
         1!+-,30!1(03"-
         *?%"-1&4&F+,,+-.!+56!%7188F+,,+-.!+88F?%"-1(-":;56!%71889%-+!2G!010*0?(-":;1!+-,30!1EE

         ="2,3+*"&4&>9?0H>
         ="2&4&>.$."/?0H%->
         *0?$I-G+16&4&F+,,+-.!+56!%7188F0?$I-G+16(-":;8*0?$I-/7+I%?2&4J&>K,"!,>@&8*0?$I-&4J&>"I+%?>E
         L+?$"&4&>.$."M"N+I3?"(*0I>
         1&4&5%I"(-0:
         1%I",1+I3&4&1(10/%&O&B/DDD/DDD&P&1($,"*

         *?%"-1(%-,"!1;="2,3+*"@&="2&@*0?$I-G+16@&L+?$"@&1%I",1+I3@&F+,,+-.!+56!%7188F0-,%,1"-*2Q"L"?88RSTUE
         V"H%-
         &&33&*?%"-1(H"1;="2,3+*"@&="2@&*0?$I-G+16@&F+,,+-.!+56!%7188F0-,%,1"-*2Q"L"?88UWSE
         !",*$"&F+,,+-.!+56!%7188W01X0$-.SN*"31%0-&4J&"
         &&3$1,&>Y"2&-01&70$-.(>
         "-.

         Z4J&'.$."M+:",0I"(*0I'




                                                            http://wiki.apache.org/cassandra/ClientExamples
Wednesday, December 16, 2009
Ruby with Cassandra gem
          !"#$%!"&'!$V2H"I,'
          !"#$%!"&'*+,,+-.!+'
          !"#$%!"&'33'
          %-*?$."&F+,,+-.!+88F0-,1+-1,
          *?%"-1&4&F+,,+-.!+(-":;'9?0H'@&>B[(D(D(B8ABCD>E

          Z&FUQK]W<
          *?%"-1(%-,"!1;8K,"!,@&'+:",0I".$."'@&^'"I+%?'&4J&'.$."M+:",0I"(*0I'_E
          *0?$I-,&4&*?%"-1(H"1;8K,"!,@&'+:",0I".$."'E
          33&*0?$I-,`'"I+%?'a
          Z4J&'.$."M+:",0I"(*0I'

          Z&<KGSTFUQK]W<
          *?%"-1(%-,"!1;85+H,@&'+:",0I".$."'@&^'V"+*6'&4J&^KKbc(-":&4J&',+-.%"H0'__E
          *?%"-1(%-,"!1;85+H,@&'+:",0I".$."'@&^'V"+*6'&4J&^KKbc(-":&4J&'V+!*"?0-+'__E
          *?%"-1(%-,"!1;85+H,@&'+:",0I".$."'@&^'I0$-1+%-'&4J&^KKbc(-":&4J&>V+!*"?0-+>@&KKbc(-":&4J&>+-.0!!+>__E
          &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
          1+H,&4&*?%"-1(H"1;85+H,@&'+:",0I".$."'E
          33&1+H,(="2,
          Z4J&`>V"+*6>@>I0$-1+%->a

          1+H,&4&*?%"-1(H"1;85+H,@&'+:",0I".$."'@'V"+*6'E
          33&30,1/="2,&4&1+H,(I+3&^&d1%I",1+I3@&="2d&="2&_
          Z4J&`>,+-.%"H0>@&>V+!*"?0-+>a
          *?%"-1(!"I0L";85+H,@&'+:",0I".$."'E




                                                                            http://github.com/fauna/cassandra
Wednesday, December 16, 2009
Ruby with CassandraObject (Rails 3)
                *?+,,&F$,10I"!&e&F+,,+-.!+UVf"*1889+,"
                &&+11!%V$1"&87%!,1/-+I"@&8123"&&&&4J&<1!%-H
                &&+11!%V$1"&8?+,1/-+I"@&8123"&&&&&4J&<1!%-H
                &&+11!%V$1"&8.+1"/07/V%!16@&8123"&4J&c+1"
                &&+11!%V$1"&83!"7"!"-*",@&8123"&&&4J&g+,6

                &&L+?%.+1"&8,60$?./V"/*00?

                &&="2&8$$%.

                &&%-."N&8?+,1/-+I"@&8!"L"!,".&4J&1!$"

                &&+,,0*%+1%0-&8%-L0%*",@&8$-%#$"&4J&7+?,"@&8%-L"!,"/07&4J&8*$,10I"!@&8!"L"!,".&4J&1!$"

                &&3!%L+1"

                &&."7&,60$?./V"/*00?
                &&&&$-?",,&`>]%*6+"?>@&>h-%=+>@&>SL+->a(%-*?$."i;7%!,1/-+I"E
                &&&&&&"!!0!,(+..;87%!,1/-+I"@&>I$,1&V"&16+1&07&+&*00?&3"!,0->E
                &&&&"-.
                &&"-.

                "-.




                                                                    http://github.com/NZKoz/cassandra_object
Wednesday, December 16, 2009
Model with a ruby Hash*
   .+1+V+,"&4&g+,6(-":
   .+1+V+,"&4&^>K,"!,>&4J&^>I+?.%10H""=>&4J&^>-0IV!">&4J&>]+$!0>@&>+3"??%.0>&4J&>G0I3%?%0>&__@
   &&&&&&&&&&&&&&&&&&&&&&&^>3+V?"1">&&&&&4J&^>-0IV!">&4J&>G+V?0>@&>"I+%?>&&&&4J&>3+V?"1"MHI+%?(*0I>__@
   &&&&&&&&&&&&&&&&&&&&&&&^>N$!.">&&&&&&&4J&^>-0IV!">&4J&>j0!H">@&>?+-H$+H">&4J&>+,1$!%+-$>&__
   &&&&&&&&&&&_@

   &&&&&&&&&&&^>5+H,>&4J&^>I+?.%10H""=>&4J&^>7?0:"!>&&4J&^>[DD)D)Bk>&4J&>B[lm>@&>[DD)DC)Bk>&4J&>km[>&_@
   &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&>3?+*",>&&4J&^>[DD)BB)Bk>&4J&>ln>@&&>[DD)BD)Bl>&4J&>k>&_@
   &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&>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3$1,&.+1+V+,"`>K,"!,>a`>3+V?"1">a`>"I+%?>a


   Zr%L"&I"&16"&36010,&1+H".&>7?0:"!>&70!&$,"!&>I+?.%10H""=>
   3$1,&.+1+V+,"`>5+H,>a`>I+?.%10H""=>a`>7?0:"!>a(L+?$",


   3$1,&.+1+V+,"`>G6010,>a`>B[lm>a`>1%1?">a

                                                                      *ordered hash, ruby 1.9 for example
Wednesday, December 16, 2009
Model with a ruby Hash*
   .+1+V+,"&4&g+,6(-":
   .+1+V+,"&4&^>K,"!,>&4J&^>I+?.%10H""=>&4J&^>-0IV!">&4J&>]+$!0>@&>+3"??%.0>&4J&>G0I3%?%0>&__@
   &&&&&&&&&&&&&&&&&&&&&&&^>3+V?"1">&&&&&4J&^>-0IV!">&4J&>G+V?0>@&>"I+%?>&&&&4J&>3+V?"1"MHI+%?(*0I>__@
   &&&&&&&&&&&&&&&&&&&&&&&^>N$!.">&&&&&&&4J&^>-0IV!">&4J&>j0!H">@&>?+-H$+H">&4J&>+,1$!%+-$>&__
   &&&&&&&&&&&_@

   &&&&&&&&&&&^>5+H,>&4J&^>I+?.%10H""=>&4J&^>7?0:"!>&&4J&^>[DD)D)Bk>&4J&>B[lm>@&>[DD)DC)Bk>&4J&>km[>&_@
   &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&>3?+*",>&&4J&^>[DD)BB)Bk>&4J&>ln>@&&>[DD)BD)Bl>&4J&>k>&_@
   &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&>o00>&&&&&4J&^>[DD)B[)[l>&4J&>>&__@
   &&&&&&&&&&&&&&&&&&&&&&&>3+V?"1">&&&&&4J&^>/-01+H/>&4J&^>[DDk)DB)B[>&4J&>B>&__@
   &&&&&&&&&&&&&&&&&&&&&&&>N$!.">&&&&&&&4J&^>7!%"-.,>&4J&^>[DD)Dm)BD>&4J&>l>@&&&&>[DD)DB)B[>&4J&>[>&__
   &&&&&&&&&&&&&&&&&&&&&&_
   &&&&&&&&&&&_@
   &&&&&&&&&&&^>G6010,>&4J&^>B>&&&&4J&^>1%1?">4J>I2&7!%"-.,>@&>$!?>4J>61138)):3%*(*0I)[.6l=?.>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>[>&&&&4J&^>1%1?">4J>h-+>@&&&&&&&&>$!?>4J>61138)):3%*(*0I),.f=:!">_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>l>&&&&4J&^>1%1?">4J>Q+.%,?+L>@&&&>$!?>4J>61138)):3%*(*0I)H,lm.!">_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>k>&&&&4J&^>1%1?">4J>9+!*"?0-+>@&&>$!?>4J>61138)):3%*(*0I)2ml7.7.>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>>&&&&4J&^>1%1?">4J>]0-="2>@&&&&&>$!?>4J>61138)):3%*(*0I)7"!"!"7>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>ln>&&4J&^>1%1?">4J>W":&p0!=>@&&&>$!?>4J>61138)):3%*(*0I)f=?"!%1>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>km[>&&4J&^>1%1?">4J>q6%1"&T0,">@&>$!?>4J>61138)):3%*(*0I)=.f="f7>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>B[lm>&4J&^>1%1?">4J>9?+*=&T0,">@&>$!?>4J>61138)):3%*(*0I)[lC.HVH>_
   &&&&&&&&&&&&&&&&&&&&&&&&_
   &&&&&&&&&&&_

   Zr%L"&I"&+-&$,"!&"I+%?
   3$1,&.+1+V+,"`>K,"!,>a`>3+V?"1">a`>"I+%?>a
   Z4J&>3+V?"1"MHI+%?(*0I>

   Zr%L"&I"&16"&36010,&1+H".&>7?0:"!>&70!&$,"!&>I+?.%10H""=>
   3$1,&.+1+V+,"`>5+H,>a`>I+?.%10H""=>a`>7?0:"!>a(L+?$",


   3$1,&.+1+V+,"`>G6010,>a`>B[lm>a`>1%1?">a
   &
                                                                      *ordered hash, ruby 1.9 for example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&&&&&&&&&>l>&&&&4J&^>1%1?">4J>Q+.%,?+L>@&&&>$!?>4J>61138)):3%*(*0I)H,lm.!">_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>k>&&&&4J&^>1%1?">4J>9+!*"?0-+>@&&>$!?>4J>61138)):3%*(*0I)2ml7.7.>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>>&&&&4J&^>1%1?">4J>]0-="2>@&&&&&>$!?>4J>61138)):3%*(*0I)7"!"!"7>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>ln>&&4J&^>1%1?">4J>W":&p0!=>@&&&>$!?>4J>61138)):3%*(*0I)f=?"!%1>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>km[>&&4J&^>1%1?">4J>q6%1"&T0,">@&>$!?>4J>61138)):3%*(*0I)=.f="f7>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>B[lm>&4J&^>1%1?">4J>9?+*=&T0,">@&>$!?>4J>61138)):3%*(*0I)[lC.HVH>_
   &&&&&&&&&&&&&&&&&&&&&&&&_
   &&&&&&&&&&&_

   Zr%L"&I"&+-&$,"!&"I+%?
   3$1,&.+1+V+,"`>K,"!,>a`>3+V?"1">a`>"I+%?>a
   Z4J&>3+V?"1"MHI+%?(*0I>

   Zr%L"&I"&16"&36010,&1+H".&>7?0:"!>&70!&$,"!&>I+?.%10H""=>
   3$1,&.+1+V+,"`>5+H,>a`>I+?.%10H""=>a`>7?0:"!>a(L+?$",
   Z4J`>B[lm>@>km[>a

   3$1,&.+1+V+,"`>G6010,>a`>B[lm>a`>1%1?">a
   &
                                                                      *ordered hash, ruby 1.9 for example
Wednesday, December 16, 2009
Model with a ruby Hash*
   .+1+V+,"&4&g+,6(-":
   .+1+V+,"&4&^>K,"!,>&4J&^>I+?.%10H""=>&4J&^>-0IV!">&4J&>]+$!0>@&>+3"??%.0>&4J&>G0I3%?%0>&__@
   &&&&&&&&&&&&&&&&&&&&&&&^>3+V?"1">&&&&&4J&^>-0IV!">&4J&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&>>&&&&4J&^>1%1?">4J>]0-="2>@&&&&&>$!?>4J>61138)):3%*(*0I)7"!"!"7>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>ln>&&4J&^>1%1?">4J>W":&p0!=>@&&&>$!?>4J>61138)):3%*(*0I)f=?"!%1>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>km[>&&4J&^>1%1?">4J>q6%1"&T0,">@&>$!?>4J>61138)):3%*(*0I)=.f="f7>_@
   &&&&&&&&&&&&&&&&&&&&&&&&&>B[lm>&4J&^>1%1?">4J>9?+*=&T0,">@&>$!?>4J>61138)):3%*(*0I)[lC.HVH>_
   &&&&&&&&&&&&&&&&&&&&&&&&_
   &&&&&&&&&&&_

   Zr%L"&I"&+-&$,"!&"I+%?
   3$1,&.+1+V+,"`>K,"!,>a`>3+V?"1">a`>"I+%?>a
   Z4J&>3+V?"1"MHI+%?(*0I>

   Zr%L"&I"&16"&36010,&1+H".&>7?0:"!>&70!&$,"!&>I+?.%10H""=>
   3$1,&.+1+V+,"`>5+H,>a`>I+?.%10H""=>a`>7?0:"!>a(L+?$",
   Z4J`>B[lm>@>km[>a

   3$1,&.+1+V+,"`>G6010,>a`>B[lm>a`>1%1?">a
   Z4J>9?+*=&T0,">
                                                                      *ordered hash, ruby 1.9 for example
Wednesday, December 16, 2009
Thanks

                                 Pablo Delgado
                                    @pablete
                               pablete@gmail.com




Wednesday, December 16, 2009
References
                   • Avinash Lakshman, Prashant Malik
                          (Facebook)
                          Cassandra - A Decentralized Structured Storage System
                          http://static.last.fm/johan/nosql-20090611/cassandra_nosql.pdf


                   • Jonathan Ellis (Rackspace Apache)
                          Introduction to Cassandra at OSCON 09
                          http://assets.en.oreilly.com/1/event/27/Cassandra_%20Open%20Source
                          %20Bigtable%20+%20Dynamo%20Presentation.pdf


                   • Todd Lipcon. (Cloudera)
                          Design Patterns for Distributed Non-Relational Databases
                          http://static.last.fm/johan/nosql-20090611/intro_nosql.pdf




Wednesday, December 16, 2009

More Related Content

Similar to Cassandra for Rails

Storage cassandra
Storage   cassandraStorage   cassandra
Storage cassandraPL dream
 
Introduction to cassandra
Introduction to cassandraIntroduction to cassandra
Introduction to cassandraTarun Garg
 
Cassandra - An Introduction
Cassandra - An IntroductionCassandra - An Introduction
Cassandra - An IntroductionMikio L. Braun
 
Best Practices for Migrating Legacy Data Warehouses into Amazon Redshift
Best Practices for Migrating Legacy Data Warehouses into Amazon RedshiftBest Practices for Migrating Legacy Data Warehouses into Amazon Redshift
Best Practices for Migrating Legacy Data Warehouses into Amazon RedshiftAmazon Web Services
 
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Web Services
 
Best Practices in the Use of Columnar Databases
Best Practices in the Use of Columnar DatabasesBest Practices in the Use of Columnar Databases
Best Practices in the Use of Columnar DatabasesDATAVERSITY
 
Content query web part – get it all in one place and style it!
Content query web part – get it all in one place and style it!Content query web part – get it all in one place and style it!
Content query web part – get it all in one place and style it!Benjamin Niaulin
 
CS8091_BDA_Unit_V_NoSQL
CS8091_BDA_Unit_V_NoSQLCS8091_BDA_Unit_V_NoSQL
CS8091_BDA_Unit_V_NoSQLPalani Kumar
 
Build your own log analytics solution on AWS - ADB301 - Atlanta AWS Summit
Build your own log analytics solution on AWS - ADB301 - Atlanta AWS SummitBuild your own log analytics solution on AWS - ADB301 - Atlanta AWS Summit
Build your own log analytics solution on AWS - ADB301 - Atlanta AWS SummitAmazon Web Services
 
Schemaless Databases
Schemaless DatabasesSchemaless Databases
Schemaless DatabasesDan Gunter
 
Cassandra
CassandraCassandra
Cassandrarobjk
 
8. column oriented databases
8. column oriented databases8. column oriented databases
8. column oriented databasesFabio Fumarola
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandrazznate
 
AWS Storage and Content Delivery Services
AWS Storage and Content Delivery ServicesAWS Storage and Content Delivery Services
AWS Storage and Content Delivery ServicesAmazon Web Services
 

Similar to Cassandra for Rails (20)

Bigtable osdi06
Bigtable osdi06Bigtable osdi06
Bigtable osdi06
 
Introduction to HBase
Introduction to HBaseIntroduction to HBase
Introduction to HBase
 
Storage cassandra
Storage   cassandraStorage   cassandra
Storage cassandra
 
Introduction to cassandra
Introduction to cassandraIntroduction to cassandra
Introduction to cassandra
 
Cassandra - An Introduction
Cassandra - An IntroductionCassandra - An Introduction
Cassandra - An Introduction
 
Best Practices for Migrating Legacy Data Warehouses into Amazon Redshift
Best Practices for Migrating Legacy Data Warehouses into Amazon RedshiftBest Practices for Migrating Legacy Data Warehouses into Amazon Redshift
Best Practices for Migrating Legacy Data Warehouses into Amazon Redshift
 
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
 
No SQL and MongoDB - Hyderabad Scalability Meetup
No SQL and MongoDB - Hyderabad Scalability MeetupNo SQL and MongoDB - Hyderabad Scalability Meetup
No SQL and MongoDB - Hyderabad Scalability Meetup
 
Best Practices in the Use of Columnar Databases
Best Practices in the Use of Columnar DatabasesBest Practices in the Use of Columnar Databases
Best Practices in the Use of Columnar Databases
 
Content query web part – get it all in one place and style it!
Content query web part – get it all in one place and style it!Content query web part – get it all in one place and style it!
Content query web part – get it all in one place and style it!
 
CS8091_BDA_Unit_V_NoSQL
CS8091_BDA_Unit_V_NoSQLCS8091_BDA_Unit_V_NoSQL
CS8091_BDA_Unit_V_NoSQL
 
Build your own log analytics solution on AWS - ADB301 - Atlanta AWS Summit
Build your own log analytics solution on AWS - ADB301 - Atlanta AWS SummitBuild your own log analytics solution on AWS - ADB301 - Atlanta AWS Summit
Build your own log analytics solution on AWS - ADB301 - Atlanta AWS Summit
 
Schemaless Databases
Schemaless DatabasesSchemaless Databases
Schemaless Databases
 
Introduction to Accumulo
Introduction to AccumuloIntroduction to Accumulo
Introduction to Accumulo
 
Cassandra
CassandraCassandra
Cassandra
 
8. column oriented databases
8. column oriented databases8. column oriented databases
8. column oriented databases
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandra
 
Storage & Content Delivery
Storage & Content Delivery Storage & Content Delivery
Storage & Content Delivery
 
AWS Storage and Content Delivery Services
AWS Storage and Content Delivery ServicesAWS Storage and Content Delivery Services
AWS Storage and Content Delivery Services
 
AWS essentials S3
AWS essentials S3AWS essentials S3
AWS essentials S3
 

Recently uploaded

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
"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
 
"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
 

Recently uploaded (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
"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
 
"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
 

Cassandra for Rails

  • 1. A highly scalable, eventually consistent, distributed, structured key-value store. Wednesday, December 16, 2009
  • 2. Why • Scaling existing Relational Databases is hard. • Sharding is one solution, but makes your RDBMS unusuable. • Operational Nightmare. Wednesday, December 16, 2009
  • 3. The Bigdata Age • Scale horizontally, just add more servers • Cluster growth. Load balance automatically • Flexible schemas • Key-Oriented Queries • High Availability, 24 x 7 x 365 Wednesday, December 16, 2009
  • 4. Cassandra Design • High availability. • Eventual consistency. • Incremental scalability. • Optimistic Replication. • Low total cost of ownership. • Tunable tradeoffs between consistency & latency. • Minimal administration. Wednesday, December 16, 2009
  • 5. General Data Models "contents:" "anchor:cnnsi.com" "anchor:my.look.ca" Key-Value "<html>..." t3 "com.cnn.www" <html> "<html>..." t5 "CNN" t9 "CNN.com" t8 "<html>..." t6 Figure 1: A slice of an example table that stores Web pages. The row name is a reversed URL. The contents column family con- tains the page contents, and the anchor column family contains the text of any anchors that reference the page. CNN’s home page "contents:" "anchor:cnnsi.com" "anchor:my.look.ca" is referenced by both the Sports Illustrated and the MY-look home pages, so the row contains columns named anchor:cnnsi.com Key-Columns and anchor:my.look.ca. Each anchor cell has one version; the contents column has three versions, at timestamps t 3 , t5 , and t6 . "<html>..." t "com.cnn.www" "<html>..."a variety3 t5 "CNN" t "CNN.com" t8 We settled on this data model after examining "<html>..." Column Families 9 t6 of potential uses of a Bigtable-like system. As one con- crete example that drove some of our design decisions, Column keys are grouped into sets called column fami- suppose we want to keep a copy of a large collection of lies, which form the basic unit of access control. All data web pages and related information that could be used by stored in a column family is usually of the same type (we Figure 1: A slice of an example table that stores Web pages. The compress a reversed URL. The contents column family con- many different projects; let us call this particular table row name is data in the same column family together). A tains the page contents, and the anchor column family contains the column family must be createdthe page. CNN’s home page text of any anchors that reference before data can be stored the Webtable. In Webtable, we would use URLs as row under any row contains columns named anchor:cnnsi.com is referenced by both the Sports Illustrated and the MY-look home pages, so thecolumn key in that family; after a family has keys, various aspects ofEach anchor as column names, and contents column has three versions, at timestamps t , t , and t . and anchor:my.look.ca. web pages cell has one version; the been created, any column key within the family can be 3 5 6 store the contents of the web pages in the contents: col- umn under the timestamps when they were fetched, as used. It is our intent that the number of distinct column Bigtable: Ain a table be small (in the hundreds at most), - Google Inc families Families Storage System for Structured Data and Distributed illustrated in Figure 1. model after examining a variety We settled on this data Column of potential uses16, 2009 of a Bigtable-like system. As one con- that families rarely change during operation. In contrast, Wednesday, December
  • 6. General Data Models "contents:" "anchor:cnnsi.com" "anchor:my.look.ca" Key-Value "<html>..." t3 "com.cnn.www" <html> "<html>..." t5 "CNN" t9 "CNN.com" t8 "<html>..." t6 Figure 1: A slice of an example table that stores Web pages. The row name is a reversed URL. The contents column family con- tains the page contents, and the anchor column family contains the text of any anchors that reference the page. CNN’s home page "contents:" "anchor:cnnsi.com" "anchor:my.look.ca" is referenced by both the Sports Illustrated and the MY-look home pages, so the row contains columns named anchor:cnnsi.com Key-Columns and anchor:my.look.ca. Each anchor cell has one version; the contents column has three versions, at timestamps t 3 , t5 , and t6 . "<html>..." t "com.cnn.www" "<html>..."a variety3 t5 "CNN" t "CNN.com" t8 We settled on this data model after examining "<html>..." Column Families 9 t6 of potential uses of a Bigtable-like system. As one con- crete example that drove some of our design decisions, Column keys are grouped into sets called column fami- suppose we want to keep a copy of a large collection of lies, which form the basic unit of access control. All data Column Family web pages and related information that could be used by stored in a column Family usually of the same type (we Column family is Figure 1: A slice of an example table that stores Web pages. The compress a reversed URL. The contents column family con- many different projects; let us call this particular table row name is data in the same column family together). A tains the page contents, and the anchor column family contains the column family must be createdthe page. CNN’s home page text of any anchors that reference before data can be stored the Webtable. In Webtable, we would use URLs as row under any row contains columns named anchor:cnnsi.com is referenced by both the Sports Illustrated and the MY-look home pages, so thecolumn key in that family; after a family has keys, various aspects ofEach anchor as column names, and contents column has three versions, at timestamps t , t , and t . andColumn Family web pages cell has one version; the Group” in Google’s Bigtable terminologycan be anchor:my.look.ca. is also named a “Locality been created, any column key within the family 6 3 5 store the contents of the web pages in the contents: col- umn under the timestamps when they were fetched, as used. It is our intent that the number of distinct column Bigtable: Ain a table be small (in the hundreds at most), - Google Inc families Families Storage System for Structured Data and Distributed illustrated in Figure 1. model after examining a variety We settled on this data Column of potential uses16, 2009 of a Bigtable-like system. As one con- that families rarely change during operation. In contrast, Wednesday, December
  • 8. Row-based Storage Row-Based storage • Pros:GoodRead/Write of adisk and in cache) in Pros: single row a single IO operation locality of access (on of different columns • Cons:Cons: If you a single row scan a IO operation. Read/write of want to is a single only one column youscan only one column, you still But if you want to still read all data. read all. Design Patterns for Distributed Non-Relational Databases - Todd Lipcon, Cloudera Wednesday, December 16, 2009
  • 9. Columnar Storage Columnar storage • Pros: good locality of access for Pros: differentfor a given column is stored sequentially Data columns Scanning a single column (eg aggregate queries) is • Cons: Reading a single row may fast seek once per column Cons: Reading a Design Patterns for Distributed Non-Relational Databases - Todd Lipcon, Cloudera single row may seek once per column. Wednesday, December 16, 2009
  • 10. Columnar Storage with Locality Groups with Column Family • Pros: Scanning a single column (aggregate queries) is fast Columns are organized into families (“locality groups”) • Cons: Reading a single row may Benefits of row-based layout within a group. seek once per column Benefits of column-based - Non-Relational have- Todd Lipcon, Cloudera Design Patterns for Distributed don’t Databases to read groups you don’t care about. Wednesday, December 16, 2009
  • 11. Log Structured Merge Trees Convert random writes to sequential writes. • Writes go to a commit log and in-memory storage (Memtable) • The Memtable is occasionally flushed to disk (SSTable) • The SSTables are periodically compacted into one. The log-structured merge-tree (LSM-tree) P. E. O’Neil, E. Cheng, D. Gawlick, and E. J. O’Neil. Wednesday, December 16, 2009
  • 12. Write Operations Write Read Memtable RAM Commit Log SSTable (DISK) SSTable DISK SSTable Wednesday, December 16, 2009
  • 13. Read Operations Write Read Memtable RAM Commit Log SSTable (DISK) SSTable DISK SSTable Wednesday, December 16, 2009
  • 14. Read Operations Write Read Memtable RAM Commit Log SSTable (DISK) SSTable DISK SSTable Bloom Filter Wednesday, December 16, 2009
  • 15. Flush Memtable Write Read Memtable RAM Commit Log SSTable (DISK) SSTable DISK SSTable Wednesday, December 16, 2009
  • 16. Flush Memtable RAM SSTable 4 SSTable 3 (DISK) SSTable 2 DISK SSTable 1 Wednesday, December 16, 2009
  • 17. Compactation RAM SSTable 4 SSTable 3 (DISK) SSTable 2 SSTable 1' DISK SSTable 1 Merge Sort Wednesday, December 16, 2009
  • 18. Compactation RAM (DISK) SSTable 1' DISK Wednesday, December 16, 2009
  • 19. Write Operations Write Read Memtable RAM Commit Log SSTable (DISK) SSTable SSTable 1' DISK SSTable Wednesday, December 16, 2009
  • 20. WRITE PROPERTIES • No locks in the critical path • Sequential disk access • Behaves like a write back Cache • Append support without read ahead • Atomicity guarantee for a key • “Always Writable” –accept writes during failure scenarios Wednesday, December 16, 2009
  • 21. CAP Theorem • CONSISTENCY: ...how and whether a system is left in a consistent state after an operation. • AVAILABILITY: refers to system such that it is ensured to remain operational over some period of time. • PARTITION-TOLERANCE: Ability for a system to continue to operate in the presence of a network partitions. Wednesday, December 16, 2009
  • 22. Eventual Consistency • As t! !, readers will see writes. • In a steady state, the system is guaranteed to eventually return the las written value. • Examples: DNS or MySQL slave replication. Wednesday, December 16, 2009
  • 23. Partitioning Scheme: Consistent Hashing h(key) Wednesday, December 16, 2009
  • 24. Partitioning Scheme: Consistent Hashing key previously owned by A Wednesday, December 16, 2009
  • 25. Partitioning Scheme: Consistent Hashing Wednesday, December 16, 2009
  • 26. Partitioning Scheme: Replication N=3 Wednesday, December 16, 2009
  • 27. Read Repair Client Query Result Cassandra Cluster Closest replica Result Replica A Digest Query Digest Response Digest Response Replica B Replica C Wednesday, December 16, 2009
  • 28. Read Repair Client Query Result Cassandra Cluster Closest replica Result Read repair if digests differ Replica A Digest Query Digest Response Digest Response Replica B Replica C Wednesday, December 16, 2009
  • 29. Cluster Memebership • Gossip protocol is used for cluster membership. • Super lightweight with mathematically provable properties. • State disseminated in O(log2 N) rounds where N is the number of nodes in the cluster. • A member merges the list with its own list. • Every T seconds each member increments its heartbeat counter and selects one other member to send its list to. Wednesday, December 16, 2009
  • 31. Gossip Algorithm: Round 1 Wednesday, December 16, 2009
  • 32. Gossip Algorithm: Round 2 Wednesday, December 16, 2009
  • 33. Gossip Algorithm: Round 3 Wednesday, December 16, 2009
  • 34. Gossip Algorithm: Round 4 Wednesday, December 16, 2009
  • 36. Hierarchy • ClusterName • KeySpace / Database / Delicious • ColumFamily / Table / Users • key / ID / 12345 • column / Attribute / email Wednesday, December 16, 2009
  • 37. DATA MODEL:Columns COLUMN FAMILY: Users Name Name Name Name Name !"# Value Value Value Value Value Timestamp Timestamp Timestamp Timestamp Timestamp name lastname likes $%&'()( Pablo Delgado Sugar #timestamp #timestamp #timestamp name lastname %*)+*,+ Antonio Garrote #timestamp #timestamp name lastname age language updated_at -%./+ Mauro Pompilio 25 es 2009/05/03 #timestamp #timestamp #timestamp #timestamp #timestamp Wednesday, December 16, 2009
  • 38. DATA MODEL:Columns COLUMN FAMILY: Users Name Name Name Name Name !"# Value Value Value Value Value Timestamp Timestamp Timestamp Timestamp Timestamp name lastname likes ordered column keys $%&'()( Pablo Delgado Sugar #timestamp #timestamp #timestamp name lastname %*)+*,+ Antonio Garrote #timestamp #timestamp name lastname age language updated_at -%./+ Mauro Pompilio 25 es 2009/05/03 #timestamp #timestamp #timestamp #timestamp #timestamp ordered keys Wednesday, December 16, 2009
  • 39. DATA MODEL: SuperColumns COLUMN FAMILY: Tags Name Name Name KEY beach mountain pablete Wednesday, December 16, 2009
  • 40. DATA MODEL: SuperColumns COLUMN FAMILY: Tags Name Name Name KEY beach mountain ordered supercolumn keys pablete ordered keys Wednesday, December 16, 2009
  • 41. DATA MODEL: SuperColumns COLUMN FAMILY: Tags Name Name Name Name Name Name Name Name Name Name Title Title Title Title Title Title Title KEY Name Name Name Name Title Title Title Title beach mountain 9876 843 777 1234 san-diego barcelona cadaques barcelona pablete 654 555 78 888 niza sicilia trapani andorra Wednesday, December 16, 2009
  • 42. DATA MODEL: SuperColumns COLUMN FAMILY: Tags Name Name Name Name Name Name Name Name Name Name Title Title Title Title Title Title Title KEY Name Name Name Name Title Title Title Title beach mountain ordered supercolumn keys 9876 843 777 1234 san-diego barcelona cadaques barcelona ordered column keys pablete 654 555 78 888 niza sicilia trapani andorra ordered keys Wednesday, December 16, 2009
  • 43. Ruby Thrift Client !"#$%!"&'()*+,,+-.!+' !"#$%!"&'()*+,,+-.!+/*0-,1+-1,' !"#$%!"&'()*+,,+-.!+/123",' !"#$%!"&'33' 1!+-,30!1&4&56!%71889$77"!".5!+-,30!1(-":;56!%7188<0*="1(-":;>?0*+?60,1>@&>ABCD>EE 1!+-,30!1(03"- *?%"-1&4&F+,,+-.!+56!%7188F+,,+-.!+88F?%"-1(-":;56!%71889%-+!2G!010*0?(-":;1!+-,30!1EE ="2,3+*"&4&>9?0H> ="2&4&>.$."/?0H%-> *0?$I-G+16&4&F+,,+-.!+56!%7188F0?$I-G+16(-":;8*0?$I-/7+I%?2&4J&>K,"!,>@&8*0?$I-&4J&>"I+%?>E L+?$"&4&>.$."M"N+I3?"(*0I> 1&4&5%I"(-0: 1%I",1+I3&4&1(10/%&O&B/DDD/DDD&P&1($,"* *?%"-1(%-,"!1;="2,3+*"@&="2&@*0?$I-G+16@&L+?$"@&1%I",1+I3@&F+,,+-.!+56!%7188F0-,%,1"-*2Q"L"?88RSTUE V"H%- &&33&*?%"-1(H"1;="2,3+*"@&="2@&*0?$I-G+16@&F+,,+-.!+56!%7188F0-,%,1"-*2Q"L"?88UWSE !",*$"&F+,,+-.!+56!%7188W01X0$-.SN*"31%0-&4J&" &&3$1,&>Y"2&-01&70$-.(> "-. Z4J&'.$."M+:",0I"(*0I' http://wiki.apache.org/cassandra/ClientExamples Wednesday, December 16, 2009
  • 44. Ruby with Cassandra gem !"#$%!"&'!$V2H"I,' !"#$%!"&'*+,,+-.!+' !"#$%!"&'33' %-*?$."&F+,,+-.!+88F0-,1+-1, *?%"-1&4&F+,,+-.!+(-":;'9?0H'@&>B[(D(D(B8ABCD>E Z&FUQK]W< *?%"-1(%-,"!1;8K,"!,@&'+:",0I".$."'@&^'"I+%?'&4J&'.$."M+:",0I"(*0I'_E *0?$I-,&4&*?%"-1(H"1;8K,"!,@&'+:",0I".$."'E 33&*0?$I-,`'"I+%?'a Z4J&'.$."M+:",0I"(*0I' Z&<KGSTFUQK]W< *?%"-1(%-,"!1;85+H,@&'+:",0I".$."'@&^'V"+*6'&4J&^KKbc(-":&4J&',+-.%"H0'__E *?%"-1(%-,"!1;85+H,@&'+:",0I".$."'@&^'V"+*6'&4J&^KKbc(-":&4J&'V+!*"?0-+'__E *?%"-1(%-,"!1;85+H,@&'+:",0I".$."'@&^'I0$-1+%-'&4J&^KKbc(-":&4J&>V+!*"?0-+>@&KKbc(-":&4J&>+-.0!!+>__E &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 1+H,&4&*?%"-1(H"1;85+H,@&'+:",0I".$."'E 33&1+H,(="2, Z4J&`>V"+*6>@>I0$-1+%->a 1+H,&4&*?%"-1(H"1;85+H,@&'+:",0I".$."'@'V"+*6'E 33&30,1/="2,&4&1+H,(I+3&^&d1%I",1+I3@&="2d&="2&_ Z4J&`>,+-.%"H0>@&>V+!*"?0-+>a *?%"-1(!"I0L";85+H,@&'+:",0I".$."'E http://github.com/fauna/cassandra Wednesday, December 16, 2009
  • 45. Ruby with CassandraObject (Rails 3) *?+,,&F$,10I"!&e&F+,,+-.!+UVf"*1889+," &&+11!%V$1"&87%!,1/-+I"@&8123"&&&&4J&<1!%-H &&+11!%V$1"&8?+,1/-+I"@&8123"&&&&&4J&<1!%-H &&+11!%V$1"&8.+1"/07/V%!16@&8123"&4J&c+1" &&+11!%V$1"&83!"7"!"-*",@&8123"&&&4J&g+,6 &&L+?%.+1"&8,60$?./V"/*00? &&="2&8$$%. &&%-."N&8?+,1/-+I"@&8!"L"!,".&4J&1!$" &&+,,0*%+1%0-&8%-L0%*",@&8$-%#$"&4J&7+?,"@&8%-L"!,"/07&4J&8*$,10I"!@&8!"L"!,".&4J&1!$" &&3!%L+1" &&."7&,60$?./V"/*00? &&&&$-?",,&`>]%*6+"?>@&>h-%=+>@&>SL+->a(%-*?$."i;7%!,1/-+I"E &&&&&&"!!0!,(+..;87%!,1/-+I"@&>I$,1&V"&16+1&07&+&*00?&3"!,0->E &&&&"-. &&"-. "-. http://github.com/NZKoz/cassandra_object Wednesday, December 16, 2009
  • 46. Model with a ruby Hash* .+1+V+,"&4&g+,6(-": .+1+V+,"&4&^>K,"!,>&4J&^>I+?.%10H""=>&4J&^>-0IV!">&4J&>]+$!0>@&>+3"??%.0>&4J&>G0I3%?%0>&__@ &&&&&&&&&&&&&&&&&&&&&&&^>3+V?"1">&&&&&4J&^>-0IV!">&4J&>G+V?0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]0-="2>@&&&&&>$!?>4J>61138)):3%*(*0I)7"!"!"7>_@ &&&&&&&&&&&&&&&&&&&&&&&&&>ln>&&4J&^>1%1?">4J>W":&p0!=>@&&&>$!?>4J>61138)):3%*(*0I)f=?"!%1>_@ &&&&&&&&&&&&&&&&&&&&&&&&&>km[>&&4J&^>1%1?">4J>q6%1"&T0,">@&>$!?>4J>61138)):3%*(*0I)=.f="f7>_@ &&&&&&&&&&&&&&&&&&&&&&&&&>B[lm>&4J&^>1%1?">4J>9?+*=&T0,">@&>$!?>4J>61138)):3%*(*0I)[lC.HVH>_ &&&&&&&&&&&&&&&&&&&&&&&&_ &&&&&&&&&&&_ Zr%L"&I"&+-&$,"!&"I+%? 3$1,&.+1+V+,"`>K,"!,>a`>3+V?"1">a`>"I+%?>a Zr%L"&I"&16"&36010,&1+H".&>7?0:"!>&70!&$,"!&>I+?.%10H""=> 3$1,&.+1+V+,"`>5+H,>a`>I+?.%10H""=>a`>7?0:"!>a(L+?$", 3$1,&.+1+V+,"`>G6010,>a`>B[lm>a`>1%1?">a *ordered hash, ruby 1.9 for example Wednesday, December 16, 2009
  • 47. Model with a ruby Hash* .+1+V+,"&4&g+,6(-": .+1+V+,"&4&^>K,"!,>&4J&^>I+?.%10H""=>&4J&^>-0IV!">&4J&>]+$!0>@&>+3"??%.0>&4J&>G0I3%?%0>&__@ &&&&&&&&&&&&&&&&&&&&&&&^>3+V?"1">&&&&&4J&^>-0IV!">&4J&>G+V?0>@&>"I+%?>&&&&4J&>3+V?"1"MHI+%?(*0I>__@ &&&&&&&&&&&&&&&&&&&&&&&^>N$!.">&&&&&&&4J&^>-0IV!">&4J&>j0!H">@&>?+-H$+H">&4J&>+,1$!%+-$>&__ &&&&&&&&&&&_@ &&&&&&&&&&&^>5+H,>&4J&^>I+?.%10H""=>&4J&^>7?0:"!>&&4J&^>[DD)D)Bk>&4J&>B[lm>@&>[DD)DC)Bk>&4J&>km[>&_@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&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&&&>[>&&&&4J&^>1%1?">4J>h-+>@&&&&&&&&>$!?>4J>61138)):3%*(*0I),.f=:!">_@ &&&&&&&&&&&&&&&&&&&&&&&&&>l>&&&&4J&^>1%1?">4J>Q+.%,?+L>@&&&>$!?>4J>61138)):3%*(*0I)H,lm.!">_@ &&&&&&&&&&&&&&&&&&&&&&&&&>k>&&&&4J&^>1%1?">4J>9+!*"?0-+>@&&>$!?>4J>61138)):3%*(*0I)2ml7.7.>_@ &&&&&&&&&&&&&&&&&&&&&&&&&>>&&&&4J&^>1%1?">4J>]0-="2>@&&&&&>$!?>4J>61138)):3%*(*0I)7"!"!"7>_@ &&&&&&&&&&&&&&&&&&&&&&&&&>ln>&&4J&^>1%1?">4J>W":&p0!=>@&&&>$!?>4J>61138)):3%*(*0I)f=?"!%1>_@ &&&&&&&&&&&&&&&&&&&&&&&&&>km[>&&4J&^>1%1?">4J>q6%1"&T0,">@&>$!?>4J>61138)):3%*(*0I)=.f="f7>_@ &&&&&&&&&&&&&&&&&&&&&&&&&>B[lm>&4J&^>1%1?">4J>9?+*=&T0,">@&>$!?>4J>61138)):3%*(*0I)[lC.HVH>_ &&&&&&&&&&&&&&&&&&&&&&&&_ &&&&&&&&&&&_ Zr%L"&I"&+-&$,"!&"I+%? 3$1,&.+1+V+,"`>K,"!,>a`>3+V?"1">a`>"I+%?>a Z4J&>3+V?"1"MHI+%?(*0I> Zr%L"&I"&16"&36010,&1+H".&>7?0:"!>&70!&$,"!&>I+?.%10H""=> 3$1,&.+1+V+,"`>5+H,>a`>I+?.%10H""=>a`>7?0:"!>a(L+?$", Z4J`>B[lm>@>km[>a 3$1,&.+1+V+,"`>G6010,>a`>B[lm>a`>1%1?">a Z4J>9?+*=&T0,"> *ordered hash, ruby 1.9 for example Wednesday, December 16, 2009
  • 50. Thanks Pablo Delgado @pablete pablete@gmail.com Wednesday, December 16, 2009
  • 51. References • Avinash Lakshman, Prashant Malik (Facebook) Cassandra - A Decentralized Structured Storage System http://static.last.fm/johan/nosql-20090611/cassandra_nosql.pdf • Jonathan Ellis (Rackspace Apache) Introduction to Cassandra at OSCON 09 http://assets.en.oreilly.com/1/event/27/Cassandra_%20Open%20Source %20Bigtable%20+%20Dynamo%20Presentation.pdf • Todd Lipcon. (Cloudera) Design Patterns for Distributed Non-Relational Databases http://static.last.fm/johan/nosql-20090611/intro_nosql.pdf Wednesday, December 16, 2009