SlideShare ist ein Scribd-Unternehmen logo
1 von 53
Downloaden Sie, um offline zu lesen
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!
An introduction to CouchDB
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___ ;-))

Weitere ähnliche Inhalte

Was ist angesagt?

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
 
All database solution how to clone pluggable database from one container to d...
All database solution how to clone pluggable database from one container to d...All database solution how to clone pluggable database from one container to d...
All database solution how to clone pluggable database from one container to d...AllDatabaseSolutions
 
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
 

Was ist angesagt? (19)

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
 
All database solution how to clone pluggable database from one container to d...
All database solution how to clone pluggable database from one container to d...All database solution how to clone pluggable database from one container to d...
All database solution how to clone pluggable database from one container to d...
 
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
 

Andere mochten auch

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
 

Andere mochten auch (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
 
広島アニメ関連イベントカレンダー(仮)はじめました
広島アニメ関連イベントカレンダー(仮)はじめました広島アニメ関連イベントカレンダー(仮)はじめました
広島アニメ関連イベントカレンダー(仮)はじめました
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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!
 

Kürzlich hochgeladen

COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceMartin Humpolec
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
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
 
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
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
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
 
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
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdfJamie (Taka) Wang
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfAnna Loughnan Colquhoun
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
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
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
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
 

Kürzlich hochgeladen (20)

COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your Salesforce
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
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
 
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
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
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
 
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
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdf
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
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
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
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...
 

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)
  • 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___ ;-))

Hinweis der Redaktion