SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
What Does NoSQL Mean
       for You?
           Chris Lea
       (mt) Media Temple
      FOWA Dublin 2010
For Starters: What does it
       mean at all?
For Starters: What does it
       mean at all?

“NoSQL is a blanket term used to describe
structured storage that doesn’t rely on SQL
      to be accessed in a useful way”.

               -- Chris Lea
For Starters: What does it
       mean at all?

“NoSQL” DOES NOT mean “SQL is Bad”
MySQL does what I need, why
      should I care?
MySQL does what I need, why
      should I care?

 “If I’d asked my customers what they wanted,
they’d have said a faster horse.” -- Henry Ford
MySQL does what I need, why
      should I care?
     RDBMS                  NoSQL

  Designed for generic   Designed to solve
       workloads         specific problems

  Large (and growing)    Trades features for
      feature sets          performance
(the NoSQL umbrella)
Key / Value Caches
                        • Redis
(the NoSQL umbrella)    • Memcached
Key / Value Caches
                        • Redis
(the NoSQL umbrella)    • Memcached


           Key / Value Stores
              • Tokyo cabinet
              • Memcachedb
              • Project Voldemort
              • Cassandra
Key / Value Caches
                        • Redis
(the NoSQL umbrella)    • Memcached


           Key / Value Stores
              • Tokyo cabinet
              • Memcachedb
              • Project Voldemort
              • Cassandra
Tabular
 • HBase
 • Hypertable
Key / Value Caches
                        • Redis
(the NoSQL umbrella)    • Memcached


           Key / Value Stores
                                     Document
              • Tokyo cabinet
              • Memcachedb             • CouchDB
              • Project Voldemort      • MongoDB
              • Cassandra              • Jackrabbit
Tabular
 • HBase
 • Hypertable
Key / Value Caches
                        • Redis
(the NoSQL umbrella)    • Memcached


           Key / Value Stores
                                     Document
              • Tokyo cabinet
              • Memcachedb             • CouchDB
              • Project Voldemort      • MongoDB
              • Cassandra              • Jackrabbit
Tabular
 • HBase
 • Hypertable
Should I be Thinking about
         NoSQL?
Should I be Thinking about
                NoSQL?
                                             Probably need
                                                RDBMS.

                Yes      Can you sanely do
                      what you need in the app?   No
Do you need
transactions?

                                                  Yes
                        No

                                              Think about
                                               NoSQL.
NoSQL Systems Typically
 Don’t do Transactions
       or Joins
NoSQL Systems Typically
     Don’t do Transactions
           or Joins
• If you really need transactions, stick with RDBMS
• Not having joins turns out to be not such a big deal
NoSQL Systems Typically
   Don’t do Transactions
         or Joins

MongoDB is an excellent use case example
Why MongoDB?
• Comfortable if you are coming from MySQL
• Written in C++ means all machine code
 • no Erlang / Java / virtual machines
• Tools like mongo (shell), mongodump, mongostat,
 mongoimport
• Native drives in languages you care about
 • no Thrift / REST / code generation steps
Why MongoDB?
• No complex transactions
 • If you don’t use them, this is a non-issue
• No joins
 • This turns out to not be a big deal generally, because
   we’re going to rethink our data modeling
Why MongoDB?
 Transactions and joins are a huge computational
       overhead, even if you don’t use them!

• No complex transactions
 • If you don’t use them, this is a non-issue
• No joins
 • This turns out to not be a big deal generally, because
   we’re going to rethink our data modeling
Why MongoDB?
 Transactions and joins are a huge computational
       overhead, even if you don’t use them!

• No complex transactions
 • If you don’t use them, this is a non-issue
• No joins
 • This turns out to not be a big deal generally, because
   we’re going to rethink our data modeling
Thinking About Your Data (RDBMS)
• Look at data, determine logical groupings
  • (hope structure never changes)
