SlideShare a Scribd company logo
1 of 53
An introduction to #CouchDB
        Sit back and relax




    @davidcoallier, University Limerick 2010
WTF IS COUCH?
- Highly concurrent database server
- Schema free, document based database
- RESTFul API
- Map/Reduce Views generation
- EASY replication (like... really)
... AGAIN.. WTF?!
HISTORY CLASS TIME!
32 CouchDB servers
                                            2 datacenters
                                   SSL based user auth, sharding, etc.




This is the only BBC transparent logo I found and it’s not BBC World News using CouchDB but BBC.
           See: http://www.erlang-factory.com/conference/London2009/speakers/endafarrell
Ubuntu One
mozilla.org
       IBM
      Apple
  myspace.com
      ebay
     meebo
oh so many more.
DOCUMENT BASED
KEY/VALUE STORE...
key       value
  name       david
  email    e@e.com
 phones      Array
createdAt timetsamp
DOCUMENT BASED WHAT?
- Dictionary of data
- JSON Objects
- A doc can have attachments
- Auto generated IDs (CLAP NOW)
- Revisions (THAT’S RIGHT..)
DOCUMENT

{
    "_id": "3fc3b3bf3c101e15fa7d08e2ecf9c900",
    "_rev": "1-34c5c7adcf1fdb8898498d1e6b64ebdd",
    "firstname": "David",
    "email": "david@echolibre.com"
}
DOCUMENT
{
    "_id": "3fc3b3bf3c101e15fa7d08e2ecf9c900",
    "_rev": "1-34c5c7adcf1fdb8898498d1e6b64ebdd",
    "firstname": "David",
    "email": "david@echolibre.com",
    "phones": {
        "mobile": "086x209x69",
        "home": "none"
    },
    "createdAt": "2009-09-16T22:12:43Z"
}
key       value
  name       david
  email    e@e.com
 phones      Array
createdAt timetsamp
WHAT ABOUT MY CRUD?

   - Create     PUT /db/docid
   - Retrieve   GET /db/docid
   - Update     POST /db/docid
   - Delete     DELETE /db/docid
VIEWS

- Persistent representation of docs
- Prod is solid. No _temp shit.
- Javascript, Erlang, Python, wtf ever.
MAP/REDUCE ...
JAVASCRIPT
MAP

map: function(doc) {
    if (doc.firstname) {
        emit(doc.firstname, doc);
    }
}
MAP
%% Map Function
fun({Doc}) ->
     case {proplists:get_value(<<"firstname">>, Doc)} of
    {undefined} ->
          false;
    {Name} ->
          Emit(Name, Doc);
     _ ->
          ok
     end
end.
fun({Doc}) ->
    Emitter = fun(Doc) ->
        Name = proplists:get_value(<<"name">>, Doc, null),

              Emit(Name, Doc)
       end,

       HasRequiredFields = fun(Doc) ->
            case {proplists:is_defined(<<"firstname">>, Doc)} of
                {true} ->
                    Emitter(Doc);
                _->
                    false
            end
       end,

       HasRequiredFields(Doc)
end.
MAP/REDUCE EXAMPLE
MAP
{
    "_id": "3fc3b3bf3c101e15fa7d08e2ecf9c900",
    "_rev": "1-34c5c7adcf1fdb8898498d1e6b64ebdd",
    "firstname": "David",
    "email": "david@echolibre.com",
    "phones": {
        "mobile": "086x209x69",
        "home": "none"
    },
    "createdAt": "2009-09-16T22:12:43Z",
    "tags": ["cool", "php", "couchdb", "skynet"]
}
MAP

map: function(doc) {
    if (doc.tags && docs.tags.length > 0) {
        for (var i = 0; i < doc.tags.length; i++) {
            emit(doc.tags[i], 1);
        }
    }
}
REDUCE
map: function(doc) {
    if (doc.tags && docs.tags.length > 0) {
        for (var i = 0; i < doc.tags.length; i++) {
            emit(doc.tags[i], 1);
        }
    }
},

