SlideShare a Scribd company logo
CouchDB
A Database for the Web




Jonathan Weiss
Who am I?

Working for Peritor in Berlin, Germany

Written, maintain, or involved in
   Webistrano
   Capistrano
   SimplyStored
   Happening
   The great fire of London

http://github.com/jweiss

@jweiss




                                         2
Scalarium


Amazon EC2 Cluster Management
   Auto-config
   Self-Healing
   Auto-Scaling
   One-click-deployment




www.scalarium.com




                                3
Database Requirements


High Availability

Easy Replication

Clustering

Robustness

Short Recovery Time




                        4
5
CouchDB


Build for the Web

Scales

Replication built-in

Embracing offline

Flexible schema – document DB




                                6
”CouchDB is built of the Web“
               Jacob Kaplan-Moss




                                   7
Web Technologies

HTTP
 the access protocol



JavaScript
  the query language



JSON
  the storage format




                       8
JSON Document

 {
     "_id": "BCCD12CBB",
     "_rev": "1-AB764C",
     "type": "person",
     "name": "Darth Vader",
     "age": 63,
     "headware": ["Helmet", "Sombrero"],
     "dark_side": true,
     "weapons": {
       "right_arm": "light_saber",
       "left_arm": null
     }
 }
                                           9
JSON Document

 {
     "_id": "BCCD12CBB",
     "_rev": "1-AB764C",
     "type": "person",
     "name": "Darth Vader",
     "age": 63,
     "headware": ["Helmet", "Sombrero"],
     "dark_side": true,
     "weapons": {
       "right_arm": "light_saber",
       "left_arm": null
     }
 }
                                           10
JSON Document

 {
     "_id": "BCCD12CBB",
     "_rev": "1-AB764C",
     "type": "person",
     "name": "Darth Vader",
     "age": 63,
     "headware": ["Helmet", "Sombrero"],
     "dark_side": true,
     "weapons": {
       "right_arm": "light_saber",
       "left_arm": null
     }
 }
                                           11
No Tables or Namespaces




                          12
No Tables or Namespaces




                          13
Manual Namespacing

 {
     "_id": "BCCD12CBB",
     "_rev": "1-AB764C",
     "type": "person",
     "name": "Darth Vader",
     "age": 63,
     "headware": ["Helmet", "Sombrero"],
     "dark_side": true,
     "weapons": {
       "right_arm": "light_saber",
       "left_arm": null
     }
 }
                                           14
Interacting with CouchDB




                   JSON


HTTP Client

              PUT /dbname/ID



                               15
Interacting with CouchDB



              GET /dbname/ID



HTTP Client



                   JSON


                               16
Interacting with CouchDB




              DELETE /dbname/ID
HTTP Client




                                  17
Views




        18
Design Document
 {
     "id": "_design/hats”,
     "_rev": "431212AB4”,
     "language": "javascript”,
     "views": {
       "all": {
         "map": "function(doc){ .... }”,
         "reduce": "function(doc){ .... }”
       },
     "by_manufacturer": {
       "map": "function(doc){ .... }”,
       "reduce": "function(doc){ .... }”
       }
     }
 }                                           19
Design Document
 {                                               Document ID
     "id": "_design/hats”,                            –
     "_rev": "431212AB4”,                    prefixed by “_design/”
     "language": "javascript”,
     "views": {
       "all": {
         "map": "function(doc){ .... }”,
         "reduce": "function(doc){ .... }”
       },
     "by_manufacturer": {
       "map": "function(doc){ .... }”,
       "reduce": "function(doc){ .... }”
       }
     }
 }                                                                   20
Design Document
 {
     "id": "_design/hats”,
     "_rev": "431212AB4”,
     "language": "javascript”,
     "views": {
       "all": {                              Hash of Views
         "map": "function(doc){ .... }”,
         "reduce": "function(doc){ .... }”
       },
     "by_manufacturer": {
       "map": "function(doc){ .... }”,
       "reduce": "function(doc){ .... }”
       }
     }
 }                                                           21
Design Document
 {
     "id": "_design/hats”,
     "_rev": "431212AB4”,
     "language": "javascript”,
     "views": {
       "all": {                                  Hash of Views
         "map": "function(doc){ .... }”,     Every view has map &
         "reduce": "function(doc){ .... }”      reduce function
       },
     "by_manufacturer": {
       "map": "function(doc){ .... }”,
       "reduce": "function(doc){ .... }”
       }
     }
 }                                                                  22
