SlideShare a Scribd company logo
1 of 45
BATTLE OF THE
 NO-SQL STARS
CouchDB, MongoDB, Amazon SDB, RavenDB
WHO IS THIS GUY?

Jesse Wolgamott

(Nobody, Really)

Team Merrica Lead Developer

ChaiOne, Houston

http://jessewolgamott.com
OUR STARS


CouchDB: Apache Project, Circa 2007‘ish

MongoDB: 10Gen, Circa 2009

SimpleDB: Amazon, Circa 2007

RavenDB: Ayenda, Circa 2010
EVIL
NUGGET
EVIL
  NUGGET
Document Databases share an
  internal structure similar
       (inspired?) by:
       Lotus Notes.
         (shudder)
BATTLE
    PLAN
    Languages and API
        Versioning
Internal Queries and Inserts
        Intangibles
THE COOL KID
APIS

CouchDB: Erlang, REST
API

MongoDB: C++, Language
Driver

RavenDB: .NET, REST API

SimpleDB: Erlang, Name/
Value Store
API: COUCHDB
POST /somedatabase/ HTTP/1.0
Content-Length: 245
Content-Type: application/json

{
    "Subject":"I like Plankton",
    "Author":"Rusty",
    "PostedDate":"2006-08-15T17:30:12-04:00",
    "Tags":["plankton", "baseball", "decisions"],
    "Body":"I decided today that I don't like baseball. I like plankton."
}
-----------------
GET /somedatabase/some_doc_id HTTP/1.0
-------------------
HTTP/1.1 200 OK
Date: Thu, 17 Aug 2006 05:39:28 +0000GMT
Content-Type: application/json
Connection: close

{
 "_id":"some_doc_id",
 "_rev":"946B7D1C",
 "Subject":"I like Plankton",
 "Author":"Rusty",
 "PostedDate":"2006-08-15T17:30:12Z-04:00",
 "Tags":["plankton", "baseball", "decisions"],
 "Body":"I decided today that I don't like baseball. I like plankton."
}
API: COUCHPOTATO
class User
  include CouchPotato::Persistence

  property :age, :type => Fixnum
  property :receive_newsletter, :type => :boolean
end

CouchPotato.database.save_document User.new
API: MONGODB
   Mongoid                                MongoMapper

class Person                           class Person


 include Mongoid::Document              include MongoMapper::Document

 field :name                            key :name, String, :required=>true

 embeds_many :phones                    many :phones

 references_many :addresses             has_many :addresses

end                                    end

Person.create {:name=>”Darth Vader”}   Person.create {:name=>”Darth Vader”}
MM V GOID
Mongoid uses ActiveModel   Mongoid uses ARel, MM:
(Rails3).                  custom DSL

MongoMapper is more like   Mongoid has Master/Slave
Rails 2 with Validatable
                           MM is more familiar for
MongoMapper has better     Active Record
relational association
support
API: RAVENDB
PUT http://localhost:8080/docs/bobs_address
 {
   FirstName: 'Bob',
   LastName: 'Smith',
   Address: '5 Elm St'
 }
---------------
GET http://localhost:8080/docs/bobs_address
---------------
HTTP/1.1 200 OK

{
    "FirstName": "Bob",
    "LastName": "Smith",
    "Address": "5 Elm St."
}


var companies = session.Query<Company>("CompaniesByRegion")
       .Where(x => x.Region == "Asia")
       .Take(5);
API: SIMPLEDB
 Amazon’s Restful... This is rest?

 Answer: No (IMHO). And returns XML
https://sdb.amazonaws.com/?Action=PutAttributes
&DomainName=MyDomain
&ItemName=Item123
&Attribute.1.Name=Color&Attribute.1.Value=Blue
&Attribute.2.Name=Size&Attribute.2.Value=Med
&Attribute.3.Name=Price&Attribute.3.Value=0014.99
&AWSAccessKeyId=<valid_access_key>
&Version=2007-11-07
&Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQE=
&SignatureVersion=2
&SignatureMethod=HmacSHA256
&Timestamp=2007-06-25T15%3A01%3A28-07%3A00
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
VERSIONING
 Do we rea!y have it?
VERSIONING