• Make tables based on groups, link with ID fields
• Break up data on insert, put into appropriate tables
• Use joins on select to re-assemble data
• Create indexes as needed for fast queries
Thinking About Your Data (RDBMS)
  user_t                  comment_t

                           comment_id
  user_id
              post_t         post_id
 user_name    post_id
                          comment_body
              user_id
             post_title
             post_body
Thinking About Your Data (RDBMS)

  This leads to queries such as:

SELECT post_title,post_body,post_id FROM post_t,user_t WHERE
   user_t.user_name = “Lorraine” AND post_t.user_id = user_t.user_id LIMIT 1;

SELECT comment_body FROM comment_t WHERE comment_t.post_id = $post_id;
Thinking About Your Data (MongoDB)


• Figure out how you will eventually use the data
• Store it that way
• Create indexes as needed for fast queries
Thinking About Your Data (MongoDB)

  from pymongo import Connection
  connection = Connection()
  db = connection['blog']

  posts = db['posts']

  post = {"author": "Lorraine",
       "title": "Who on Earth lets Chris Lea Talk on Stage?",
       "post": "Seriously. That's just not cool.",
       "comments": ["Is he really that bad?", "Yes, he really is."],
       "date": datetime.datetime.utcnow()}

  posts.insert(post)
Thinking About Your Data (MongoDB)


  from pymongo import Connection
  connection = Connection()
  db = connection['blog']

  posts = db['posts']

  post = posts.find_one({“author”: “Lorraine”})
Say Goodbye to Schemas

from pymongo import Connection
connection = Connection()
db = connection['blog']

posts = db['posts']

post = {"author": "Lorraine",
     "title": "Who on Earth lets Chris Lea Talk on Stage?",
     "post": "Seriously. That's just not cool.",
     "comments": ["Is he really that bad?", "Yes, he really is."],
     "date": datetime.datetime.utcnow()}

posts.insert(post)
Say Goodbye to Schemas
from pymongo import Connection
connection = Connection()
db = connection['blog']

posts = db['posts']

post = {"author": "Lorraine",
     "title": "Who on Earth lets Chris Lea Talk on Stage?",
     "post": "Seriously. That's just not cool.",
     "comments": ["Is he really that bad?", "Yes, he really is."],
     "tags": ["fowa", "nosql", "nerds"],
     "date": datetime.datetime.utcnow()}

posts.insert(post)
Say Goodbye to Schemas
from pymongo import Connection
connection = Connection()
db = connection['blog']
                                If you want new fields... just start
posts = db['posts']                       using them!
post = {"author": "Lorraine",
     "title": "Who on Earth lets Chris Lea Talk on Stage?",
     "post": "Seriously. That's just not cool.",
     "comments": ["Is he really that bad?", "Yes, he really is."],
     "tags": ["fowa", "nosql", "nerds"],
     "date": datetime.datetime.utcnow()}

posts.insert(post)
Enjoy a Wealth of Query Options


from pymongo import Connection
connection = Connection()
db = connection['blog']

posts = db['posts']

posts.find_one({“author”: “Lorraine”})
Enjoy a Wealth of Query Options


from pymongo import Connection
connection = Connection()
db = connection['blog']

posts = db['posts']

posts.find({“author”: “Lorraine”}).limit(5)
Enjoy a Wealth of Query Options


from pymongo import Connection
connection = Connection()
db = connection['blog']

posts = db['posts']

posts.find({“author”: /^Lor/})
Enjoy a Wealth of Query Options


from pymongo import Connection
connection = Connection()
db = connection['blog']

posts = db['posts']

posts.find({“author”: {$not: “Lorraine”} })
Enjoy a Massive Performance Jump

• Mileage will vary, but 10x is not uncommon
  • For reads and writes
• Writes happen at near disk native speed
  • Logging to MongoDB is perfectly acceptable
• Reads for active data near Memcached speeds
Enjoy a Massive Performance Jump



 Ability to write bad queries is
     enormously reduced!
Ability to write bad queries is
       enormously reduced!

• No joins means need for complex indexes reduced
• Chances of index / query mismatches vastly lower
• Disk I/O much less complex, and therefore much faster
Caveats for MongoDB

