Beyond (No)SQL
Upcoming SlideShare
Loading in...5
×
 

Beyond (No)SQL

on

  • 4,871 views

Slides from my RailsConf 2010 talk, Beyond No(SQL). Conceptual tools for evaluating both SQL and NoSQL databases.

Slides from my RailsConf 2010 talk, Beyond No(SQL). Conceptual tools for evaluating both SQL and NoSQL databases.

Statistics

Views

Total Views
4,871
Views on SlideShare
4,206
Embed Views
665

Actions

Likes
6
Downloads
172
Comments
1

8 Embeds 665

http://www.sarahmei.com 556
http://en.oreilly.com 58
http://www.slideshare.net 36
http://theoldreader.com 8
http://www.newsblur.com 3
http://static.slidesharecdn.com 2
http://newsblur.com 1
http://www.linkedin.com 1
More...

Accessibility

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Great deck! We're pretty excited about Mongo here at slideshare ... always good to hear the theoretical background on these new offerings (vs relational dbs).
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • A table is called a &#x201C;relation&#x201D; in this model, and it&#x2019;s defined by a list of column definitions. Each column definition specifies a unique column name and the type of the values that are permitted for that column. The body of the table is a set of rows, which are called tuples in the model. Each row is a set of key-value pairs, or tuple, consisting of the name of the column and the value of the data. Each tuple has to be unique in the table. <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • They transform tables into other tables. Another word for this is &#x201C;query.&#x201D; <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Beyond (No)SQL Beyond (No)SQL Presentation Transcript

  • Beyond (No)SQL Sarah Mei Pivotal Labs @sarahmei sarah@pivotallabs.com
  • ?
  • Fsck CS. -DHH
  • Fsck CS. -DHH (paraphrased)
  • Photo by jasonwg (http://www.flickr.com/photos/jasonwg/1382036808)
  • Photo by jasonwg (http://www.flickr.com/photos/jasonwg/1382036808)
  • Agenda
  • Agenda • The data storage landscape
  • Agenda • The data storage landscape • Relational model & SQL
  • Agenda • The data storage landscape • Relational model & SQL RELATIONAL ALGEBRA
  • Agenda • The data storage landscape • Relational model & SQL RELATIONAL ALGEBRA • Evaluating data stores
  • Photo by TANAKA Juuyoh http://www.flickr.com/photos/tanaka_juuyoh/3121538767/
  • Photo by TANAKA Juuyoh http://www.flickr.com/photos/tanaka_juuyoh/3121538767/
  • Photo by TANAKA Juuyoh http://www.flickr.com/photos/tanaka_juuyoh/3121538767/
  • Photo by TANAKA Juuyoh http://www.flickr.com/photos/tanaka_juuyoh/3121538767/
  • Photo by TANAKA Juuyoh http://www.flickr.com/photos/tanaka_juuyoh/3121538767/
  • “NoSQL”
  • “NoSQL” MongoDB
  • “NoSQL” MongoDB Memcache
  • “NoSQL” MongoDB Memcache Bigtable
  • “NoSQL” MongoDB Memcache Bigtable CouchDB
  • “NoSQL” MongoDB Memcache Bigtable CouchDB Cassandra
  • “NoSQL” MongoDB Memcache Bigtable CouchDB Cassandra Project Voldemort
  • “NoSQL” MongoDB Memcache Bigtable CouchDB Cassandra Project Voldemort Hbase
  • “NoSQL” MongoDB Memcache Bigtable CouchDB Cassandra Project Voldemort Hbase Riak
  • “NoSQL” MongoDB Memcache Bigtable CouchDB Cassandra Project Voldemort Hbase Riak Redis
  • “NoSQL” MongoDB Memcache Bigtable CouchDB Cassandra Project Voldemort Hbase Riak Redis Tokyo Cabinet
  • “NoSQL” MongoDB Memcache Key-value Bigtable CouchDB Cassandra Project Voldemort Hbase Riak Redis Tokyo Cabinet
  • “NoSQL” MongoDB Memcache Key-value Bigtable CouchDB Document Cassandra Project Voldemort Hbase Riak Redis Tokyo Cabinet
  • “NoSQL” MongoDB Memcache Key-value Bigtable CouchDB Document Cassandra Project Voldemort Hbase Riak Redis Tokyo Cabinet
  • “NoSQL” MongoDB Memcache Key-value Bigtable CouchDB Document Cassandra Other Project Voldemort Hbase Riak Redis Tokyo Cabinet
  • Photo from mga (http://www.flickr.com/photos/mgiraldo/420642350)
  • NO.
  • The Relational Model Diagram by Wikipedia user AutumnSnow (http://en.wikipedia.org/wiki/File:Relational_model_concepts.png)
  • Sets
  • Sets • No duplicates
  • Sets • No duplicates • Unordered
  • More sets
  • More sets • TABLE: a set of columns and a set of rows
  • More sets • TABLE: a set of columns and a set of rows • COLUMN: a unique name and a type
  • More sets • TABLE: a set of columns and a set of rows • COLUMN: a unique name and a type • ROW: a set of name-value pairs
  • Relational Algebra Operations you can do on tables (“relations”)
  • Operations • projection: subset of available columns • selection: subset of available rows • cartesian product • set union • set intersection • rename
  • Operations • projection: subset of available columns • selection: subset of available rows • cartesian product • set union • set intersection • rename
  • A Join select * from foo, bar where foo.ipsum = bar.lorem First you take the cartesian product.... foo: bat ipsum bar: cat lorem me 5 X us 5 you 4 them 4 bat ipsum cat lorem me 5 us 5 = me 5 them 4 you 4 us 5 you 4 them 4
  • A Join select * from foo, bar where foo.ipsum = bar.lorem Then you select the rows that satisfy the join condition: bat ipsum cat lorem bat ipsum cat lorem me 5 us 5 me 5 us 5 me 5 them 4 => you 4 them 4 you 4 us 5 you 4 them 4
  • A Join select * from foo, bar where foo.ipsum = bar.lorem First you take the cartesian product.... foo: bat ipsum bar: cat lorem me 5 X us 5 you 4 them 4 bat ipsum cat lorem me 5 us 5 = me 5 them 4 you 4 us 5 you 4 them 4
  • A Join select * from foo, bar where foo.ipsum = bar.lorem First you take the cartesian product.... foo: bat ipsum bar: cat lorem me 5 X us 5 8,000,000 you 4 them 4 bat ipsum cat lorem me 5 us 5 = me 5 them 4 you 4 us 5 you 4 them 4
  • A Join select * from foo, bar where foo.ipsum = bar.lorem First you take the cartesian product.... foo: bat ipsum bar: cat lorem me 5 X us 5 8,000,000 100,000 you 4 them 4 bat ipsum cat lorem me 5 us 5 = me 5 them 4 you 4 us 5 you 4 them 4
  • A Join select * from foo, bar where foo.ipsum = bar.lorem First you take the cartesian product.... foo: bat ipsum bar: cat lorem me 5 X us 5 8,000,000 100,000 you 4 them 4 bat ipsum cat lorem me 5 us 5 = me 5 them 4 800,000,000,000 you 4 us 5 you 4 them 4
  • Your choices
  • Your choices • Scale the database
  • Your choices • Scale the database • Try a different approach
  • What SQL Gets You
  • What SQL Gets You • Speed
  • What SQL Gets You • Speed (when data is highly structured and small enough)
  • What SQL Gets You • Speed (when data is highly structured and small enough) • Aggregation
  • What SQL Gets You • Speed (when data is highly structured and small enough) • Aggregation • Relational searching
  • What SQL Gets You • Speed (when data is highly structured and small enough) • Aggregation • Relational searching • ACID - guaranteed full consistency
  • Image by captcreate (http://www.flickr.com/photos/27845211@N02/2662264721)
  • What SQL Gets You
  • What SQL Gets You • Speed
  • What SQL Gets You • Speed (when data is highly structured and small enough)
  • What SQL Gets You • Speed (when data is highly structured and small enough) • Aggregation
  • What SQL Gets You • Speed (when data is highly structured and small enough) • Aggregation • Relational searching
  • What SQL Gets You • Speed (when data is highly structured and small enough) • Aggregation • Relational searching • ACID - guaranteed full consistency
  • What if you gave up data aggregation?
  • What if you gave up data aggregation? Document databases: MongoDB CouchDB Riak
  • What if you gave up where clauses?
  • What if you gave up where clauses? Key-value stores: Memcache Project Voldemort Redis Tokyo Cabinet
  • What if you gave up consistency?
  • What if you gave up consistency? Then things get interesting.
  • ACID & BASE
  • ACID & BASE • Atomicity
  • ACID & BASE • Atomicity • Consistency
  • ACID & BASE • Atomicity • Consistency • Isolation
  • ACID & BASE • Atomicity • Consistency • Isolation • Durability
  • ACID & BASE • Atomicity • Consistency • Isolation • Durability
  • ACID & BASE • Atomicity • Basically Available • Consistency • Isolation • Durability
  • ACID & BASE • Atomicity • Basically Available • Consistency • Soft state • Isolation • Durability
  • ACID & BASE • Atomicity • Basically Available • Consistency • Soft state • Isolation • Eventually consistent • Durability
  • Photo by Marcus Vegas (http://www.flickr.com/photos/vegas/413159909)
  • Fully ACID Fully BASE Photo by Marcus Vegas (http://www.flickr.com/photos/vegas/413159909)
  • Fully ACID Fully BASE Redis Photo by Marcus Vegas (http://www.flickr.com/photos/vegas/413159909)
  • Fully ACID Fully BASE CouchDB Redis Photo by Marcus Vegas (http://www.flickr.com/photos/vegas/413159909)
  • Fully ACID Fully BASE CouchDB Redis Bigtable Photo by Marcus Vegas (http://www.flickr.com/photos/vegas/413159909)
  • Questions to ask about data • Where can I compromise aggregation? • Where can I compromise where clauses? • Where can I compromise consistency? Where can I localize consistency?
  • CAP Theorem Pick any two:
  • CAP Theorem Pick any two: • Consistency
  • CAP Theorem Pick any two: • Consistency • Availability
  • CAP Theorem Pick any two: • Consistency • Availability • Partition tolerance
  • Summary
  • Summary Every system at scale will have to compromise consistency at some level.
  • Summary Every system at scale will have to compromise consistency at some level.
  • Summary Every system at scale will have to compromise consistency at some level. Do it mindfully.
  • Questions? Twitter: @sarahmei Email: sarah@pivotallabs.com Slides: http://bit.ly/9xS2PK Please rate this talk! http://bit.ly/9MCtX9