CouchDB has Multi Versioning Concurrency Control

  Compaction removes old revs, only the latest rev is represented in view queries, and only the latest revision is
  replicated.


  you can only depending on having a single version of the document available.


  Especially in Multi-Master



Mongoid::Versioning (has_many versions)

RavenDB - Versioning Built In
VERSIONING
CouchDB and                                 Mongoid
Mongomapper                                 class Person
                                             include Mongoid::Document
   Roll your Own
                                             include Mongoid::Versioning

   Using many versions as embedded           # keep at most 5 versions of a record
   documents                                 max_versions 5
                                            end
RavenDB
<appSettings>
 <add key="Raven/Versioning/MaxRevisions"
  value="50"/>
 <add key="Raven/Versioning/Exclude"
  value="Comments;LogEntries;"/>
</appSettings>
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
QUERIES
Gimme Gimme Gimme
QUERIES: COUCH
    Map/Reduce .. Design Documents
        Cool Part: Fast!
        The NotHot: Pre-declaring all your views

{
    "_id":"_design/company",
    "_rev":"12345",
    "language": "javascript",
    "views":
    {
      "all": {
         "map": "function(doc) { if (doc.Type == 'customer') emit(null, doc) }"
      },
      "by_lastname": {
         "map": "function(doc) { if (doc.Type == 'customer') emit(doc.LastName, doc) }"
      },
      "total_purchases": {
         "map": "function(doc) { if (doc.Type == 'purchase') emit(doc.Customer, doc.Amount) }",
         "reduce": "function(keys, values) { return sum(values) }"
      }
    }
}
QUERY: MONGODB


Dynamic Querying

Map-Reduce (BUT: non-concurrent)

MongoMapper Example

  Event.where(:school_id=>school.id).published.future.sort(:start.desc).limit(20).all
QUERY: SIMPLEDB

No sorting options

Obvious comparison operators (=, !=,<=, etc.)

RightAWS Interface

require 'right_aws'


sdb = RightAws::SdbInterface.new(aws_access_key, aws_secret_access_key)


sdb.query("picture", "['submitdate' <= '2900'] intersection ['status' = 'approved'] sort 'submitdate'")


#parse XML returned
QUERY: RAVENDB

MapReduce Indexes

Raven process them in the background, executing the
queries against the stored documents and persisting the
results to a Lucene index

Raven executes your indexes in the background, and the
results are written to disk.

Indexes are written in LINQ
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
INSERTING
  Here take this
INSERTS: COUCH


Couch DB PUT API is cool.

BUT

Recalculates the map-reduce on the insertion

Slows down over time
INSERTS: MONGO


Updates in Place

FAST, BUT

In Air Collisions

Power Turns Off before disk write
INSERTS: BENCHMARK
 Bulk Insertion Benchmark
 Data: http://www.snailinaturtleneck.com/blog/2009/06/29/couchdb-vs-mongodb-benchmark/


 y-axis: seconds

                                                     MongoDB              CouchDB
40

30

20

10

0
     1     10      50     100      500    1000     2500    7500 10000 25000 100000
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
EXTRAS
MongoDBs - Best Ruby         CouchDB: Multi-Multi
Integration                  Master (Success!)

SimpleDB: Easy Scalability   CouchDB: Offline
                             Replication
RavenDB: Windows
(Downer)                     CouchDB and MongoDB:
                             Free Levels on Heroku
RavenDB: Commercial          (Crazy Success)
License for non-Open
Source (Downer-er)
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
SCOREBOARD

        API   Versions Queries   Inserts   Extras

Couch

Mongo

SDB

Raven
LITTLE BIT OF CODE


MLB 2000-2009 Game Data used in Demo

The information used here was obtained free of charge from and is copyrighted by Retrosheet.
Interested parties may contact Retrosheet at "www.retrosheet.org".



Load Time Experience - 24000‘ish Games

                                                      Load Time in Seconds
                   Mongo                                        77.6 seconds
                   Couch                                       355.1 seconds

More Related Content

What's hot

Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)ngotogenome
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGuillaume Laforge
 
PyGrunn 2017 - Django Performance Unchained - slides
PyGrunn 2017 - Django Performance Unchained - slidesPyGrunn 2017 - Django Performance Unchained - slides
PyGrunn 2017 - Django Performance Unchained - slidesArtur Barseghyan
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Shaer Hassan
 