Map



function(doc) {
    if (doc.headware) {
      for (var hat in doc.headware) {
        emit(hat, 1);
      }
    }
}



                                        23
Map
                                  Passed every
                               document in the DB

function(doc) {
    if (doc.headware) {
      for (var hat in doc.headware) {
        emit(hat, 1);
      }
    }
}



                                                    24
Map



function(doc) {
    if (doc.headware) {
                                        Inspects
      for (var hat in doc.headware) {   & Decides
        emit(hat, 1);
      }
    }
}



                                                    25
Map



function(doc) {
    if (doc.headware) {
      for (var hat in doc.headware) {
        emit(hat, 1);
      }
    }                          Emits result
}                                 for index




                                              26
Reduce



 function(keys, values, rereduce) {
     return sum(values);
 }




                                      27
Reduce
                                     Passed map result
                                  (or partial reduce result)

 function(keys, values, rereduce) {
     return sum(values);
 }




                                                               28
Reduce



 function(keys, values, rereduce) {
     return sum(values);
 }




           Aggregates
     (count, sum, average, …)



                                      29
Example Map Result

Map functions are similar to SQL indices

                ID               KEY         VALUE

         51ABFA211         Cap                  1

         ABC123456         Cappy                1

         BCCD12CBB         Helmet               1

         BCCD12CBB         Sombrero             1

Sorted by the key

Key can also be an array

Value can be complex JSON and/or reference to other document
                                                               30
Query a view


        GET /dbname/_design/hats/_view/all




HTTP Client


              {"total_rows":348,"offset":0,"rows”:[
                {"id":"A","key":"A","value":1},
                {"id":"B","key":"B","value":1},
              ]}
                                                      31
Query a view


       GET /dbname/_design/hats/_view/all?
        include_docs=true




HTTP Client




                                             32
View Query


Filter by
   key=ABC123
   startkey=123 & endkey=9
   limit=100
   descending=true
   group=true
   reduce=true
   Include_docs=true




                              33
SQL vs. JavaScript




                     Vs.




                           34
Using Couch from PHP


Several options available
   PHPillow:
    http://arbitracker.org/phpillow.html (LGPL 3)
   PHP Object_Freezer:
    https://github.com/sebastianbergmann/php-object-freezer/tree (BSD)
   PHP On Couch:
    http://github.com/dready92/PHP-on-Couch/tree/master (GPLv2 or v3)
   PHP CouchDB Extension:
    http://www.topdog.za.net/php_couchdb_extension (PHP License 3.0)
   Sag for CouchDB:
   http://www.saggingcouch.com/ (Apache License 2.0)


                                                                         35
36
37
38
39
SimplyStored


CouchDB convenience Layer for Ruby
   Models & Associations
   Validations
   Callbacks               BSD-licensed on
   Dynamic finder           http://github.com/peritor/simply_stored
   S3 attachments          On top of CouchPotato, CouchRest & RestClient
   Paranoid delete
   ActiveModel compliant




                                                                            40
Many more




Or just build your own using HTTP!

                                     41
Database Requirements


High Availability

Easy Replication

Clustering

Robustness

Short Recovery Time




                        42
Replication
   B-Tree
XXXXX




              Photo by Mathias Meyer
                                       43
B-Tree

Append only

Concurrency (MVCC)

Crash resistant

Hot backups

Compaction




                     44
Replication




              45
CouchDB Replication



                      POST /_replicate




                      POST /_replicate


Eventually consistent & conflict resolution

                                             46
Load Balancing




                             Replication


 HTTP Client     HTTP Load
                 Balancer




                                           47
Caching




 HTTP Client   HTTP Cache
               Varnish
               Apache
               …




                            48
Multi-Master




               49
BigCouch

  Clustered CouchDB:

 Many CouchDBs appear as one



  Modeled after Amazon Dynamo

  Scalability like Cassandra or Riak

  github.com/cloudant/bigcouch




                                        50
Q – No. of partitions

BigCouch
N – No. of replicas

R – Read quorum

W – Write quorum




                        51
Various

CouchApps

Validations

Filtered replication

Changes feed

List functions

Futon

Geo

Fulltext-Search with embedded Lucene

Different experimental View-Server
                                       52
Q&A
Peritor GmbH
Blücherstr. 22, Hof III Aufgang 6
10961 Berlin
Tel.: +49 (0)30 69 20 09 84 0
Fax: +49 (0)30 69 20 09 84 9
Internet: www.peritor.com
E-Mail: info@peritor.com



