SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
Cassandra
   A short Intro




                   Vitaly Kushner
                    astrails.com
• Distributed
• Non-relational
• Linearly scalable
• Multi data-center aware
BigTable
http://labs.google.com/papers/bigtable.html
Terminology Sucks
      big time
my_cluster: {
  demo_app: {
    accounts: {
       "1": {
         "attributes": {
            "name": "astrails"
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {
       "1": {
         "name": "vitaly",
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {	 	 	 	 	 	 	 	              <<= Cluster Name
  demo_app: {
    accounts: {
       "1": {
         "attributes": {
            "name": "astrails"
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {
       "1": {
         "name": "vitaly",
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {
  demo_app: {	 	 	 	 	 	 	 	              <== Keyspace
    accounts: {
       "1": {
         "attributes": {
            "name": "astrails"
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {
       "1": {
         "name": "vitaly",
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {
  demo_app: {
    accounts: {	 	 	 	 	 	 	              <<= super column family
       "1": {
         "attributes": {
            "name": "astrails"
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {
       "1": {
         "name": "vitaly",
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {
  demo_app: {
    accounts: {
       "1": {
         "attributes": {
            "name": "astrails"
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {	 	 	 	 	 	 	 	               <<= column family
       "1": {
         "name": "vitaly",
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {
  demo_app: {
    accounts: {
       "1": {	 	 	 	 	 	 	 	              <<= key
         "attributes": {
            "name": "astrails"
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {
       "1": {
         "name": "vitaly",
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {
  demo_app: {
    accounts: {
       "1": {
         "attributes": {	 	 	 	 	         << super column
            "name": "astrails"
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {
       "1": {
         "name": "vitaly",
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {
  demo_app: {
    accounts: {
       "1": {
         "attributes": {
            "name": "astrails"	 	 	       <<= column
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {
       "1": {
         "name": "vitaly",
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {
  demo_app: {
    accounts: {
       "1": {
         "attributes": {
            "name": "astrails"	 	 	       <<= value
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {
       "1": {
         "name": "vitaly",
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {
  demo_app: {
    accounts: {
       "1": {
         "attributes": {
            "name": "astrails"
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {
       "1": {
         "name": "vitaly",	 	 	 	         <<= column
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {	 	 	 	 	 	 	 	              <<=   cluster
  demo_app: {	 	 	 	 	 	 	 	              <<=   keyspace
    accounts: {	 	 	 	 	 	 	              <<=   super column family
       "1": {	 	 	 	 	 	 	 	              <<=   key
         "attributes": {	 	 	 	 	         <<=   supercolumn
            "name": "astrails"	 	 	       <<=   column
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {	 	 	 	 	 	 	 	               <<= column family
       "1": {	 	 	 	 	 	 	 	              <<= key
         "name": "vitaly",	 	 	 	         <<= column
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {	 	 	 	 	 	 	 	              <<=   cluster
  demo_app: {	 	 	 	 	 	 	 	              <<=   database
    accounts: {	 	 	 	 	 	 	              <<=   super column family
       "1": {	 	 	 	 	 	 	 	              <<=   key
         "attributes": {	 	 	 	 	         <<=   supercolumn
            "name": "astrails"	 	 	       <<=   column
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {	 	 	 	 	 	 	 	               <<= column family
       "1": {	 	 	 	 	 	 	 	              <<= key
         "name": "vitaly",	 	 	 	         <<= column
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {	 	 	 	 	 	 	 	              <<=   cluster
  demo_app: {	 	 	 	 	 	 	 	              <<=   database
    accounts: {	 	 	 	 	 	 	              <<=   table
       "1": {	 	 	 	 	 	 	 	              <<=   key
         "attributes": {	 	 	 	 	         <<=   supercolumn
            "name": "astrails"	 	 	       <<=   column
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {	 	 	 	 	 	 	 	               <<= column family
       "1": {	 	 	 	 	 	 	 	              <<= key
         "name": "vitaly",	 	 	 	         <<= column
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {	 	 	 	 	 	 	 	              <<=   cluster
  demo_app: {	 	 	 	 	 	 	 	              <<=   database
    accounts: {	 	 	 	 	 	 	              <<=   table
       "1": {	 	 	 	 	 	 	 	              <<=   key
         "attributes": {	 	 	 	 	         <<=   supercolumn
            "name": "astrails"	 	 	       <<=   column
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {	 	 	 	 	 	 	 	               <<= table
       "1": {	 	 	 	 	 	 	 	              <<= key
         "name": "vitaly",	 	 	 	         <<= column
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {	 	 	 	 	 	 	 	              <<=   cluster
  demo_app: {	 	 	 	 	 	 	 	              <<=   database
    accounts: {	 	 	 	 	 	 	              <<=   table
       "1": {	 	 	 	 	 	 	 	              <<=   key
         "attributes": {	 	 	 	 	         <<=   collection
            "name": "astrails"	 	 	       <<=   column
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {	 	 	 	 	 	 	 	               <<= table
       "1": {	 	 	 	 	 	 	 	              <<= key
         "name": "vitaly",	 	 	 	         <<= column
         "email": "vitaly@astrails.com"
       }
    }
  }
}
my_cluster: {	 	 	 	 	 	 	 	              <<=   cluster
  demo_app: {	 	 	 	 	 	 	 	              <<=   database
    accounts: {	 	 	 	 	 	 	              <<=   table
       "1": {	 	 	 	 	 	 	 	              <<=   key
         "attributes": {	 	 	 	 	         <<=   collection
            "name": "astrails"	 	 	       <<=   attribute
         },
         "users": {
            "1" => "",
            "3" => "",
         }
       }
    },
    users: {	 	 	 	 	 	 	 	               <<= table
       "1": {	 	 	 	 	 	 	 	              <<= key
         "name": "vitaly",	 	 	 	         <<= attribute
         "email": "vitaly@astrails.com"
       }
    }
  }
}
Indexing
"my_cluster": {
  "demo_app": {
    "users": {
       "b2c75e99-e079-449d-b562-293dfdbf006e": {
         "attributes": {
           "name": "Vitaly",
           "email": "vitaly@astrails.com",
           "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e"
         }
       }
    },
    "emails": {
       "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
    "remember_me": {
       "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
  }
}
"my_cluster": {
  "demo_app": {
    "users": {
       "b2c75e99-e079-449d-b562-293dfdbf006e": {
         "attributes": {
           "name": "Vitaly",
           "email": "vitaly@astrails.com",
           "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e"
         }
       }
    },
    "emails": {
       "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
    "remember_me": {
       "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
  }
}
"my_cluster": {
  "demo_app": {
    "users": {
       "b2c75e99-e079-449d-b562-293dfdbf006e": {
         "attributes": {
           "name": "Vitaly",
           "email": "vitaly@astrails.com",
           "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e"
         }
       }
    },
    "emails": {
       "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
    "remember_me": {
       "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
  }
}
"my_cluster": {
  "demo_app": {
    "users": {
       "b2c75e99-e079-449d-b562-293dfdbf006e": {
         "attributes": {
           "name": "Vitaly",
           "email": "vitaly@astrails.com",
           "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e"
         }
       }
    },
    "emails": {
       "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
    "remember_me": {
       "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
  }
}
"my_cluster": {
  "demo_app": {
    "users": {
       "b2c75e99-e079-449d-b562-293dfdbf006e": {
         "attributes": {
           "name": "Vitaly",
           "email": "vitaly@astrails.com",
           "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e"
         }
       }
    },
    "emails": {
       "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
    "remember_me": {
       "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
  }
}
"my_cluster": {
  "demo_app": {
    "users": {
       "b2c75e99-e079-449d-b562-293dfdbf006e": {
         "attributes": {
           "name": "Vitaly",
           "email": "vitaly@astrails.com",
           "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e"
         }
       }
    },
    "emails": {
       "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
    "remember_me": {
       "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e",
    }
  }
}
Playtime
> gem install cassandra
...
> cassandra_helper cassandra
...
<ClusterName>my_cluster</ClusterName>

<Keyspaces>
  <Keyspace Name="demo_app">
    <ColumnFamily CompareWith="UTF8Type" Name="users" ColumnType="Super" CompareSubcolumnsWith="UTF8Type" />
    <ColumnFamily CompareWith="UTF8Type" Name="emails" ColumnType="Super" CompareSubcolumnsWith="UTF8Type" />
    <ColumnFamily CompareWith="UTF8Type" Name="tokens" />
  </Keyspace>
</Keyspaces>
require 'rubygems'
require 'cassandra'

include Cassandra::Constants

client = Cassandra.new('demo_app')

client.insert(:users, "1", {"name" => "vitaly", "email" => "vitaly@astrails.com"})
client.insert(:accounts, "1", {"attributes" => {"name" => "astrails"}, "users" => {"1" => ""}})

client.insert(:users, "2", {"name" => "boris"})
client.insert(:accounts, "1", {"users" => {"2" => ""}})

client.get(:users, "1")
Rails?
YES!
SmallRecord
WARNING: waporware :)
http://github.com/astrails/small_record
ActiveModel
class Account < SmallRecord::Base
  attribute :name
  attribute :created_at, :type => :datetime

  has_many :users

  validates_presence_of :name
end

class User < SmallRecord::Base
  attribute :name
  attribute :email
  attribute :created_at, :type => :datetime
  attribute :account_id

  def account
    @account ||= Account.find(:account_id)
  end

  validates_presence_of :name
  validates_presence_of :email
end

Account.find(params[:account]).users.first.name
production:
 adapter: cassandra
 host: 127.0.0.1
 port: 9160
 keyspace: chronos

development:
 adapter: mock

test:
 adapter: mock
production:
 adapter: cassandra
 host: 127.0.0.1
 port: 9160
 keyspace: chronos

development:
 adapter: mock

test:
 adapter: mock
Some Links

•   http://incubator.apache.org/cassandra

•   http://labs.google.com/papers/bigtable.html

•   http://blog.evanweaver.com/articles/2009/07/06/up-and-running-with-cassandra/

•   http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model

•   http://github.com/astrails/small_record

Weitere ähnliche Inhalte

Was ist angesagt?

What's new in Doctrine
What's new in DoctrineWhat's new in Doctrine
What's new in DoctrineJonathan Wage
 
Effective Java with Groovy
Effective Java with GroovyEffective Java with Groovy
Effective Java with GroovyNaresha K
 
Structuring React.js Components
Structuring React.js ComponentsStructuring React.js Components
Structuring React.js ComponentsBartek Witczak
 
4Developers 2018: Structuring React components (Bartłomiej Witczak)
4Developers 2018: Structuring React components (Bartłomiej Witczak)4Developers 2018: Structuring React components (Bartłomiej Witczak)
4Developers 2018: Structuring React components (Bartłomiej Witczak)PROIDEA
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen ChinHacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chinjaxconf
 
The Ring programming language version 1.10 book - Part 37 of 212
The Ring programming language version 1.10 book - Part 37 of 212The Ring programming language version 1.10 book - Part 37 of 212
The Ring programming language version 1.10 book - Part 37 of 212Mahmoud Samir Fayed
 
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Rabble .
 
A to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java DeveloperA to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java DeveloperManoj Bhuva
 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Jonas Bonér
 
JavaFX and Scala - Like Milk and Cookies
JavaFX and Scala - Like Milk and CookiesJavaFX and Scala - Like Milk and Cookies
JavaFX and Scala - Like Milk and CookiesStephen Chin
 
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...Stephen Chin
 
BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7Georgi Kodinov
 
The Ring programming language version 1.10 book - Part 47 of 212
The Ring programming language version 1.10 book - Part 47 of 212The Ring programming language version 1.10 book - Part 47 of 212
The Ring programming language version 1.10 book - Part 47 of 212Mahmoud Samir Fayed
 
Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)Christopher Bennage
 
Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2won min jang
 

Was ist angesagt? (18)

What's new in Doctrine
What's new in DoctrineWhat's new in Doctrine
What's new in Doctrine
 
Effective Java with Groovy
Effective Java with GroovyEffective Java with Groovy
Effective Java with Groovy
 
Structuring React.js Components
Structuring React.js ComponentsStructuring React.js Components
Structuring React.js Components
 
4Developers 2018: Structuring React components (Bartłomiej Witczak)
4Developers 2018: Structuring React components (Bartłomiej Witczak)4Developers 2018: Structuring React components (Bartłomiej Witczak)
4Developers 2018: Structuring React components (Bartłomiej Witczak)
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen ChinHacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
 
The Ring programming language version 1.10 book - Part 37 of 212
The Ring programming language version 1.10 book - Part 37 of 212The Ring programming language version 1.10 book - Part 37 of 212
The Ring programming language version 1.10 book - Part 37 of 212
 
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007
 
A to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java DeveloperA to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java Developer
 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)
 
JavaFX and Scala - Like Milk and Cookies
JavaFX and Scala - Like Milk and CookiesJavaFX and Scala - Like Milk and Cookies
JavaFX and Scala - Like Milk and Cookies
 
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
 
Mysql python
Mysql pythonMysql python
Mysql python
 
Mysql python
Mysql pythonMysql python
Mysql python
 
BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7
 
The Ring programming language version 1.10 book - Part 47 of 212
The Ring programming language version 1.10 book - Part 47 of 212The Ring programming language version 1.10 book - Part 47 of 212
The Ring programming language version 1.10 book - Part 47 of 212
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)
 
Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2
 

Andere mochten auch

Lean Software Development
Lean Software DevelopmentLean Software Development
Lean Software DevelopmentAstrails
 
Engineering esthetics
Engineering estheticsEngineering esthetics
Engineering estheticsAstrails
 
WTF is NoSQL
WTF is NoSQLWTF is NoSQL
WTF is NoSQLAstrails
 
RubyMotion: Put your Dreams in Motion with Ruby
RubyMotion: Put your Dreams in Motion with RubyRubyMotion: Put your Dreams in Motion with Ruby
RubyMotion: Put your Dreams in Motion with RubyAstrails
 
Ruby is an Acceptable Lisp
Ruby is an Acceptable LispRuby is an Acceptable Lisp
Ruby is an Acceptable LispAstrails
 
Machine Learning: Make Your Ruby Code Smarter
Machine Learning: Make Your Ruby Code SmarterMachine Learning: Make Your Ruby Code Smarter
Machine Learning: Make Your Ruby Code SmarterAstrails
 
Migrating from Flux to Redux. Why and how.
Migrating from Flux to Redux. Why and how.Migrating from Flux to Redux. Why and how.
Migrating from Flux to Redux. Why and how.Astrails
 

Andere mochten auch (7)

Lean Software Development
Lean Software DevelopmentLean Software Development
Lean Software Development
 
Engineering esthetics
Engineering estheticsEngineering esthetics
Engineering esthetics
 
WTF is NoSQL
WTF is NoSQLWTF is NoSQL
WTF is NoSQL
 
RubyMotion: Put your Dreams in Motion with Ruby
RubyMotion: Put your Dreams in Motion with RubyRubyMotion: Put your Dreams in Motion with Ruby
RubyMotion: Put your Dreams in Motion with Ruby
 
Ruby is an Acceptable Lisp
Ruby is an Acceptable LispRuby is an Acceptable Lisp
Ruby is an Acceptable Lisp
 
Machine Learning: Make Your Ruby Code Smarter
Machine Learning: Make Your Ruby Code SmarterMachine Learning: Make Your Ruby Code Smarter
Machine Learning: Make Your Ruby Code Smarter
 
Migrating from Flux to Redux. Why and how.
Migrating from Flux to Redux. Why and how.Migrating from Flux to Redux. Why and how.
Migrating from Flux to Redux. Why and how.
 

Ähnlich wie Cassandra Intro - Distributed, Scalable NoSQL Database

Building a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and JavaBuilding a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and Javaantoinegirbal
 
C# Starter L04-Collections
C# Starter L04-CollectionsC# Starter L04-Collections
C# Starter L04-CollectionsMohammad Shaker
 
Coming to Terms with GraphQL
Coming to Terms with GraphQLComing to Terms with GraphQL
Coming to Terms with GraphQLBruce Williams
 
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"South Tyrol Free Software Conference
 
First few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examplesFirst few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examplesNebojša Vukšić
 
Elasticsearch an overview
Elasticsearch   an overviewElasticsearch   an overview
Elasticsearch an overviewAmit Juneja
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life琛琳 饶
 
Json Persistence Framework
Json Persistence FrameworkJson Persistence Framework
Json Persistence Frameworkdanieloskarsson
 
Architecture Components
Architecture ComponentsArchitecture Components
Architecture ComponentsSang Eel Kim
 
Ruby is Awesome
Ruby is AwesomeRuby is Awesome
Ruby is AwesomeAstrails
 
The State of Lithium
The State of LithiumThe State of Lithium
The State of LithiumNate Abele
 
Next-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and PrismaNext-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and PrismaNikolas Burk
 
The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!Donny Wals
 
Ecto DSL Introduction - Yurii Bodarev
Ecto DSL Introduction - Yurii BodarevEcto DSL Introduction - Yurii Bodarev
Ecto DSL Introduction - Yurii BodarevElixir Club
 
Yurii Bodarev - Ecto DSL
Yurii Bodarev - Ecto DSLYurii Bodarev - Ecto DSL
Yurii Bodarev - Ecto DSLElixir Club
 
Teste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityTeste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityWashington Botelho
 

Ähnlich wie Cassandra Intro - Distributed, Scalable NoSQL Database (20)

Building a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and JavaBuilding a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and Java
 
C# Starter L04-Collections
C# Starter L04-CollectionsC# Starter L04-Collections
C# Starter L04-Collections
 
Coming to Terms with GraphQL
Coming to Terms with GraphQLComing to Terms with GraphQL
Coming to Terms with GraphQL
 
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
 
First few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examplesFirst few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examples
 
Elasticsearch an overview
Elasticsearch   an overviewElasticsearch   an overview
Elasticsearch an overview
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life
 
Rails3 changesets
Rails3 changesetsRails3 changesets
Rails3 changesets
 
Json Persistence Framework
Json Persistence FrameworkJson Persistence Framework
Json Persistence Framework
 
Architecture Components
Architecture ComponentsArchitecture Components
Architecture Components
 
Elastic tire demo
Elastic tire demoElastic tire demo
Elastic tire demo
 
Active record(1)
Active record(1)Active record(1)
Active record(1)
 
Ruby is Awesome
Ruby is AwesomeRuby is Awesome
Ruby is Awesome
 
The State of Lithium
The State of LithiumThe State of Lithium
The State of Lithium
 
MongoDB With Style
MongoDB With StyleMongoDB With Style
MongoDB With Style
 
Next-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and PrismaNext-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and Prisma
 
The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!
 
Ecto DSL Introduction - Yurii Bodarev
Ecto DSL Introduction - Yurii BodarevEcto DSL Introduction - Yurii Bodarev
Ecto DSL Introduction - Yurii Bodarev
 
Yurii Bodarev - Ecto DSL
Yurii Bodarev - Ecto DSLYurii Bodarev - Ecto DSL
Yurii Bodarev - Ecto DSL
 
Teste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityTeste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrity
 

Kürzlich hochgeladen

"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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
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
 
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
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
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
 

Kürzlich hochgeladen (20)

"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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
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
 
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.
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Cassandra Intro - Distributed, Scalable NoSQL Database

  • 1. Cassandra A short Intro Vitaly Kushner astrails.com
  • 2. • Distributed • Non-relational • Linearly scalable • Multi data-center aware
  • 4. Terminology Sucks big time
  • 5. my_cluster: { demo_app: { accounts: { "1": { "attributes": { "name": "astrails" }, "users": { "1" => "", "3" => "", } } }, users: { "1": { "name": "vitaly", "email": "vitaly@astrails.com" } } } }
  • 6. my_cluster: { <<= Cluster Name demo_app: { accounts: { "1": { "attributes": { "name": "astrails" }, "users": { "1" => "", "3" => "", } } }, users: { "1": { "name": "vitaly", "email": "vitaly@astrails.com" } } } }
  • 7. my_cluster: { demo_app: { <== Keyspace accounts: { "1": { "attributes": { "name": "astrails" }, "users": { "1" => "", "3" => "", } } }, users: { "1": { "name": "vitaly", "email": "vitaly@astrails.com" } } } }
  • 8. my_cluster: { demo_app: { accounts: { <<= super column family "1": { "attributes": { "name": "astrails" }, "users": { "1" => "", "3" => "", } } }, users: { "1": { "name": "vitaly", "email": "vitaly@astrails.com" } } } }
  • 9. my_cluster: { demo_app: { accounts: { "1": { "attributes": { "name": "astrails" }, "users": { "1" => "", "3" => "", } } }, users: { <<= column family "1": { "name": "vitaly", "email": "vitaly@astrails.com" } } } }
  • 10. my_cluster: { demo_app: { accounts: { "1": { <<= key "attributes": { "name": "astrails" }, "users": { "1" => "", "3" => "", } } }, users: { "1": { "name": "vitaly", "email": "vitaly@astrails.com" } } } }
  • 11. my_cluster: { demo_app: { accounts: { "1": { "attributes": { << super column "name": "astrails" }, "users": { "1" => "", "3" => "", } } }, users: { "1": { "name": "vitaly", "email": "vitaly@astrails.com" } } } }
  • 12. my_cluster: { demo_app: { accounts: { "1": { "attributes": { "name": "astrails" <<= column }, "users": { "1" => "", "3" => "", } } }, users: { "1": { "name": "vitaly", "email": "vitaly@astrails.com" } } } }
  • 13. my_cluster: { demo_app: { accounts: { "1": { "attributes": { "name": "astrails" <<= value }, "users": { "1" => "", "3" => "", } } }, users: { "1": { "name": "vitaly", "email": "vitaly@astrails.com" } } } }
  • 14. my_cluster: { demo_app: { accounts: { "1": { "attributes": { "name": "astrails" }, "users": { "1" => "", "3" => "", } } }, users: { "1": { "name": "vitaly", <<= column "email": "vitaly@astrails.com" } } } }
  • 15. my_cluster: { <<= cluster demo_app: { <<= keyspace accounts: { <<= super column family "1": { <<= key "attributes": { <<= supercolumn "name": "astrails" <<= column }, "users": { "1" => "", "3" => "", } } }, users: { <<= column family "1": { <<= key "name": "vitaly", <<= column "email": "vitaly@astrails.com" } } } }
  • 16. my_cluster: { <<= cluster demo_app: { <<= database accounts: { <<= super column family "1": { <<= key "attributes": { <<= supercolumn "name": "astrails" <<= column }, "users": { "1" => "", "3" => "", } } }, users: { <<= column family "1": { <<= key "name": "vitaly", <<= column "email": "vitaly@astrails.com" } } } }
  • 17. my_cluster: { <<= cluster demo_app: { <<= database accounts: { <<= table "1": { <<= key "attributes": { <<= supercolumn "name": "astrails" <<= column }, "users": { "1" => "", "3" => "", } } }, users: { <<= column family "1": { <<= key "name": "vitaly", <<= column "email": "vitaly@astrails.com" } } } }
  • 18. my_cluster: { <<= cluster demo_app: { <<= database accounts: { <<= table "1": { <<= key "attributes": { <<= supercolumn "name": "astrails" <<= column }, "users": { "1" => "", "3" => "", } } }, users: { <<= table "1": { <<= key "name": "vitaly", <<= column "email": "vitaly@astrails.com" } } } }
  • 19. my_cluster: { <<= cluster demo_app: { <<= database accounts: { <<= table "1": { <<= key "attributes": { <<= collection "name": "astrails" <<= column }, "users": { "1" => "", "3" => "", } } }, users: { <<= table "1": { <<= key "name": "vitaly", <<= column "email": "vitaly@astrails.com" } } } }
  • 20. my_cluster: { <<= cluster demo_app: { <<= database accounts: { <<= table "1": { <<= key "attributes": { <<= collection "name": "astrails" <<= attribute }, "users": { "1" => "", "3" => "", } } }, users: { <<= table "1": { <<= key "name": "vitaly", <<= attribute "email": "vitaly@astrails.com" } } } }
  • 22. "my_cluster": { "demo_app": { "users": { "b2c75e99-e079-449d-b562-293dfdbf006e": { "attributes": { "name": "Vitaly", "email": "vitaly@astrails.com", "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e" } } }, "emails": { "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e", } "remember_me": { "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e", } } }
  • 23. "my_cluster": { "demo_app": { "users": { "b2c75e99-e079-449d-b562-293dfdbf006e": { "attributes": { "name": "Vitaly", "email": "vitaly@astrails.com", "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e" } } }, "emails": { "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e", } "remember_me": { "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e", } } }
  • 24. "my_cluster": { "demo_app": { "users": { "b2c75e99-e079-449d-b562-293dfdbf006e": { "attributes": { "name": "Vitaly", "email": "vitaly@astrails.com", "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e" } } }, "emails": { "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e", } "remember_me": { "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e", } } }
  • 25. "my_cluster": { "demo_app": { "users": { "b2c75e99-e079-449d-b562-293dfdbf006e": { "attributes": { "name": "Vitaly", "email": "vitaly@astrails.com", "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e" } } }, "emails": { "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e", } "remember_me": { "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e", } } }
  • 26. "my_cluster": { "demo_app": { "users": { "b2c75e99-e079-449d-b562-293dfdbf006e": { "attributes": { "name": "Vitaly", "email": "vitaly@astrails.com", "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e" } } }, "emails": { "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e", } "remember_me": { "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e", } } }
  • 27. "my_cluster": { "demo_app": { "users": { "b2c75e99-e079-449d-b562-293dfdbf006e": { "attributes": { "name": "Vitaly", "email": "vitaly@astrails.com", "remember_me": "74c4f3a2c85b66f216211edd5245d25ba251d83e" } } }, "emails": { "vitaly@astrails.com": "b2c75e99-e079-449d-b562-293dfdbf006e", } "remember_me": { "74c4f3a2c85b66f216211edd5245d25ba251d83e": "b2c75e99-e079-449d-b562-293dfdbf006e", } } }
  • 29. > gem install cassandra ... > cassandra_helper cassandra ...
  • 30. <ClusterName>my_cluster</ClusterName> <Keyspaces> <Keyspace Name="demo_app"> <ColumnFamily CompareWith="UTF8Type" Name="users" ColumnType="Super" CompareSubcolumnsWith="UTF8Type" /> <ColumnFamily CompareWith="UTF8Type" Name="emails" ColumnType="Super" CompareSubcolumnsWith="UTF8Type" /> <ColumnFamily CompareWith="UTF8Type" Name="tokens" /> </Keyspace> </Keyspaces>
  • 31. require 'rubygems' require 'cassandra' include Cassandra::Constants client = Cassandra.new('demo_app') client.insert(:users, "1", {"name" => "vitaly", "email" => "vitaly@astrails.com"}) client.insert(:accounts, "1", {"attributes" => {"name" => "astrails"}, "users" => {"1" => ""}}) client.insert(:users, "2", {"name" => "boris"}) client.insert(:accounts, "1", {"users" => {"2" => ""}}) client.get(:users, "1")
  • 33. YES!
  • 37. class Account < SmallRecord::Base attribute :name attribute :created_at, :type => :datetime has_many :users validates_presence_of :name end class User < SmallRecord::Base attribute :name attribute :email attribute :created_at, :type => :datetime attribute :account_id def account @account ||= Account.find(:account_id) end validates_presence_of :name validates_presence_of :email end Account.find(params[:account]).users.first.name
  • 38. production: adapter: cassandra host: 127.0.0.1 port: 9160 keyspace: chronos development: adapter: mock test: adapter: mock
  • 39. production: adapter: cassandra host: 127.0.0.1 port: 9160 keyspace: chronos development: adapter: mock test: adapter: mock
  • 40. Some Links • http://incubator.apache.org/cassandra • http://labs.google.com/papers/bigtable.html • http://blog.evanweaver.com/articles/2009/07/06/up-and-running-with-cassandra/ • http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model • http://github.com/astrails/small_record