O que há de novo no Rails 3
O que há de novo no Rails 3O que há de novo no Rails 3
O que há de novo no Rails 3Hugo Baraúna
 
Games for the Masses (Jax)
Games for the Masses (Jax)Games for the Masses (Jax)
Games for the Masses (Jax)Wooga
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Mark Menard
 
Compiled Websites with Plone, Django, Xapian and SSI
Compiled Websites with Plone, Django, Xapian and SSICompiled Websites with Plone, Django, Xapian and SSI
Compiled Websites with Plone, Django, Xapian and SSIWojciech Lichota
 
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...Alexandre Brandão Lustosa
 
A python web service
A python web serviceA python web service
A python web serviceTemian Vlad
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSource Conference
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Michael Pirnat
 
4Developers 2018: Structured logging (Bartek Szurgot)
4Developers 2018: Structured logging (Bartek Szurgot)4Developers 2018: Structured logging (Bartek Szurgot)
4Developers 2018: Structured logging (Bartek Szurgot)PROIDEA
 
Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentationeraz
 
Introducing RaveJS: Spring Boot concepts for JavaScript applications
Introducing RaveJS: Spring Boot concepts for JavaScript applicationsIntroducing RaveJS: Spring Boot concepts for JavaScript applications
Introducing RaveJS: Spring Boot concepts for JavaScript applicationsJohn Hann
 
AMD - Why, What and How
AMD - Why, What and HowAMD - Why, What and How
AMD - Why, What and HowMike Wilcox
 

What's hot (20)

Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
 
You suck at Memory Analysis
You suck at Memory AnalysisYou suck at Memory Analysis
You suck at Memory Analysis
 
PyGrunn 2017 - Django Performance Unchained - slides
PyGrunn 2017 - Django Performance Unchained - slidesPyGrunn 2017 - Django Performance Unchained - slides
PyGrunn 2017 - Django Performance Unchained - slides
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
 
O que há de novo no Rails 3
O que há de novo no Rails 3O que há de novo no Rails 3
O que há de novo no Rails 3
 
Games for the Masses (Jax)
Games for the Masses (Jax)Games for the Masses (Jax)
Games for the Masses (Jax)
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
 
Compiled Websites with Plone, Django, Xapian and SSI
Compiled Websites with Plone, Django, Xapian and SSICompiled Websites with Plone, Django, Xapian and SSI
Compiled Websites with Plone, Django, Xapian and SSI
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
 
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
 
A python web service
A python web serviceA python web service
A python web service
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on Rails
 
Debugging on rails
Debugging on railsDebugging on rails
Debugging on rails
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
 
4Developers 2018: Structured logging (Bartek Szurgot)
4Developers 2018: Structured logging (Bartek Szurgot)4Developers 2018: Structured logging (Bartek Szurgot)
4Developers 2018: Structured logging (Bartek Szurgot)
 
Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentation
 
Introducing RaveJS: Spring Boot concepts for JavaScript applications
Introducing RaveJS: Spring Boot concepts for JavaScript applicationsIntroducing RaveJS: Spring Boot concepts for JavaScript applications
Introducing RaveJS: Spring Boot concepts for JavaScript applications
 
AMD - Why, What and How
AMD - Why, What and HowAMD - Why, What and How
AMD - Why, What and How
 

Similar to Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB

Ibm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopShubhra Kar
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopJimmy Guerrero
 
Continuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWSContinuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWSDanilo Poccia
 
FOXX - a Javascript application framework on top of ArangoDB
FOXX - a Javascript application framework on top of ArangoDBFOXX - a Javascript application framework on top of ArangoDB
FOXX - a Javascript application framework on top of ArangoDBArangoDB Database
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsMongoDB
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsMongoDB
 
MongoDB and Ruby on Rails
MongoDB and Ruby on RailsMongoDB and Ruby on Rails
MongoDB and Ruby on Railsrfischer20
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaKévin Margueritte
 
Rapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and PythonRapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and PythonRick Copeland
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introductionTse-Ching Ho
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLsintelliyole
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1Mohammad Qureshi
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyNick Sieger
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkTroy Miles
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011Nick Sieger
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developergicappa
 

Similar to Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB (20)

Ibm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshop
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
 
Continuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWSContinuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWS
 