© Peritor GmbH - Alle Rechte vorbehalten

More Related Content

What's hot (19)

KEY
Introduction to MongoDB
Alex Bilbie
 
PPTX
Back to Basics Webinar 2: Your First MongoDB Application
MongoDB
 
PPTX
Beyond the Basics 2: Aggregation Framework
MongoDB
 
PPTX
MongoDB
Bembeng Arifin
 
PDF
Mongo Presentation by Metatagg Solutions
Metatagg Solutions
 
PPTX
Querying mongo db
Bogdan Sabău
 
KEY
MongoDB at GUL
Israel Gutiérrez
 
PPTX
The Aggregation Framework
MongoDB
 
PPTX
Agg framework selectgroup feb2015 v2
MongoDB
 
PPT
2011 Mongo FR - MongoDB introduction
antoinegirbal
 
PPT
PhpstudyTokyo MongoDB PHP CakePHP
ichikaway
 
PDF
MongoDB Aggregation Framework
Caserta
 
PPTX
Back to Basics Webinar 5: Introduction to the Aggregation Framework
MongoDB
 
KEY
OSCON 2011 CouchApps
Bradley Holt
 
KEY
Mongo db presentation
Julie Sommerville
 
PDF
Building Apps with MongoDB
Nate Abele
 
PPTX
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
MongoDB
 
PDF
Visualizing Web Data Query Results
Anja Jentzsch
 
PPTX
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
MongoDB
 
Introduction to MongoDB
Alex Bilbie
 
Back to Basics Webinar 2: Your First MongoDB Application
MongoDB
 
Beyond the Basics 2: Aggregation Framework
MongoDB
 
Mongo Presentation by Metatagg Solutions
Metatagg Solutions
 
Querying mongo db
Bogdan Sabău
 
MongoDB at GUL
Israel Gutiérrez
 
The Aggregation Framework
MongoDB
 
Agg framework selectgroup feb2015 v2
MongoDB
 
2011 Mongo FR - MongoDB introduction
antoinegirbal
 
PhpstudyTokyo MongoDB PHP CakePHP
ichikaway
 
MongoDB Aggregation Framework
Caserta
 
Back to Basics Webinar 5: Introduction to the Aggregation Framework
MongoDB
 
OSCON 2011 CouchApps
Bradley Holt
 
Mongo db presentation
Julie Sommerville
 
Building Apps with MongoDB
Nate Abele
 
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
MongoDB
 
Visualizing Web Data Query Results
Anja Jentzsch
 
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
MongoDB
 

Viewers also liked (7)

KEY
CouchDB
Yohei Sasaki
 
PDF
Couchdb
Kota Sakoda
 
PDF
CouchDB
Rashmi Agale
 
KEY
CouchDB on Android
Sven Haiges
 
PDF
Introduction to couchdb
iammutex
 
PPTX
The ROI of Enhancing Your Candidate Experience
Tincup & Co.
 
KEY
CouchDB introduction
Sander van de Graaf
 
CouchDB
Yohei Sasaki
 
Couchdb
Kota Sakoda
 
CouchDB
Rashmi Agale
 
CouchDB on Android
Sven Haiges
 
Introduction to couchdb
iammutex
 
The ROI of Enhancing Your Candidate Experience
Tincup & Co.
 
CouchDB introduction
Sander van de Graaf
 
Ad

Similar to NoSQL - An introduction to CouchDB (20)

PDF
CouchDB on Rails - RailsWayCon 2010
Jonathan Weiss
 
PDF
CouchDB on Rails
Jonathan Weiss
 
PDF
CouchDB on Rails - FrozenRails 2010
Jonathan Weiss
 
PDF
CouchDB at JAOO Århus 2009
Jason Davies
 
KEY
An introduction to CouchDB
David Coallier
 
PDF
Couchbase Korea User Group 2nd Meetup #2
won min jang
 
PPT
NoSQL - "simple" web monitoring
Samir Siqueira
 
PDF
CouchDB at New York PHP
Bradley Holt
 
PDF
Couchdb Nosql
elliando dias
 
PDF
GeekCamp SG 2009 - CouchApps with CouchDB
Arun Thampi
 
PDF
Advanced CouchDB Rotterdam.rb July 2010
Sander van de Graaf
 
PDF
CouchDB
codebits
 