• Really should use 64bit machines for production
  • 32bit has 2G limit per collection (table)
• Happiest with lots of RAM relative to active data
• Under heavy development
  • Features / drivers / docs changing rapidly
Questions?

Mais conteúdo relacionado

Mais procurados

High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Javasunnygleason
 
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)MongoDB
 
Conceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQLConceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQLMongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBSean Laurent
 
MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012Sean Laurent
 
MongoDB Strange Loop 2009
MongoDB Strange Loop 2009MongoDB Strange Loop 2009
MongoDB Strange Loop 2009Mike Dirolf
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónMongoDB
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
MongoDB EuroPython 2009
MongoDB EuroPython 2009MongoDB EuroPython 2009
MongoDB EuroPython 2009Mike Dirolf
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLOSInet
 
Modern Database Systems (for Genealogy)
Modern Database Systems (for Genealogy)Modern Database Systems (for Genealogy)
Modern Database Systems (for Genealogy)Steven Francia
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLRichard Schneeman
 
I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017Matthew Groves
 
Mura ORM & Ember JS
Mura ORM & Ember JSMura ORM & Ember JS
Mura ORM & Ember JSMura CMS
 
Mobile services on windows azure (part1)
Mobile services on windows azure (part1)Mobile services on windows azure (part1)
Mobile services on windows azure (part1)Radu Vunvulea
 
Deliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sitesDeliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sitesJazkarta, Inc.
 

Mais procurados (20)

High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
 
Conceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQLConceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQL
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012
 
MongoDB Strange Loop 2009
MongoDB Strange Loop 2009MongoDB Strange Loop 2009
MongoDB Strange Loop 2009
 
Websites On Speed
Websites On SpeedWebsites On Speed
Websites On Speed
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producción
 
NoSQL Technology
NoSQL TechnologyNoSQL Technology
NoSQL Technology
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
MongoDB EuroPython 2009
MongoDB EuroPython 2009MongoDB EuroPython 2009
MongoDB EuroPython 2009
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQL
 
Modern Database Systems (for Genealogy)
Modern Database Systems (for Genealogy)Modern Database Systems (for Genealogy)
Modern Database Systems (for Genealogy)
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQL
 
I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017
 
Mura ORM & Ember JS
Mura ORM & Ember JSMura ORM & Ember JS
Mura ORM & Ember JS
 
Mobile services on windows azure (part1)
Mobile services on windows azure (part1)Mobile services on windows azure (part1)
Mobile services on windows azure (part1)
 
Deliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sitesDeliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sites
 

Semelhante a Chris Lea - What does NoSQL Mean for You

MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRailsMike Dirolf
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Chris Richardson
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06jimbojsb
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep divelucenerevolution
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsSteven Francia
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Railsrschmukler
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataRoger Xia
 
Why Organizations are Looking at Alternative Database Technologies – Introduc...
Why Organizations are Looking at Alternative Database Technologies – Introduc...Why Organizations are Looking at Alternative Database Technologies – Introduc...
Why Organizations are Looking at Alternative Database Technologies – Introduc...DATAVERSITY
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRavi Teja
 
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB GalaxyMongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB GalaxyMongoDB
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDBNorberto Leite
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDBMongoDB
 
Azure doc db (slideshare)
Azure doc db (slideshare)Azure doc db (slideshare)
Azure doc db (slideshare)David Green
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMike Dirolf
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharpSerdar Buyuktemiz
 

Semelhante a Chris Lea - What does NoSQL Mean for You (20)

MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRails
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep dive
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Why Organizations are Looking at Alternative Database Technologies – Introduc...
Why Organizations are Looking at Alternative Database Technologies – Introduc...Why Organizations are Looking at Alternative Database Technologies – Introduc...
Why Organizations are Looking at Alternative Database Technologies – Introduc...
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB at RuPy
MongoDB at RuPyMongoDB at RuPy
MongoDB at RuPy
 
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB GalaxyMongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
 
NoSQL
NoSQLNoSQL
NoSQL
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
 