reduce: function(tag, counts) {
    int sum = 0;
    for(var i = 0; i < counts.length; i++) {
        sum += counts[i];
    }
    return sum;
}
REDUCE

function(tag, counts) {
    int sum = 0;
    for(var i = 0; i < counts.length; i++) {
        sum += counts[i];
    }
    return sum;
}
REDUCE
{
    "total_rows":4,
    "rows":[
        { "key":"cool",
          "value":1},

        { "key":"php",
          "value":1},

        { "key":"couchdb",
          "value":1},

        { "key":"skynet",
          "value":1},
    ]
}
REDUCE TRICKS
map: function(doc) {
    if (doc.tags && docs.tags.length > 0) {
        for (var i = 0; i < doc.tags.length; i++) {
            emit(doc.tags[i], 1);
        }
    }
}


reduce: "_count"
REDUCE
{
    "total_rows":4,
    "rows":[
        { "key":"cool",
          "value":1},

        { "key":"php",
          "value":1},

        { "key":"couchdb",
          "value":1},

        { "key":"skynet",
          "value":1},
    ]
}
REDUCE
map: function(doc) {
    if (doc.tags && docs.tags.length > 0) {
        for (var i = 0; i < doc.tags.length; i++) {
            emit(doc.tags[i], "yer ma");
        }
    }
},

reduce: function (tag, count) {
    return sum(tag);
}
THEN...
BEWARE OF REDUCE VALUES
REPLICATION


  It fuckin’ rules.
REPLICATION

      Easy (See later futon ;-))
        Continuous... or not :P
        Replicates your views
Replicate only what you need (filter?)
REPLICATION
                   curl -X POST http://localhost:5984/_replicate 
'{"source":"/dbname", "target": "http://localhost:5555/otherdb", "continuous": true}'
REPLICATION
Source              The boss               Target

         changes?              watcha
                               need??
      target
    needs x, y, z              save them
REPLICATION
MASTER / SLAVES
REPLICATION
MASTER / SLAVES
REPLICATION
MULTI MASTER
REPLICATION
MULTI MASTER
REPLICATION
  USE CASE



    Automated job
to validate and test data
 and do bunch of shits
FUTON
FUTON
NOTE TO SELF.


   Show them.




                Open up CouchDBX
COOL THINGS
         Authorization
        CouchDB Lucene
            Lounge
          CouchDBX
           Couchio
           Cloudant

A bunch of random bits and pieces
COMPLETE SHITE COMING UP


                                                      eas
                                               r e id
                                            sha
                                        W
                                  le! NO
                                 p
                           s peo
                       cus
                   Dis
CONCEPTS AND IDEAS


      Graph Theory




                                                        ...
                                                  ss ion
                                               u
                                         a disc
                                     t
                              d star
                     tr   y an
CONCEPTS AND IDEAS


     Ghost Replication




                                                            ...
                                                      ss ion
                                                   u
                                             a disc
                                         t
                                  d star
                         tr   y an
CONCEPTS AND IDEAS


   Shared Index Replication




                                                                 ...
                                                           ss ion
                                                        u
                                                  a disc
                                              t
                                       d star
                              tr   y an
QUESTIONS?
ME! MEEE!!!


   @davidcoallier
david@echolibre.com
THANKS
LINKS

- https://nosqleast.com/2009/slides/miller-couchdb.pdf
- http://couch.io
- http://cloudant.com
- http://wiki.apache.org/couchdb/CouchDB_in_the_wild
- irc://couchdb@freenode.net (Bug jan___ ;-))

More Related Content

What's hot

Dealing with Azure Cosmos DB
Dealing with Azure Cosmos DBDealing with Azure Cosmos DB
Dealing with Azure Cosmos DBMihail Mateev
 
Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMJonathan Wage
 
Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012Stefan Kögl
 