PDF
2013-03-23 - NoSQL Spartakiade
Johannes Hoppe
 
PDF
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
Johannes Hoppe
 
PDF
Transition from relational to NoSQL Philly DAMA Day
Dipti Borkar
 
PDF
Navigating the Transition from relational to NoSQL - CloudCon Expo 2012
Dipti Borkar
 
PDF
Relaxing With CouchDB
leinweber
 
PDF
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
ActsAsCon
 
PPT
Couchbase Server 2.0 - Indexing and Querying - Deep dive
Dipti Borkar
 
PDF
Persisting dynamic data with mongodb and mongomapper
wonko
 
CouchDB on Rails - RailsWayCon 2010
Jonathan Weiss
 
CouchDB on Rails
Jonathan Weiss
 
CouchDB on Rails - FrozenRails 2010
Jonathan Weiss
 
CouchDB at JAOO Århus 2009
Jason Davies
 
An introduction to CouchDB
David Coallier
 
Couchbase Korea User Group 2nd Meetup #2
won min jang
 
NoSQL - "simple" web monitoring
Samir Siqueira
 
CouchDB at New York PHP
Bradley Holt
 
Couchdb Nosql
elliando dias
 
GeekCamp SG 2009 - CouchApps with CouchDB
Arun Thampi
 
Advanced CouchDB Rotterdam.rb July 2010
Sander van de Graaf
 
CouchDB
codebits
 
2013-03-23 - NoSQL Spartakiade
Johannes Hoppe
 
2012-08-29 - NoSQL Bootcamp (Redis, RavenDB & MongoDB für .NET Entwickler)
Johannes Hoppe
 
Transition from relational to NoSQL Philly DAMA Day
Dipti Borkar
 
Navigating the Transition from relational to NoSQL - CloudCon Expo 2012
Dipti Borkar
 
Relaxing With CouchDB
leinweber
 
development, ruby, conferences, frameworks, ruby on rails, confreaks, actsasc...
ActsAsCon
 
Couchbase Server 2.0 - Indexing and Querying - Deep dive
Dipti Borkar
 
Persisting dynamic data with mongodb and mongomapper
wonko
 
Ad

More from Jonathan Weiss (20)

PDF
Docker on AWS OpsWorks
Jonathan Weiss
 
PDF
ChefConf 2014 - AWS OpsWorks Under The Hood
Jonathan Weiss
 
PDF
AWS OpsWorks & Chef at the Hamburg Chef User Group 2014
Jonathan Weiss
 
PPTX
DevOpsDays Amsterdam - Observations in the cloud
Jonathan Weiss
 
PDF
Amazon SWF and Gordon
Jonathan Weiss
 
PDF
Introduction to Backbone.js
Jonathan Weiss
 
PDF
Scalarium and CouchDB
Jonathan Weiss
 
PDF
Build your own clouds with Chef and MCollective
Jonathan Weiss
 
PDF
NoSQL - Motivation and Overview
Jonathan Weiss
 
PDF
Running on Amazon EC2
Jonathan Weiss
 
PDF
Amazon EC2 in der Praxis
Jonathan Weiss
 
PDF
Infrastructure Automation with Chef
Jonathan Weiss
 
PDF
Rails in the Cloud
Jonathan Weiss
 
PDF
EventMachine
Jonathan Weiss
 
PDF
Rails in the Cloud - Experiences from running on EC2
Jonathan Weiss
 
PDF
NoSQL - Post-Relational Databases - BarCamp Ruhr3
Jonathan Weiss
 
PDF
Ruby on CouchDB - SimplyStored and RockingChair
Jonathan Weiss
 
PDF
No SQL - BarCamp Nürnberg 2010
Jonathan Weiss
 
PPTX
BarCamp Nürnberg - Infrastructure As A Service
Jonathan Weiss
 
PDF
Rails Security
Jonathan Weiss
 
Docker on AWS OpsWorks
Jonathan Weiss
 
ChefConf 2014 - AWS OpsWorks Under The Hood
Jonathan Weiss
 
AWS OpsWorks & Chef at the Hamburg Chef User Group 2014
Jonathan Weiss
 
DevOpsDays Amsterdam - Observations in the cloud
Jonathan Weiss
 
Amazon SWF and Gordon
Jonathan Weiss
 
Introduction to Backbone.js
Jonathan Weiss
 
Scalarium and CouchDB
Jonathan Weiss
 
Build your own clouds with Chef and MCollective
Jonathan Weiss
 