Azure doc db (slideshare)
Azure doc db (slideshare)Azure doc db (slideshare)
Azure doc db (slideshare)
 
MongoDB
MongoDBMongoDB
MongoDB
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharp
 

Mais de Carsonified Team

Tara Hunt - Your Social Media Strategy Wont Save You
Tara Hunt - Your Social Media Strategy Wont Save YouTara Hunt - Your Social Media Strategy Wont Save You
Tara Hunt - Your Social Media Strategy Wont Save YouCarsonified Team
 
Dion Almaer & Ben Galbraith - Build Once, Deploy Everywhere
Dion Almaer & Ben Galbraith - Build Once, Deploy EverywhereDion Almaer & Ben Galbraith - Build Once, Deploy Everywhere
Dion Almaer & Ben Galbraith - Build Once, Deploy EverywhereCarsonified Team
 
Steve Huffman - Lessons learned while at reddit.com
Steve Huffman - Lessons learned while at reddit.comSteve Huffman - Lessons learned while at reddit.com
Steve Huffman - Lessons learned while at reddit.comCarsonified Team
 
Neil Patel - What You Need to be Measuring and How to Do It
Neil Patel - What You Need to be Measuring and How to Do ItNeil Patel - What You Need to be Measuring and How to Do It
Neil Patel - What You Need to be Measuring and How to Do ItCarsonified Team
 
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web AppMolly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web AppCarsonified Team
 
Mike Mcderment - Marketing Metrics and the Systems You Need to Measure Them
Mike Mcderment - Marketing Metrics and the Systems You Need to Measure ThemMike Mcderment - Marketing Metrics and the Systems You Need to Measure Them
Mike Mcderment - Marketing Metrics and the Systems You Need to Measure ThemCarsonified Team
 
Fred Wilson - The 10 Golden Principles for Successful Web Apps
Fred Wilson - The 10 Golden Principles for Successful Web AppsFred Wilson - The 10 Golden Principles for Successful Web Apps
Fred Wilson - The 10 Golden Principles for Successful Web AppsCarsonified Team
 
Alex Payne - Speedy, Stable, and Secure: Better Web Applications Through Func...
Alex Payne - Speedy, Stable, and Secure: Better Web Applications Through Func...Alex Payne - Speedy, Stable, and Secure: Better Web Applications Through Func...
Alex Payne - Speedy, Stable, and Secure: Better Web Applications Through Func...Carsonified Team
 
Aaron Patzer - How to Take Your Start-up to the Next Level
Aaron Patzer - How to Take Your Start-up to the Next LevelAaron Patzer - How to Take Your Start-up to the Next Level
Aaron Patzer - How to Take Your Start-up to the Next LevelCarsonified Team
 
Taking your Site from One to One Million Users by Kevin Rose
Taking your Site from One to One Million Users by Kevin RoseTaking your Site from One to One Million Users by Kevin Rose
Taking your Site from One to One Million Users by Kevin RoseCarsonified Team
 
The New Marketing, by Ryan Carson
The New Marketing, by Ryan CarsonThe New Marketing, by Ryan Carson
The New Marketing, by Ryan CarsonCarsonified Team
 
FOWA Tour- Andy McLoughlin
FOWA Tour- Andy McLoughlinFOWA Tour- Andy McLoughlin
FOWA Tour- Andy McLoughlinCarsonified Team
 
FOWA Tour- Graeme Mathieson
FOWA Tour- Graeme MathiesonFOWA Tour- Graeme Mathieson
FOWA Tour- Graeme MathiesonCarsonified Team
 
FOWA Bristol/ Leeds- Dan Rubin
FOWA Bristol/ Leeds- Dan RubinFOWA Bristol/ Leeds- Dan Rubin
FOWA Bristol/ Leeds- Dan RubinCarsonified Team
 
Danny Somekh - FOWD London 2009
Danny Somekh - FOWD London 2009Danny Somekh - FOWD London 2009
Danny Somekh - FOWD London 2009Carsonified Team
 

Mais de Carsonified Team (20)