MongoDB and Node.js
MongoDB and Node.jsMongoDB and Node.js
MongoDB and Node.js
 
FOXX - a Javascript application framework on top of ArangoDB
FOXX - a Javascript application framework on top of ArangoDBFOXX - a Javascript application framework on top of ArangoDB
FOXX - a Javascript application framework on top of ArangoDB
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.js
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.js
 
MongoDB and Ruby on Rails
MongoDB and Ruby on RailsMongoDB and Ruby on Rails
MongoDB and Ruby on Rails
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
Play framework
Play frameworkPlay framework
Play framework
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
 
Rapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and PythonRapid, Scalable Web Development with MongoDB, Ming, and Python
Rapid, Scalable Web Development with MongoDB, Ming, and Python
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introduction
 
Wider than rails
Wider than railsWider than rails
Wider than rails
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 

Recently uploaded

AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 

Recently uploaded (20)

AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 

Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB

  • 1. BATTLE OF THE NO-SQL STARS CouchDB, MongoDB, Amazon SDB, RavenDB
  • 2. WHO IS THIS GUY? Jesse Wolgamott (Nobody, Really) Team Merrica Lead Developer ChaiOne, Houston http://jessewolgamott.com
  • 3. OUR STARS CouchDB: Apache Project, Circa 2007‘ish MongoDB: 10Gen, Circa 2009 SimpleDB: Amazon, Circa 2007 RavenDB: Ayenda, Circa 2010
  • 5. EVIL NUGGET Document Databases share an internal structure similar (inspired?) by: Lotus Notes. (shudder)
  • 6. BATTLE PLAN Languages and API Versioning Internal Queries and Inserts Intangibles
  • 8. APIS CouchDB: Erlang, REST API MongoDB: C++, Language Driver RavenDB: .NET, REST API SimpleDB: Erlang, Name/ Value Store
  • 9. API: COUCHDB POST /somedatabase/ HTTP/1.0 Content-Length: 245 Content-Type: application/json { "Subject":"I like Plankton", "Author":"Rusty", "PostedDate":"2006-08-15T17:30:12-04:00", "Tags":["plankton", "baseball", "decisions"], "Body":"I decided today that I don't like baseball. I like plankton." } ----------------- GET /somedatabase/some_doc_id HTTP/1.0 ------------------- HTTP/1.1 200 OK Date: Thu, 17 Aug 2006 05:39:28 +0000GMT Content-Type: application/json Connection: close { "_id":"some_doc_id", "_rev":"946B7D1C", "Subject":"I like Plankton", "Author":"Rusty", "PostedDate":"2006-08-15T17:30:12Z-04:00", "Tags":["plankton", "baseball", "decisions"], "Body":"I decided today that I don't like baseball. I like plankton." }
  • 10. API: COUCHPOTATO class User include CouchPotato::Persistence property :age, :type => Fixnum property :receive_newsletter, :type => :boolean end CouchPotato.database.save_document User.new
  • 11. API: MONGODB Mongoid MongoMapper class Person class Person include Mongoid::Document include MongoMapper::Document field :name key :name, String, :required=>true embeds_many :phones many :phones references_many :addresses has_many :addresses end end Person.create {:name=>”Darth Vader”} Person.create {:name=>”Darth Vader”}
  • 12. MM V GOID Mongoid uses ActiveModel Mongoid uses ARel, MM: (Rails3). custom DSL MongoMapper is more like Mongoid has Master/Slave Rails 2 with Validatable MM is more familiar for MongoMapper has better Active Record relational association support
  • 13. API: RAVENDB PUT http://localhost:8080/docs/bobs_address { FirstName: 'Bob', LastName: 'Smith', Address: '5 Elm St' } --------------- GET http://localhost:8080/docs/bobs_address --------------- HTTP/1.1 200 OK { "FirstName": "Bob", "LastName": "Smith", "Address": "5 Elm St." } var companies = session.Query<Company>("CompaniesByRegion") .Where(x => x.Region == "Asia") .Take(5);
  • 14. API: SIMPLEDB Amazon’s Restful... This is rest? Answer: No (IMHO). And returns XML https://sdb.amazonaws.com/?Action=PutAttributes &DomainName=MyDomain &ItemName=Item123 &Attribute.1.Name=Color&Attribute.1.Value=Blue &Attribute.2.Name=Size&Attribute.2.Value=Med &Attribute.3.Name=Price&Attribute.3.Value=0014.99 &AWSAccessKeyId=<valid_access_key> &Version=2007-11-07 &Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQE= &SignatureVersion=2 &SignatureMethod=HmacSHA256 &Timestamp=2007-06-25T15%3A01%3A28-07%3A00
  • 15. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 16. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 17. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 18. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 19. VERSIONING Do we rea!y have it?
  • 20. VERSIONING CouchDB has Multi Versioning Concurrency Control Compaction removes old revs, only the latest rev is represented in view queries, and only the latest revision is replicated. you can only depending on having a single version of the document available. Especially in Multi-Master Mongoid::Versioning (has_many versions) RavenDB - Versioning Built In
  • 21. VERSIONING CouchDB and Mongoid Mongomapper class Person include Mongoid::Document Roll your Own include Mongoid::Versioning Using many versions as embedded # keep at most 5 versions of a record documents max_versions 5 end RavenDB <appSettings> <add key="Raven/Versioning/MaxRevisions" value="50"/> <add key="Raven/Versioning/Exclude" value="Comments;LogEntries;"/> </appSettings>
  • 22. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 23. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 25. QUERIES: COUCH Map/Reduce .. Design Documents Cool Part: Fast! The NotHot: Pre-declaring all your views { "_id":"_design/company", "_rev":"12345", "language": "javascript", "views": { "all": { "map": "function(doc) { if (doc.Type == 'customer') emit(null, doc) }" }, "by_lastname": { "map": "function(doc) { if (doc.Type == 'customer') emit(doc.LastName, doc) }" }, "total_purchases": { "map": "function(doc) { if (doc.Type == 'purchase') emit(doc.Customer, doc.Amount) }", "reduce": "function(keys, values) { return sum(values) }" } } }
  • 26. QUERY: MONGODB Dynamic Querying Map-Reduce (BUT: non-concurrent) MongoMapper Example Event.where(:school_id=>school.id).published.future.sort(:start.desc).limit(20).all
  • 27. QUERY: SIMPLEDB No sorting options Obvious comparison operators (=, !=,<=, etc.) RightAWS Interface require 'right_aws' sdb = RightAws::SdbInterface.new(aws_access_key, aws_secret_access_key) sdb.query("picture", "['submitdate' <= '2900'] intersection ['status' = 'approved'] sort 'submitdate'") #parse XML returned
  • 28. QUERY: RAVENDB MapReduce Indexes Raven process them in the background, executing the queries against the stored documents and persisting the results to a Lucene index Raven executes your indexes in the background, and the results are written to disk. Indexes are written in LINQ
  • 29. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 30. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 31. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 32. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 33. INSERTING Here take this
  • 34. INSERTS: COUCH Couch DB PUT API is cool. BUT Recalculates the map-reduce on the insertion Slows down over time
  • 35. INSERTS: MONGO Updates in Place FAST, BUT In Air Collisions Power Turns Off before disk write
  • 36. INSERTS: BENCHMARK Bulk Insertion Benchmark Data: http://www.snailinaturtleneck.com/blog/2009/06/29/couchdb-vs-mongodb-benchmark/ y-axis: seconds MongoDB CouchDB 40 30 20 10 0 1 10 50 100 500 1000 2500 7500 10000 25000 100000
  • 37. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 38. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 39. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 40. EXTRAS MongoDBs - Best Ruby CouchDB: Multi-Multi Integration Master (Success!) SimpleDB: Easy Scalability CouchDB: Offline Replication RavenDB: Windows (Downer) CouchDB and MongoDB: Free Levels on Heroku RavenDB: Commercial (Crazy Success) License for non-Open Source (Downer-er)
  • 41. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 42. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 43. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 44. SCOREBOARD API Versions Queries Inserts Extras Couch Mongo SDB Raven
  • 45. LITTLE BIT OF CODE MLB 2000-2009 Game Data used in Demo The information used here was obtained free of charge from and is copyrighted by Retrosheet. Interested parties may contact Retrosheet at "www.retrosheet.org". Load Time Experience - 24000‘ish Games Load Time in Seconds Mongo 77.6 seconds Couch 355.1 seconds

Editor's Notes