NoSQL - Motivation and Overview
Jonathan Weiss
 
Running on Amazon EC2
Jonathan Weiss
 
Amazon EC2 in der Praxis
Jonathan Weiss
 
Infrastructure Automation with Chef
Jonathan Weiss
 
Rails in the Cloud
Jonathan Weiss
 
EventMachine
Jonathan Weiss
 
Rails in the Cloud - Experiences from running on EC2
Jonathan Weiss
 
NoSQL - Post-Relational Databases - BarCamp Ruhr3
Jonathan Weiss
 
Ruby on CouchDB - SimplyStored and RockingChair
Jonathan Weiss
 
No SQL - BarCamp Nürnberg 2010
Jonathan Weiss
 
BarCamp Nürnberg - Infrastructure As A Service
Jonathan Weiss
 
Rails Security
Jonathan Weiss
 

NoSQL - An introduction to CouchDB

  • 1. CouchDB A Database for the Web Jonathan Weiss
  • 2. Who am I? Working for Peritor in Berlin, Germany Written, maintain, or involved in   Webistrano   Capistrano   SimplyStored   Happening   The great fire of London http://github.com/jweiss @jweiss 2
  • 3. Scalarium Amazon EC2 Cluster Management   Auto-config   Self-Healing   Auto-Scaling   One-click-deployment www.scalarium.com 3
  • 4. Database Requirements High Availability Easy Replication Clustering Robustness Short Recovery Time 4
  • 5. 5
  • 6. CouchDB Build for the Web Scales Replication built-in Embracing offline Flexible schema – document DB 6
  • 7. ”CouchDB is built of the Web“ Jacob Kaplan-Moss 7
  • 8. Web Technologies HTTP the access protocol JavaScript the query language JSON the storage format 8
  • 9. JSON Document { "_id": "BCCD12CBB", "_rev": "1-AB764C", "type": "person", "name": "Darth Vader", "age": 63, "headware": ["Helmet", "Sombrero"], "dark_side": true, "weapons": { "right_arm": "light_saber", "left_arm": null } } 9
  • 10. JSON Document { "_id": "BCCD12CBB", "_rev": "1-AB764C", "type": "person", "name": "Darth Vader", "age": 63, "headware": ["Helmet", "Sombrero"], "dark_side": true, "weapons": { "right_arm": "light_saber", "left_arm": null } } 10
  • 11. JSON Document { "_id": "BCCD12CBB", "_rev": "1-AB764C", "type": "person", "name": "Darth Vader", "age": 63, "headware": ["Helmet", "Sombrero"], "dark_side": true, "weapons": { "right_arm": "light_saber", "left_arm": null } } 11
  • 12. No Tables or Namespaces 12
  • 13. No Tables or Namespaces 13
  • 14. Manual Namespacing { "_id": "BCCD12CBB", "_rev": "1-AB764C", "type": "person", "name": "Darth Vader", "age": 63, "headware": ["Helmet", "Sombrero"], "dark_side": true, "weapons": { "right_arm": "light_saber", "left_arm": null } } 14
  • 15. Interacting with CouchDB JSON HTTP Client PUT /dbname/ID 15
  • 16. Interacting with CouchDB GET /dbname/ID HTTP Client JSON 16
  • 17. Interacting with CouchDB DELETE /dbname/ID HTTP Client 17
  • 18. Views 18
  • 19. Design Document { "id": "_design/hats”, "_rev": "431212AB4”, "language": "javascript”, "views": { "all": { "map": "function(doc){ .... }”, "reduce": "function(doc){ .... }” }, "by_manufacturer": { "map": "function(doc){ .... }”, "reduce": "function(doc){ .... }” } } } 19
  • 20. Design Document { Document ID "id": "_design/hats”, – "_rev": "431212AB4”, prefixed by “_design/” "language": "javascript”, "views": { "all": { "map": "function(doc){ .... }”, "reduce": "function(doc){ .... }” }, "by_manufacturer": { "map": "function(doc){ .... }”, "reduce": "function(doc){ .... }” } } } 20
  • 21. Design Document { "id": "_design/hats”, "_rev": "431212AB4”, "language": "javascript”, "views": { "all": { Hash of Views "map": "function(doc){ .... }”, "reduce": "function(doc){ .... }” }, "by_manufacturer": { "map": "function(doc){ .... }”, "reduce": "function(doc){ .... }” } } } 21
  • 22. Design Document { "id": "_design/hats”, "_rev": "431212AB4”, "language": "javascript”, "views": { "all": { Hash of Views "map": "function(doc){ .... }”, Every view has map & "reduce": "function(doc){ .... }” reduce function }, "by_manufacturer": { "map": "function(doc){ .... }”, "reduce": "function(doc){ .... }” } } } 22
  • 23. Map function(doc) { if (doc.headware) { for (var hat in doc.headware) { emit(hat, 1); } } } 23
  • 24. Map Passed every document in the DB function(doc) { if (doc.headware) { for (var hat in doc.headware) { emit(hat, 1); } } } 24
  • 25. Map function(doc) { if (doc.headware) { Inspects for (var hat in doc.headware) { & Decides emit(hat, 1); } } } 25
  • 26. Map function(doc) { if (doc.headware) { for (var hat in doc.headware) { emit(hat, 1); } } Emits result } for index 26
  • 27. Reduce function(keys, values, rereduce) { return sum(values); } 27
  • 28. Reduce Passed map result (or partial reduce result) function(keys, values, rereduce) { return sum(values); } 28
  • 29. Reduce function(keys, values, rereduce) { return sum(values); } Aggregates (count, sum, average, …) 29
  • 30. Example Map Result Map functions are similar to SQL indices ID KEY VALUE 51ABFA211 Cap 1 ABC123456 Cappy 1 BCCD12CBB Helmet 1 BCCD12CBB Sombrero 1 Sorted by the key Key can also be an array Value can be complex JSON and/or reference to other document 30
  • 31. Query a view GET /dbname/_design/hats/_view/all HTTP Client {"total_rows":348,"offset":0,"rows”:[ {"id":"A","key":"A","value":1}, {"id":"B","key":"B","value":1}, ]} 31
  • 32. Query a view GET /dbname/_design/hats/_view/all? include_docs=true HTTP Client 32
  • 33. View Query Filter by   key=ABC123   startkey=123 & endkey=9   limit=100   descending=true   group=true   reduce=true   Include_docs=true 33
  • 35. Using Couch from PHP Several options available   PHPillow: http://arbitracker.org/phpillow.html (LGPL 3)   PHP Object_Freezer: https://github.com/sebastianbergmann/php-object-freezer/tree (BSD)   PHP On Couch: http://github.com/dready92/PHP-on-Couch/tree/master (GPLv2 or v3)   PHP CouchDB Extension: http://www.topdog.za.net/php_couchdb_extension (PHP License 3.0)   Sag for CouchDB: http://www.saggingcouch.com/ (Apache License 2.0) 35
  • 36. 36
  • 37. 37
  • 38. 38
  • 39. 39
  • 40. SimplyStored CouchDB convenience Layer for Ruby   Models & Associations   Validations   Callbacks BSD-licensed on   Dynamic finder http://github.com/peritor/simply_stored   S3 attachments On top of CouchPotato, CouchRest & RestClient   Paranoid delete   ActiveModel compliant 40
  • 41. Many more Or just build your own using HTTP! 41
  • 42. Database Requirements High Availability Easy Replication Clustering Robustness Short Recovery Time 42
  • 43. Replication B-Tree XXXXX Photo by Mathias Meyer 43
  • 44. B-Tree Append only Concurrency (MVCC) Crash resistant Hot backups Compaction 44
  • 46. CouchDB Replication POST /_replicate POST /_replicate Eventually consistent & conflict resolution 46
  • 47. Load Balancing Replication HTTP Client HTTP Load Balancer 47
  • 48. Caching HTTP Client HTTP Cache Varnish Apache … 48
  • 50. BigCouch   Clustered CouchDB: Many CouchDBs appear as one   Modeled after Amazon Dynamo   Scalability like Cassandra or Riak   github.com/cloudant/bigcouch 50
  • 51. Q – No. of partitions BigCouch N – No. of replicas R – Read quorum W – Write quorum 51
  • 52. Various CouchApps Validations Filtered replication Changes feed List functions Futon Geo Fulltext-Search with embedded Lucene Different experimental View-Server 52
  • 53. Q&A Peritor GmbH Blücherstr. 22, Hof III Aufgang 6 10961 Berlin Tel.: +49 (0)30 69 20 09 84 0 Fax: +49 (0)30 69 20 09 84 9 Internet: www.peritor.com E-Mail: [email protected] © Peritor GmbH - Alle Rechte vorbehalten