Tara Hunt - Your Social Media Strategy Wont Save You
Tara Hunt - Your Social Media Strategy Wont Save YouTara Hunt - Your Social Media Strategy Wont Save You
Tara Hunt - Your Social Media Strategy Wont Save You
 
Dion Almaer & Ben Galbraith - Build Once, Deploy Everywhere
Dion Almaer & Ben Galbraith - Build Once, Deploy EverywhereDion Almaer & Ben Galbraith - Build Once, Deploy Everywhere
Dion Almaer & Ben Galbraith - Build Once, Deploy Everywhere
 
Steve Huffman - Lessons learned while at reddit.com
Steve Huffman - Lessons learned while at reddit.comSteve Huffman - Lessons learned while at reddit.com
Steve Huffman - Lessons learned while at reddit.com
 
Neil Patel - What You Need to be Measuring and How to Do It
Neil Patel - What You Need to be Measuring and How to Do ItNeil Patel - What You Need to be Measuring and How to Do It
Neil Patel - What You Need to be Measuring and How to Do It
 
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web AppMolly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
 
Mike Mcderment - Marketing Metrics and the Systems You Need to Measure Them
Mike Mcderment - Marketing Metrics and the Systems You Need to Measure ThemMike Mcderment - Marketing Metrics and the Systems You Need to Measure Them
Mike Mcderment - Marketing Metrics and the Systems You Need to Measure Them
 
Fred Wilson - The 10 Golden Principles for Successful Web Apps
Fred Wilson - The 10 Golden Principles for Successful Web AppsFred Wilson - The 10 Golden Principles for Successful Web Apps
Fred Wilson - The 10 Golden Principles for Successful Web Apps
 
Alex Payne - Speedy, Stable, and Secure: Better Web Applications Through Func...
Alex Payne - Speedy, Stable, and Secure: Better Web Applications Through Func...Alex Payne - Speedy, Stable, and Secure: Better Web Applications Through Func...
Alex Payne - Speedy, Stable, and Secure: Better Web Applications Through Func...
 
Aaron Patzer - How to Take Your Start-up to the Next Level
Aaron Patzer - How to Take Your Start-up to the Next LevelAaron Patzer - How to Take Your Start-up to the Next Level
Aaron Patzer - How to Take Your Start-up to the Next Level
 
Taking your Site from One to One Million Users by Kevin Rose
Taking your Site from One to One Million Users by Kevin RoseTaking your Site from One to One Million Users by Kevin Rose
Taking your Site from One to One Million Users by Kevin Rose
 
The New Marketing, by Ryan Carson
The New Marketing, by Ryan CarsonThe New Marketing, by Ryan Carson
The New Marketing, by Ryan Carson
 
FOWA Tour- Richard Healy
FOWA Tour- Richard HealyFOWA Tour- Richard Healy
FOWA Tour- Richard Healy
 
FOWA Tour- Andy McLoughlin
FOWA Tour- Andy McLoughlinFOWA Tour- Andy McLoughlin
FOWA Tour- Andy McLoughlin
 
FOWA Tour- Dorothy Briggs
FOWA Tour- Dorothy BriggsFOWA Tour- Dorothy Briggs
FOWA Tour- Dorothy Briggs
 
FOWA Tour- Ryan Carson
FOWA Tour- Ryan CarsonFOWA Tour- Ryan Carson
FOWA Tour- Ryan Carson
 
FOWA Tour- Roan Lavery
FOWA Tour- Roan LaveryFOWA Tour- Roan Lavery
FOWA Tour- Roan Lavery
 
FOWA Tour- Graeme Mathieson
FOWA Tour- Graeme MathiesonFOWA Tour- Graeme Mathieson
FOWA Tour- Graeme Mathieson
 
FOWA Bristol/ Leeds- Dan Rubin
FOWA Bristol/ Leeds- Dan RubinFOWA Bristol/ Leeds- Dan Rubin
FOWA Bristol/ Leeds- Dan Rubin
 