Benefits of Using MongoDB Over RDBMS (At An Evening with MongoDB Minneapolis ...
Benefits of Using MongoDB Over RDBMS (At An Evening with MongoDB Minneapolis ...Benefits of Using MongoDB Over RDBMS (At An Evening with MongoDB Minneapolis ...
Benefits of Using MongoDB Over RDBMS (At An Evening with MongoDB Minneapolis ...MongoDB
 
Drupal8 migrate
Drupal8 migrateDrupal8 migrate
Drupal8 migrateJohn Doyle
 
Webinar: Building Your First App with MongoDB and Java
Webinar: Building Your First App with MongoDB and JavaWebinar: Building Your First App with MongoDB and Java
Webinar: Building Your First App with MongoDB and JavaMongoDB
 
Render Caching for Drupal 8
Render Caching for Drupal 8Render Caching for Drupal 8
Render Caching for Drupal 8John Doyle
 
Kicking ass with redis
Kicking ass with redisKicking ass with redis
Kicking ass with redisDvir Volk
 
10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators  10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators iammutex
 
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB
 
Nko workshop - node js & nosql
Nko workshop - node js & nosqlNko workshop - node js & nosql
Nko workshop - node js & nosqlSimon Su
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance TuningMongoDB
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introductionTse-Ching Ho
 
All Things Open 2016 -- Database Programming for Newbies
All Things Open 2016 -- Database Programming for NewbiesAll Things Open 2016 -- Database Programming for Newbies
All Things Open 2016 -- Database Programming for NewbiesDave Stokes
 

What's hot (18)

Dealing with Azure Cosmos DB
Dealing with Azure Cosmos DBDealing with Azure Cosmos DB
Dealing with Azure Cosmos DB
 
Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODM
 
Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012
 
Mongo db queries
Mongo db queriesMongo db queries
Mongo db queries
 
Doctrine for NoSQL
Doctrine for NoSQLDoctrine for NoSQL
Doctrine for NoSQL
 
Doctrine and NoSQL
Doctrine and NoSQLDoctrine and NoSQL
Doctrine and NoSQL
 
Benefits of Using MongoDB Over RDBMS (At An Evening with MongoDB Minneapolis ...
Benefits of Using MongoDB Over RDBMS (At An Evening with MongoDB Minneapolis ...Benefits of Using MongoDB Over RDBMS (At An Evening with MongoDB Minneapolis ...
Benefits of Using MongoDB Over RDBMS (At An Evening with MongoDB Minneapolis ...
 
Drupal8 migrate
Drupal8 migrateDrupal8 migrate
Drupal8 migrate
 
Webinar: Building Your First App with MongoDB and Java
Webinar: Building Your First App with MongoDB and JavaWebinar: Building Your First App with MongoDB and Java
Webinar: Building Your First App with MongoDB and Java
 
Render Caching for Drupal 8
Render Caching for Drupal 8Render Caching for Drupal 8
Render Caching for Drupal 8
 
Kicking ass with redis
Kicking ass with redisKicking ass with redis
Kicking ass with redis
 
10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators  10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators
 
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
 
MongoDB-SESSION03
MongoDB-SESSION03MongoDB-SESSION03
MongoDB-SESSION03
 
Nko workshop - node js & nosql
Nko workshop - node js & nosqlNko workshop - node js & nosql
Nko workshop - node js & nosql
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance Tuning
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introduction
 
All Things Open 2016 -- Database Programming for Newbies
All Things Open 2016 -- Database Programming for NewbiesAll Things Open 2016 -- Database Programming for Newbies
All Things Open 2016 -- Database Programming for Newbies
 

Viewers also liked

CouchApps: Requiem for Accidental Complexity
CouchApps: Requiem for Accidental ComplexityCouchApps: Requiem for Accidental Complexity
CouchApps: Requiem for Accidental ComplexityFederico Galassi
 
ZendCon 2011 Learning CouchDB
ZendCon 2011 Learning CouchDBZendCon 2011 Learning CouchDB
ZendCon 2011 Learning CouchDBBradley Holt
 
CouchDB at its Core: Global Data Storage and Rich Incremental Indexing at Clo...
CouchDB at its Core: Global Data Storage and Rich Incremental Indexing at Clo...CouchDB at its Core: Global Data Storage and Rich Incremental Indexing at Clo...
CouchDB at its Core: Global Data Storage and Rich Incremental Indexing at Clo...StampedeCon
 
Migrating to CouchDB
Migrating to CouchDBMigrating to CouchDB
Migrating to CouchDBJohn Wood
 
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
CouchDB Day NYC 2017: Introduction to CouchDB 2.0CouchDB Day NYC 2017: Introduction to CouchDB 2.0
CouchDB Day NYC 2017: Introduction to CouchDB 2.0IBM Cloud Data Services
 
Couch Db In 60 Minutes
Couch Db In 60 MinutesCouch Db In 60 Minutes
Couch Db In 60 MinutesGeorge Ang
 
CouchDB at New York PHP
CouchDB at New York PHPCouchDB at New York PHP
CouchDB at New York PHPBradley Holt
 
Couch db@nosql+taiwan
Couch db@nosql+taiwanCouch db@nosql+taiwan
Couch db@nosql+taiwanKenzou Yeh
 
CouchDB – A Database for the Web
CouchDB – A Database for the WebCouchDB – A Database for the Web
CouchDB – A Database for the WebKarel Minarik
 
Real World CouchDB
Real World CouchDBReal World CouchDB
Real World CouchDBJohn Wood
 
広島アニメ関連イベントカレンダー(仮)はじめました
広島アニメ関連イベントカレンダー(仮)はじめました広島アニメ関連イベントカレンダー(仮)はじめました
広島アニメ関連イベントカレンダー(仮)はじめましたYoshitake Takata
 

Viewers also liked (20)

CouchDB Vs MongoDB
CouchDB Vs MongoDBCouchDB Vs MongoDB
CouchDB Vs MongoDB
 
Apache CouchDB
Apache CouchDBApache CouchDB
Apache CouchDB
 
Couch db
Couch dbCouch db
Couch db
 
CouchApps: Requiem for Accidental Complexity
CouchApps: Requiem for Accidental ComplexityCouchApps: Requiem for Accidental Complexity
CouchApps: Requiem for Accidental Complexity
 
CouchDB
CouchDBCouchDB
CouchDB
 
CouchDB
CouchDBCouchDB
CouchDB
 
Conhecendo o CouchDB
Conhecendo o CouchDBConhecendo o CouchDB
Conhecendo o CouchDB
 
Curso AngularJS - Parte 2
Curso AngularJS - Parte 2Curso AngularJS - Parte 2
Curso AngularJS - Parte 2
 
ZendCon 2011 Learning CouchDB
ZendCon 2011 Learning CouchDBZendCon 2011 Learning CouchDB
ZendCon 2011 Learning CouchDB
 
CouchDB at its Core: Global Data Storage and Rich Incremental Indexing at Clo...
CouchDB at its Core: Global Data Storage and Rich Incremental Indexing at Clo...CouchDB at its Core: Global Data Storage and Rich Incremental Indexing at Clo...
CouchDB at its Core: Global Data Storage and Rich Incremental Indexing at Clo...
 
Migrating to CouchDB
Migrating to CouchDBMigrating to CouchDB
Migrating to CouchDB
 
CouchDB-Lucene
CouchDB-LuceneCouchDB-Lucene
CouchDB-Lucene
 
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
CouchDB Day NYC 2017: Introduction to CouchDB 2.0CouchDB Day NYC 2017: Introduction to CouchDB 2.0
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
 
Couch Db In 60 Minutes
Couch Db In 60 MinutesCouch Db In 60 Minutes
Couch Db In 60 Minutes
 
CouchDB at New York PHP
CouchDB at New York PHPCouchDB at New York PHP
CouchDB at New York PHP
 
Couch db@nosql+taiwan
Couch db@nosql+taiwanCouch db@nosql+taiwan
Couch db@nosql+taiwan
 
CouchDB – A Database for the Web
CouchDB – A Database for the WebCouchDB – A Database for the Web
CouchDB – A Database for the Web
 
Couch db
Couch dbCouch db
Couch db
 
Real World CouchDB
Real World CouchDBReal World CouchDB
Real World CouchDB
 
広島アニメ関連イベントカレンダー(仮)はじめました
広島アニメ関連イベントカレンダー(仮)はじめました広島アニメ関連イベントカレンダー(仮)はじめました
広島アニメ関連イベントカレンダー(仮)はじめました
 

Similar to An introduction to CouchDB

Nosql hands on handout 04
Nosql hands on handout 04Nosql hands on handout 04
Nosql hands on handout 04Krishna Sankar
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourPeter Friese
 
Elixir - GDG - Nantes
Elixir - GDG - NantesElixir - GDG - Nantes
Elixir - GDG - NantesAxel CATELAND
 
NoSQL & MongoDB
NoSQL & MongoDBNoSQL & MongoDB
NoSQL & MongoDBShuai Liu
 
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)Johannes Hoppe
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018artgillespie
 
03 introduction to graph databases
03   introduction to graph databases03   introduction to graph databases
03 introduction to graph databasesNeo4j
 
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionDEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionFelipe Prado
 
Solving the Riddle of Search: Using Sphinx with Rails
Solving the Riddle of Search: Using Sphinx with RailsSolving the Riddle of Search: Using Sphinx with Rails
Solving the Riddle of Search: Using Sphinx with Railsfreelancing_god
 
Introduction to spark
Introduction to sparkIntroduction to spark
Introduction to sparkDuyhai Doan
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout source{d}
 
Gpu programming with java
Gpu programming with javaGpu programming with java
Gpu programming with javaGary Sieling
 
GOTO 2011 preso: 3x Hadoop
GOTO 2011 preso: 3x HadoopGOTO 2011 preso: 3x Hadoop
GOTO 2011 preso: 3x Hadoopfvanvollenhoven
 
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...MongoDB
 
Hadoop + Cassandra: Fast queries on data lakes, and wikipedia search tutorial.
Hadoop + Cassandra: Fast queries on data lakes, and  wikipedia search tutorial.Hadoop + Cassandra: Fast queries on data lakes, and  wikipedia search tutorial.
Hadoop + Cassandra: Fast queries on data lakes, and wikipedia search tutorial.Natalino Busa
 
Rust tutorial from Boston Meetup 2015-07-22
Rust tutorial from Boston Meetup 2015-07-22Rust tutorial from Boston Meetup 2015-07-22
Rust tutorial from Boston Meetup 2015-07-22nikomatsakis
 
Koalas: Making an Easy Transition from Pandas to Apache Spark
Koalas: Making an Easy Transition from Pandas to Apache SparkKoalas: Making an Easy Transition from Pandas to Apache Spark
Koalas: Making an Easy Transition from Pandas to Apache SparkDatabricks
 

Similar to An introduction to CouchDB (20)

ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
 
Nosql hands on handout 04
Nosql hands on handout 04Nosql hands on handout 04
Nosql hands on handout 04
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 Hour
 
Elixir - GDG - Nantes
Elixir - GDG - NantesElixir - GDG - Nantes
Elixir - GDG - Nantes
 
NoSQL & MongoDB
NoSQL & MongoDBNoSQL & MongoDB
NoSQL & MongoDB
 
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018
 
03 introduction to graph databases
03   introduction to graph databases03   introduction to graph databases
03 introduction to graph databases
 
Spark - Philly JUG
Spark  - Philly JUGSpark  - Philly JUG
Spark - Philly JUG
 
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionDEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
 
Solving the Riddle of Search: Using Sphinx with Rails
Solving the Riddle of Search: Using Sphinx with RailsSolving the Riddle of Search: Using Sphinx with Rails
Solving the Riddle of Search: Using Sphinx with Rails
 
Introduction to spark
Introduction to sparkIntroduction to spark
Introduction to spark
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout
 
Gpu programming with java
Gpu programming with javaGpu programming with java
Gpu programming with java
 
GOTO 2011 preso: 3x Hadoop
GOTO 2011 preso: 3x HadoopGOTO 2011 preso: 3x Hadoop
GOTO 2011 preso: 3x Hadoop
 
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
 
A bit about Scala
A bit about ScalaA bit about Scala
A bit about Scala
 
Hadoop + Cassandra: Fast queries on data lakes, and wikipedia search tutorial.
Hadoop + Cassandra: Fast queries on data lakes, and  wikipedia search tutorial.Hadoop + Cassandra: Fast queries on data lakes, and  wikipedia search tutorial.
Hadoop + Cassandra: Fast queries on data lakes, and wikipedia search tutorial.
 
Rust tutorial from Boston Meetup 2015-07-22
Rust tutorial from Boston Meetup 2015-07-22Rust tutorial from Boston Meetup 2015-07-22
Rust tutorial from Boston Meetup 2015-07-22
 
Koalas: Making an Easy Transition from Pandas to Apache Spark
Koalas: Making an Easy Transition from Pandas to Apache SparkKoalas: Making an Easy Transition from Pandas to Apache Spark
Koalas: Making an Easy Transition from Pandas to Apache Spark
 

More from David Coallier

Data Science at Scale @ barricade.io
Data Science at Scale @ barricade.ioData Science at Scale @ barricade.io
Data Science at Scale @ barricade.ioDavid Coallier
 
Data Science, what even?!
Data Science, what even?!Data Science, what even?!
Data Science, what even?!David Coallier
 
Data Science, what even...
Data Science, what even...Data Science, what even...
Data Science, what even...David Coallier
 
PRISM seed-stage Investor Deck
PRISM seed-stage Investor DeckPRISM seed-stage Investor Deck
PRISM seed-stage Investor DeckDavid Coallier
 
The Artful Business of Data Mining: Computational Statistics with Open Source...
The Artful Business of Data Mining: Computational Statistics with Open Source...The Artful Business of Data Mining: Computational Statistics with Open Source...
The Artful Business of Data Mining: Computational Statistics with Open Source...David Coallier
 
Taking PHP to the next level
Taking PHP to the next levelTaking PHP to the next level
Taking PHP to the next levelDavid Coallier
 
Mobile Cloud Architectures
Mobile Cloud ArchitecturesMobile Cloud Architectures
Mobile Cloud ArchitecturesDavid Coallier
 
Taking PHP To the next level
Taking PHP To the next levelTaking PHP To the next level
Taking PHP To the next levelDavid Coallier
 
Orchestra at EngineYard
Orchestra at EngineYardOrchestra at EngineYard
Orchestra at EngineYardDavid Coallier
 
The Orchestra Platform
The Orchestra PlatformThe Orchestra Platform
The Orchestra PlatformDavid Coallier
 
Building APIs with FRAPI
Building APIs with FRAPIBuilding APIs with FRAPI
Building APIs with FRAPIDavid Coallier
 
RESTful APIs and FRAPI
RESTful APIs and FRAPIRESTful APIs and FRAPI
RESTful APIs and FRAPIDavid Coallier
 
Open Source for the greater good
Open Source for the greater goodOpen Source for the greater good
Open Source for the greater goodDavid Coallier
 
PHP 5.3, a walkthrough
PHP 5.3, a walkthroughPHP 5.3, a walkthrough
PHP 5.3, a walkthroughDavid Coallier
 
RESTful APIs and FRAPI, a matter of minutes
RESTful APIs and FRAPI, a matter of minutesRESTful APIs and FRAPI, a matter of minutes
RESTful APIs and FRAPI, a matter of minutesDavid Coallier
 
Get ready for web3.0! Open up your app!
Get ready for web3.0! Open up your app!Get ready for web3.0! Open up your app!
Get ready for web3.0! Open up your app!David Coallier
 

More from David Coallier (17)

Data Science at Scale @ barricade.io
Data Science at Scale @ barricade.ioData Science at Scale @ barricade.io
Data Science at Scale @ barricade.io
 
Data Science, what even?!
Data Science, what even?!Data Science, what even?!
Data Science, what even?!
 
Data Science, what even...
Data Science, what even...Data Science, what even...
Data Science, what even...
 
PRISM seed-stage Investor Deck
PRISM seed-stage Investor DeckPRISM seed-stage Investor Deck
PRISM seed-stage Investor Deck
 
The Artful Business of Data Mining: Computational Statistics with Open Source...
The Artful Business of Data Mining: Computational Statistics with Open Source...The Artful Business of Data Mining: Computational Statistics with Open Source...
The Artful Business of Data Mining: Computational Statistics with Open Source...
 
Taking PHP to the next level
Taking PHP to the next levelTaking PHP to the next level
Taking PHP to the next level
 
Mobile Cloud Architectures
Mobile Cloud ArchitecturesMobile Cloud Architectures
Mobile Cloud Architectures
 
Taking PHP To the next level
Taking PHP To the next levelTaking PHP To the next level
Taking PHP To the next level
 
Orchestra at EngineYard
Orchestra at EngineYardOrchestra at EngineYard
Orchestra at EngineYard
 
The Orchestra Platform
The Orchestra PlatformThe Orchestra Platform
The Orchestra Platform
 
Breaking Technologies
Breaking TechnologiesBreaking Technologies
Breaking Technologies
 
Building APIs with FRAPI
Building APIs with FRAPIBuilding APIs with FRAPI
Building APIs with FRAPI
 
RESTful APIs and FRAPI
RESTful APIs and FRAPIRESTful APIs and FRAPI
RESTful APIs and FRAPI
 
Open Source for the greater good
Open Source for the greater goodOpen Source for the greater good
Open Source for the greater good
 
PHP 5.3, a walkthrough
PHP 5.3, a walkthroughPHP 5.3, a walkthrough
PHP 5.3, a walkthrough
 
RESTful APIs and FRAPI, a matter of minutes
RESTful APIs and FRAPI, a matter of minutesRESTful APIs and FRAPI, a matter of minutes
RESTful APIs and FRAPI, a matter of minutes
 
Get ready for web3.0! Open up your app!
Get ready for web3.0! Open up your app!Get ready for web3.0! Open up your app!
Get ready for web3.0! Open up your app!
 

Recently uploaded

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
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
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
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
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

An introduction to CouchDB

  • 1. An introduction to #CouchDB Sit back and relax @davidcoallier, University Limerick 2010
  • 2. WTF IS COUCH? - Highly concurrent database server - Schema free, document based database - RESTFul API - Map/Reduce Views generation - EASY replication (like... really)
  • 5.
  • 6. 32 CouchDB servers 2 datacenters SSL based user auth, sharding, etc. This is the only BBC transparent logo I found and it’s not BBC World News using CouchDB but BBC. See: http://www.erlang-factory.com/conference/London2009/speakers/endafarrell
  • 8. mozilla.org IBM Apple myspace.com ebay meebo oh so many more.
  • 10. key value name david email e@e.com phones Array createdAt timetsamp
  • 11. DOCUMENT BASED WHAT? - Dictionary of data - JSON Objects - A doc can have attachments - Auto generated IDs (CLAP NOW) - Revisions (THAT’S RIGHT..)
  • 12. DOCUMENT { "_id": "3fc3b3bf3c101e15fa7d08e2ecf9c900", "_rev": "1-34c5c7adcf1fdb8898498d1e6b64ebdd", "firstname": "David", "email": "david@echolibre.com" }
  • 13. DOCUMENT { "_id": "3fc3b3bf3c101e15fa7d08e2ecf9c900", "_rev": "1-34c5c7adcf1fdb8898498d1e6b64ebdd", "firstname": "David", "email": "david@echolibre.com", "phones": { "mobile": "086x209x69", "home": "none" }, "createdAt": "2009-09-16T22:12:43Z" }
  • 14. key value name david email e@e.com phones Array createdAt timetsamp
  • 15. WHAT ABOUT MY CRUD? - Create PUT /db/docid - Retrieve GET /db/docid - Update POST /db/docid - Delete DELETE /db/docid
  • 16. VIEWS - Persistent representation of docs - Prod is solid. No _temp shit. - Javascript, Erlang, Python, wtf ever.
  • 19. MAP map: function(doc) { if (doc.firstname) { emit(doc.firstname, doc); } }
  • 20. MAP %% Map Function fun({Doc}) -> case {proplists:get_value(<<"firstname">>, Doc)} of {undefined} -> false; {Name} -> Emit(Name, Doc); _ -> ok end end.
  • 21. fun({Doc}) -> Emitter = fun(Doc) -> Name = proplists:get_value(<<"name">>, Doc, null), Emit(Name, Doc) end, HasRequiredFields = fun(Doc) -> case {proplists:is_defined(<<"firstname">>, Doc)} of {true} -> Emitter(Doc); _-> false end end, HasRequiredFields(Doc) end.
  • 23. MAP { "_id": "3fc3b3bf3c101e15fa7d08e2ecf9c900", "_rev": "1-34c5c7adcf1fdb8898498d1e6b64ebdd", "firstname": "David", "email": "david@echolibre.com", "phones": { "mobile": "086x209x69", "home": "none" }, "createdAt": "2009-09-16T22:12:43Z", "tags": ["cool", "php", "couchdb", "skynet"] }
  • 24. MAP map: function(doc) { if (doc.tags && docs.tags.length > 0) { for (var i = 0; i < doc.tags.length; i++) { emit(doc.tags[i], 1); } } }
  • 25. REDUCE map: function(doc) { if (doc.tags && docs.tags.length > 0) { for (var i = 0; i < doc.tags.length; i++) { emit(doc.tags[i], 1); } } }, reduce: function(tag, counts) { int sum = 0; for(var i = 0; i < counts.length; i++) { sum += counts[i]; } return sum; }
  • 26. REDUCE function(tag, counts) { int sum = 0; for(var i = 0; i < counts.length; i++) { sum += counts[i]; } return sum; }
  • 27. REDUCE { "total_rows":4, "rows":[ { "key":"cool", "value":1}, { "key":"php", "value":1}, { "key":"couchdb", "value":1}, { "key":"skynet", "value":1}, ] }
  • 28. REDUCE TRICKS map: function(doc) { if (doc.tags && docs.tags.length > 0) { for (var i = 0; i < doc.tags.length; i++) { emit(doc.tags[i], 1); } } } reduce: "_count"
  • 29. REDUCE { "total_rows":4, "rows":[ { "key":"cool", "value":1}, { "key":"php", "value":1}, { "key":"couchdb", "value":1}, { "key":"skynet", "value":1}, ] }
  • 30. REDUCE map: function(doc) { if (doc.tags && docs.tags.length > 0) { for (var i = 0; i < doc.tags.length; i++) { emit(doc.tags[i], "yer ma"); } } }, reduce: function (tag, count) { return sum(tag); }
  • 33. REPLICATION It fuckin’ rules.
  • 34. REPLICATION Easy (See later futon ;-)) Continuous... or not :P Replicates your views Replicate only what you need (filter?)
  • 35. REPLICATION curl -X POST http://localhost:5984/_replicate '{"source":"/dbname", "target": "http://localhost:5555/otherdb", "continuous": true}'
  • 36. REPLICATION Source The boss Target changes? watcha need?? target needs x, y, z save them
  • 41. REPLICATION USE CASE Automated job to validate and test data and do bunch of shits
  • 42. FUTON
  • 43. FUTON
  • 44. NOTE TO SELF. Show them. Open up CouchDBX
  • 45. COOL THINGS Authorization CouchDB Lucene Lounge CouchDBX Couchio Cloudant A bunch of random bits and pieces
  • 46. COMPLETE SHITE COMING UP eas r e id sha W le! NO p s peo cus Dis
  • 47. CONCEPTS AND IDEAS Graph Theory ... ss ion u a disc t d star tr y an
  • 48. CONCEPTS AND IDEAS Ghost Replication ... ss ion u a disc t d star tr y an
  • 49. CONCEPTS AND IDEAS Shared Index Replication ... ss ion u a disc t d star tr y an
  • 51. ME! MEEE!!! @davidcoallier david@echolibre.com
  • 53. LINKS - https://nosqleast.com/2009/slides/miller-couchdb.pdf - http://couch.io - http://cloudant.com - http://wiki.apache.org/couchdb/CouchDB_in_the_wild - irc://couchdb@freenode.net (Bug jan___ ;-))

Editor's Notes