FOWA Bristol- Ian Broom
FOWA Bristol- Ian BroomFOWA Bristol- Ian Broom
FOWA Bristol- Ian Broom
 
Danny Somekh - FOWD London 2009
Danny Somekh - FOWD London 2009Danny Somekh - FOWD London 2009
Danny Somekh - FOWD London 2009
 

Chris Lea - What does NoSQL Mean for You

  • 1. What Does NoSQL Mean for You? Chris Lea (mt) Media Temple FOWA Dublin 2010
  • 2. For Starters: What does it mean at all?
  • 3. For Starters: What does it mean at all? “NoSQL is a blanket term used to describe structured storage that doesn’t rely on SQL to be accessed in a useful way”. -- Chris Lea
  • 4. For Starters: What does it mean at all? “NoSQL” DOES NOT mean “SQL is Bad”
  • 5. MySQL does what I need, why should I care?
  • 6. MySQL does what I need, why should I care? “If I’d asked my customers what they wanted, they’d have said a faster horse.” -- Henry Ford
  • 7. MySQL does what I need, why should I care? RDBMS NoSQL Designed for generic Designed to solve workloads specific problems Large (and growing) Trades features for feature sets performance
  • 9. Key / Value Caches • Redis (the NoSQL umbrella) • Memcached
  • 10. Key / Value Caches • Redis (the NoSQL umbrella) • Memcached Key / Value Stores • Tokyo cabinet • Memcachedb • Project Voldemort • Cassandra
  • 11. Key / Value Caches • Redis (the NoSQL umbrella) • Memcached Key / Value Stores • Tokyo cabinet • Memcachedb • Project Voldemort • Cassandra Tabular • HBase • Hypertable
  • 12. Key / Value Caches • Redis (the NoSQL umbrella) • Memcached Key / Value Stores Document • Tokyo cabinet • Memcachedb • CouchDB • Project Voldemort • MongoDB • Cassandra • Jackrabbit Tabular • HBase • Hypertable
  • 13. Key / Value Caches • Redis (the NoSQL umbrella) • Memcached Key / Value Stores Document • Tokyo cabinet • Memcachedb • CouchDB • Project Voldemort • MongoDB • Cassandra • Jackrabbit Tabular • HBase • Hypertable
  • 14. Should I be Thinking about NoSQL?
  • 15. Should I be Thinking about NoSQL? Probably need RDBMS. Yes Can you sanely do what you need in the app? No Do you need transactions? Yes No Think about NoSQL.
  • 16. NoSQL Systems Typically Don’t do Transactions or Joins
  • 17. NoSQL Systems Typically Don’t do Transactions or Joins • If you really need transactions, stick with RDBMS • Not having joins turns out to be not such a big deal
  • 18. NoSQL Systems Typically Don’t do Transactions or Joins MongoDB is an excellent use case example
  • 19. Why MongoDB? • Comfortable if you are coming from MySQL • Written in C++ means all machine code • no Erlang / Java / virtual machines • Tools like mongo (shell), mongodump, mongostat, mongoimport • Native drives in languages you care about • no Thrift / REST / code generation steps
  • 20. Why MongoDB? • No complex transactions • If you don’t use them, this is a non-issue • No joins • This turns out to not be a big deal generally, because we’re going to rethink our data modeling
  • 21. Why MongoDB? Transactions and joins are a huge computational overhead, even if you don’t use them! • No complex transactions • If you don’t use them, this is a non-issue • No joins • This turns out to not be a big deal generally, because we’re going to rethink our data modeling
  • 22. Why MongoDB? Transactions and joins are a huge computational overhead, even if you don’t use them! • No complex transactions • If you don’t use them, this is a non-issue • No joins • This turns out to not be a big deal generally, because we’re going to rethink our data modeling
  • 23. Thinking About Your Data (RDBMS) • Look at data, determine logical groupings • (hope structure never changes) • Make tables based on groups, link with ID fields • Break up data on insert, put into appropriate tables • Use joins on select to re-assemble data • Create indexes as needed for fast queries
  • 24. Thinking About Your Data (RDBMS) user_t comment_t comment_id user_id post_t post_id user_name post_id comment_body user_id post_title post_body
  • 25. Thinking About Your Data (RDBMS) This leads to queries such as: SELECT post_title,post_body,post_id FROM post_t,user_t WHERE user_t.user_name = “Lorraine” AND post_t.user_id = user_t.user_id LIMIT 1; SELECT comment_body FROM comment_t WHERE comment_t.post_id = $post_id;
  • 26. Thinking About Your Data (MongoDB) • Figure out how you will eventually use the data • Store it that way • Create indexes as needed for fast queries
  • 27. Thinking About Your Data (MongoDB) from pymongo import Connection connection = Connection() db = connection['blog'] posts = db['posts'] post = {"author": "Lorraine", "title": "Who on Earth lets Chris Lea Talk on Stage?", "post": "Seriously. That's just not cool.", "comments": ["Is he really that bad?", "Yes, he really is."], "date": datetime.datetime.utcnow()} posts.insert(post)
  • 28. Thinking About Your Data (MongoDB) from pymongo import Connection connection = Connection() db = connection['blog'] posts = db['posts'] post = posts.find_one({“author”: “Lorraine”})
  • 29. Say Goodbye to Schemas from pymongo import Connection connection = Connection() db = connection['blog'] posts = db['posts'] post = {"author": "Lorraine", "title": "Who on Earth lets Chris Lea Talk on Stage?", "post": "Seriously. That's just not cool.", "comments": ["Is he really that bad?", "Yes, he really is."], "date": datetime.datetime.utcnow()} posts.insert(post)
  • 30. Say Goodbye to Schemas from pymongo import Connection connection = Connection() db = connection['blog'] posts = db['posts'] post = {"author": "Lorraine", "title": "Who on Earth lets Chris Lea Talk on Stage?", "post": "Seriously. That's just not cool.", "comments": ["Is he really that bad?", "Yes, he really is."], "tags": ["fowa", "nosql", "nerds"], "date": datetime.datetime.utcnow()} posts.insert(post)
  • 31. Say Goodbye to Schemas from pymongo import Connection connection = Connection() db = connection['blog'] If you want new fields... just start posts = db['posts'] using them! post = {"author": "Lorraine", "title": "Who on Earth lets Chris Lea Talk on Stage?", "post": "Seriously. That's just not cool.", "comments": ["Is he really that bad?", "Yes, he really is."], "tags": ["fowa", "nosql", "nerds"], "date": datetime.datetime.utcnow()} posts.insert(post)
  • 32. Enjoy a Wealth of Query Options from pymongo import Connection connection = Connection() db = connection['blog'] posts = db['posts'] posts.find_one({“author”: “Lorraine”})
  • 33. Enjoy a Wealth of Query Options from pymongo import Connection connection = Connection() db = connection['blog'] posts = db['posts'] posts.find({“author”: “Lorraine”}).limit(5)
  • 34. Enjoy a Wealth of Query Options from pymongo import Connection connection = Connection() db = connection['blog'] posts = db['posts'] posts.find({“author”: /^Lor/})
  • 35. Enjoy a Wealth of Query Options from pymongo import Connection connection = Connection() db = connection['blog'] posts = db['posts'] posts.find({“author”: {$not: “Lorraine”} })
  • 36. Enjoy a Massive Performance Jump • Mileage will vary, but 10x is not uncommon • For reads and writes • Writes happen at near disk native speed • Logging to MongoDB is perfectly acceptable • Reads for active data near Memcached speeds
  • 37. Enjoy a Massive Performance Jump Ability to write bad queries is enormously reduced!
  • 38. Ability to write bad queries is enormously reduced! • No joins means need for complex indexes reduced • Chances of index / query mismatches vastly lower • Disk I/O much less complex, and therefore much faster
  • 39. Caveats for MongoDB • Really should use 64bit machines for production • 32bit has 2G limit per collection (table) • Happiest with lots of RAM relative to active data • Under heavy development • Features / drivers / docs changing rapidly