SlideShare una empresa de Scribd logo
1 de 65
Descargar para leer sin conexión
CouchDB
Who’s talking?



           jan@apache.org / @janl



And you?
RDBMS vs
     Just Storing Data



Sorry for bashing!
RDBMS vs Just Storing Data

         Design schema upfront
         Write or use software to
         translate your data into
         that schema
         …and back
1) beware of speed considerations without having an app to measure
2) or use an ORM which turns out to be a pain in the back for all sorts of reasons
3) Most Data is not inherently relational
RDBMS vs Just Storing Data
         Isolated data records
         called Documents
         No schema (!)
         and semi-
         structured
data records that make up the app’s data objects
Documents in the Real
World
Documents in the Real World

        Bills, tax forms, letters…
        Same type != same structure
        Can be out of date
        Natural data behaviour
Actual data record, no pointer
{
    “_id”: ”BCCD12CBB”,
    “_rev”: ”AB764C”,

    “type”: ”person”,
    “name”: ”Darth Vader”,
    “age”: 63,
    “headware”:
      [“Helmet”, “Sombrero”],
    “dark_side”: true
}
{
    “_id”: ”BCCD12CBB”,
    “_rev”: ”AB764C”,

    “type”: ”person”,
    “name”: ”Darth Vader”,
    “age”: 63,
    “headware”:
      [“Helmet”, “Sombrero”],
    “dark_side”: true
}
{
    “_id”: ”BCCD12CBB”,
    “_rev”: ”AB764C”,

    “type”: ”person”,
    “name”: ”Darth Vader”,
    “age”: 63,
    “headware”:
      [“Helmet”, “Sombrero”],
    “dark_side”: true
}
{
    “_id”: ”BCCD12CBB”,
    “_rev”: ”AB764C”,

    “type”: ”person”,
    “name”: ”Darth Vader”,
    “age”: 63,
    “headware”:
      [“Helmet”, “Sombrero”],
    “dark_side”: true
}
CRUD — Arbeiten mit Dokumenten

 Create: HTTP POST    /db/BCCD12CBB

  Read: HTTP GET      /db/BCCD12CBB

 Update: HTTP PUT    /db/BCCD12CBB

 Delete: HTTP DELETE /db/BCCD12CBB
$ curl -X GET http://server/ 
    database/document
{“_id”:”ABC”,“_rev”:”1D4”,”data
”:...}
$
Zend_Http_Client

<?php

 $url = 'http://server:5984/db/doc';
 $client = new Zend_Http_Client($url);

 $response = $client->request('GET');

 echo $response->getBody();
PHPillow – Kore Nordmann
 <?php

 $doc = new myBlogDocument();

 $doc->title = 'New blog post';
 $doc->text = 'Hello world.';
 $doc->save();

 echo $doc->_id;

 $doc = myBlogDocument::fetchById('123');
View
of Keyes and Values
Views


         Filter, Collate, Aggregate
         Powered by Map/Reduce


Design documents
functions get executed, you don’t do that
View Examples – Docs by Date

              Key                  Value

[2007, 10, 12, 20, 13, 12] {quot;_idquot;:quot;...quot;}

[2007, 12, 26,      8, 37, 55] {quot;_idquot;:quot;...quot;}

[2008,   2,   3, 10, 22, 34] {quot;_idquot;:quot;...quot;}

[2008,   5,   1, 14, 16, 11] {quot;_idquot;:quot;...quot;}
View Examples – Docs by Date


function(doc) {
  emit(doc.date, doc);
}
View Examples – Docs by Date


function(doc) {
  emit(<key>, <value>);
}
Views


         Built incrementally…
         …and on demand
         Reduce optional

map/reduce can be parallelised
Replication
Replication
Easy Data Synchronization Without Headaches
Replication


         Take your data with you
         CouchDB makes it easy to
         synchronise machines


rsync-like
Large spectrum of architectures:
 - P2P, Failover, Load Balancing, Backup
Conflicts: auto-detect & resolve, data consistency
Built for the Future

         Written in Erlang - a telco-
         grade concurrent platform
         Non-locking MVCC and
         ACID compliant data store

Erlang Processes + messaging
Ericsson AXD 301 - nine nines - 1/30th second per year
Crash resistant
Number Bragging
Silly read-only benchmark with
memory saturation
2,500 req/s sustained on a
2Ghz dual core Athlon
Number Bragging
Silly read-only benchmark with
memory saturation
2,500 req/s sustained on a
2Ghz dual core Athlon
Using 9.8 MB RAM
A Little History

 Damien Katz self funded
 fulltime development for 2
 years
 Now backed by IBM
A Little History


 Accepted to the Apache
 Software Foundation
 Open Source License
Thank You!
Bonus Slides
Where is my auto increment
What is auto_increment?
Unique identifier
Sequence denominator
Where is my auto_increment?
Documents have `_id`s
Sequences in distributed
applications are not
Timestamps get you a long
way, though.
Relation(ship)s
 JOINs plz!
 What for?
 Get data that “belongs
 together”
Relation(ship)s
 One big fat doc?
 Pros: Easy – Cons: Bad with
 the concurrent updates
 Use for: Low volume updates
 e.g. user-supplied tags
Relation(ship)s
 Master Doc – Slave Doc
 Pros: A little complex – Cons:
 Fast, good with concurrent
 updates, tree operations
 Use for: Everything else
Relation(ship)s
function(doc) {
  if(doc.ismaster) {
    emit([doc._id, doc.date], doc);
  } else {
    emit([doc.master_id, doc.date], doc);
  }
}
Relation(ship)s
          ...                     ...

[quot;BAAC67quot;, quot;2008-09-21quot;]   {quot;is_parentquot;,true}

[quot;BAAC67quot;, quot;2008-09-22quot;]     {quot;...quot;,quot;...quot;}

[quot;BAAC67quot;, quot;2008-09-23quot;]     {quot;...quot;,quot;...quot;}

[quot;BAAC67quot;, quot;2008-09-24quot;]     {quot;...quot;,quot;...quot;}

          ...                     ...
Transactions!
 Run multiple operations at
 once
 They all succeed or none gets
 applied
Transactions
POST
{
  quot;docsquot;: [
    {quot;_idquot;: quot;0quot;, quot;intquot;: 0, quot;strquot;: quot;0quot;},
    {quot;_idquot;: quot;1quot;, quot;intquot;: 1, quot;strquot;: quot;1quot;},
    {quot;_idquot;: quot;2quot;, quot;intquot;: 2, quot;strquot;: quot;2quot;}
  ]
}
Transactions!
 Caveats:
 Statement transaction
 No data transaction
 No multi-node transactions
Multi-Node Transactions!
Why? – Data redundancy
Use an HTTP proxy
Nice to build on standard
protocols
Caveat: 2-phase-commit in
disguise
MapReduce
View Examples – Docs by Date
                     Map

              Key                Value

[2007, 10, 12, 20, 13, 12]       3465

[2007, 12, 26,      8, 37, 55]   4200

[2008,   2,   3, 10, 22, 34]     3782

[2008,   5,   1, 14, 16, 11]     5984
View Examples – Docs by Date
               Reduce

        Key             Value

        null            17431
View Examples – Docs by Date
    Reduce with group_level=1

         Key                    Value

       [2007]                   7665

       [2008]                   9766
View Examples – Docs by Date
                     Map

              Key                Value

[2007, 10, 12, 20, 13, 12]       3465

[2007, 12, 26,      8, 37, 55]   4200

[2008,   2,   3, 10, 22, 34]     3782

[2008,   5,   1, 14, 16, 11]     5984
Hot backup?



POSIX compliant
Hot backup?


$ cp -r /var/lib/couchdb/* 
  /mnt/backup
Resources
        Twitter: @CouchDB & http://couchdb.org/
        Dress like a Couch:
        http://shop.couchdb.com
        http://damienkatz.net/ & http://jan.prima.de/
        http://blog.racklabs.com/?p=74
        https://peepcode.com/products/couchdb-
        with-rails

not covered everything,
other talks + tutorials
Thank You
Really, thanks.
Got it?
Questions
Built for the Future
“640k processors should be enough for
anybody.”
Single-user machines
Back then
Multi-user machines
Now
Application: Science
Back then
Application: Internet
Today
Monolithic machines
Back then
Lots of small servers
Today
CPU, RAM and disks == $$$
Back then
Components cheaper
Now

Más contenido relacionado

La actualidad más candente

OSCON 2011 CouchApps
OSCON 2011 CouchAppsOSCON 2011 CouchApps
OSCON 2011 CouchAppsBradley Holt
 
CouchDB : More Couch
CouchDB : More CouchCouchDB : More Couch
CouchDB : More Couchdelagoya
 
MongoDB Aggregation Performance
MongoDB Aggregation PerformanceMongoDB Aggregation Performance
MongoDB Aggregation PerformanceMongoDB
 
Mongodb - NoSql Database
Mongodb - NoSql DatabaseMongodb - NoSql Database
Mongodb - NoSql DatabasePrashant Gupta
 
Presentation of OrientDB v2.2 - Webinar
Presentation of OrientDB v2.2 - WebinarPresentation of OrientDB v2.2 - Webinar
Presentation of OrientDB v2.2 - WebinarOrient Technologies
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRavi Teja
 
Lecture 40 1
Lecture 40 1Lecture 40 1
Lecture 40 1patib5
 
Storage talk
Storage talkStorage talk
Storage talkchristkv
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB Habilelabs
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Kai Zhao
 
Building Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBBuilding Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBAshnikbiz
 
FITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB
 

La actualidad más candente (20)

NoSQL Introduction
NoSQL IntroductionNoSQL Introduction
NoSQL Introduction
 
OSCON 2011 CouchApps
OSCON 2011 CouchAppsOSCON 2011 CouchApps
OSCON 2011 CouchApps
 
CouchDB : More Couch
CouchDB : More CouchCouchDB : More Couch
CouchDB : More Couch
 
MongoDB Aggregation Performance
MongoDB Aggregation PerformanceMongoDB Aggregation Performance
MongoDB Aggregation Performance
 
Mongodb - NoSql Database
Mongodb - NoSql DatabaseMongodb - NoSql Database
Mongodb - NoSql Database
 
Presentation of OrientDB v2.2 - Webinar
Presentation of OrientDB v2.2 - WebinarPresentation of OrientDB v2.2 - Webinar
Presentation of OrientDB v2.2 - Webinar
 
Lokijs
LokijsLokijs
Lokijs
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
 
CouchDB introduction
CouchDB introductionCouchDB introduction
CouchDB introduction
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Lecture 40 1
Lecture 40 1Lecture 40 1
Lecture 40 1
 
Storage talk
Storage talkStorage talk
Storage talk
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
 
Building Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBBuilding Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDB
 
FITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JS
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 

Destacado

Facilitating Complexity: A Pervert's Guide to Exploration
Facilitating Complexity: A Pervert's Guide to ExplorationFacilitating Complexity: A Pervert's Guide to Exploration
Facilitating Complexity: A Pervert's Guide to ExplorationWilliam Evans
 
How To Generate Your First 20,000 Followers On Instagram
How To Generate Your First 20,000 Followers On InstagramHow To Generate Your First 20,000 Followers On Instagram
How To Generate Your First 20,000 Followers On InstagramRoss Simmonds
 
Farming Unicorns: Building Startup & Investor Ecosystems (Dublin, June 2016)
Farming Unicorns: Building Startup & Investor Ecosystems (Dublin, June 2016)Farming Unicorns: Building Startup & Investor Ecosystems (Dublin, June 2016)
Farming Unicorns: Building Startup & Investor Ecosystems (Dublin, June 2016)Dave McClure
 
Introduction to SlideShare for Businesses
Introduction to SlideShare for BusinessesIntroduction to SlideShare for Businesses
Introduction to SlideShare for BusinessesSlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShareSlideShare
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanPost Planner
 
Buffer culture 0.6 (With a change to Be a No Ego Doer)
Buffer culture 0.6 (With a change to Be a No Ego Doer)Buffer culture 0.6 (With a change to Be a No Ego Doer)
Buffer culture 0.6 (With a change to Be a No Ego Doer)Buffer
 
Designing the Future: When Fact Meets Fiction
Designing the Future: When Fact Meets FictionDesigning the Future: When Fact Meets Fiction
Designing the Future: When Fact Meets FictionDean Johnson
 
How to Battle Bad Reviews
How to Battle Bad ReviewsHow to Battle Bad Reviews
How to Battle Bad ReviewsGlassdoor
 
Activism x Technology
Activism x TechnologyActivism x Technology
Activism x TechnologyWebVisions
 
Analytics Trends 2016: The next evolution
Analytics Trends 2016: The next evolutionAnalytics Trends 2016: The next evolution
Analytics Trends 2016: The next evolutionDeloitte United States
 
An introduction to CouchDB
An introduction to CouchDBAn introduction to CouchDB
An introduction to CouchDBDavid Coallier
 
Word Power: 11 Techniques for Writing More Persuasive Copy
Word Power: 11 Techniques for Writing More Persuasive CopyWord Power: 11 Techniques for Writing More Persuasive Copy
Word Power: 11 Techniques for Writing More Persuasive CopyBarry Feldman
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting PersonalKirsty Hulse
 
20 Awesome Facts About Chocolate That You Need To Know For Valentine’s Day
20 Awesome Facts About Chocolate That You Need To Know For Valentine’s Day20 Awesome Facts About Chocolate That You Need To Know For Valentine’s Day
20 Awesome Facts About Chocolate That You Need To Know For Valentine’s DayEason Chan
 
Software is Eating Bio
Software is Eating BioSoftware is Eating Bio
Software is Eating Bioa16z
 
How to Use Social Media to Influence the World
How to Use Social Media to Influence the WorldHow to Use Social Media to Influence the World
How to Use Social Media to Influence the WorldSean Si
 
Secrets to a Great Team
Secrets to a Great TeamSecrets to a Great Team
Secrets to a Great TeamElodie A.
 

Destacado (19)

Facilitating Complexity: A Pervert's Guide to Exploration
Facilitating Complexity: A Pervert's Guide to ExplorationFacilitating Complexity: A Pervert's Guide to Exploration
Facilitating Complexity: A Pervert's Guide to Exploration
 
How To Generate Your First 20,000 Followers On Instagram
How To Generate Your First 20,000 Followers On InstagramHow To Generate Your First 20,000 Followers On Instagram
How To Generate Your First 20,000 Followers On Instagram
 
Farming Unicorns: Building Startup & Investor Ecosystems (Dublin, June 2016)
Farming Unicorns: Building Startup & Investor Ecosystems (Dublin, June 2016)Farming Unicorns: Building Startup & Investor Ecosystems (Dublin, June 2016)
Farming Unicorns: Building Startup & Investor Ecosystems (Dublin, June 2016)
 
Introduction to SlideShare for Businesses
Introduction to SlideShare for BusinessesIntroduction to SlideShare for Businesses
Introduction to SlideShare for Businesses
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 
Buffer culture 0.6 (With a change to Be a No Ego Doer)
Buffer culture 0.6 (With a change to Be a No Ego Doer)Buffer culture 0.6 (With a change to Be a No Ego Doer)
Buffer culture 0.6 (With a change to Be a No Ego Doer)
 
Designing the Future: When Fact Meets Fiction
Designing the Future: When Fact Meets FictionDesigning the Future: When Fact Meets Fiction
Designing the Future: When Fact Meets Fiction
 
How to Battle Bad Reviews
How to Battle Bad ReviewsHow to Battle Bad Reviews
How to Battle Bad Reviews
 
Activism x Technology
Activism x TechnologyActivism x Technology
Activism x Technology
 
Analytics Trends 2016: The next evolution
Analytics Trends 2016: The next evolutionAnalytics Trends 2016: The next evolution
Analytics Trends 2016: The next evolution
 
An introduction to CouchDB
An introduction to CouchDBAn introduction to CouchDB
An introduction to CouchDB
 
Word Power: 11 Techniques for Writing More Persuasive Copy
Word Power: 11 Techniques for Writing More Persuasive CopyWord Power: 11 Techniques for Writing More Persuasive Copy
Word Power: 11 Techniques for Writing More Persuasive Copy
 
Back-to-School Survey 2016
Back-to-School Survey 2016Back-to-School Survey 2016
Back-to-School Survey 2016
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 
20 Awesome Facts About Chocolate That You Need To Know For Valentine’s Day
20 Awesome Facts About Chocolate That You Need To Know For Valentine’s Day20 Awesome Facts About Chocolate That You Need To Know For Valentine’s Day
20 Awesome Facts About Chocolate That You Need To Know For Valentine’s Day
 
Software is Eating Bio
Software is Eating BioSoftware is Eating Bio
Software is Eating Bio
 
How to Use Social Media to Influence the World
How to Use Social Media to Influence the WorldHow to Use Social Media to Influence the World
How to Use Social Media to Influence the World
 
Secrets to a Great Team
Secrets to a Great TeamSecrets to a Great Team
Secrets to a Great Team
 

Similar a CouchDB

Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowKarsten Dambekalns
 
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...Andrew Liu
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011bostonrb
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemdelagoya
 
Analytics with Spark and Cassandra
Analytics with Spark and CassandraAnalytics with Spark and Cassandra
Analytics with Spark and CassandraDataStax Academy
 
Cassandra and Spark - Tim Berglund
Cassandra and Spark - Tim BerglundCassandra and Spark - Tim Berglund
Cassandra and Spark - Tim BerglundJAXLondon_Conference
 
New Developments in Spark
New Developments in SparkNew Developments in Spark
New Developments in SparkDatabricks
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introductionTse-Ching Ho
 
Five Lessons in Distributed Databases
Five Lessons  in Distributed DatabasesFive Lessons  in Distributed Databases
Five Lessons in Distributed Databasesjbellis
 
Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!mold
 
Getting Started with Amazon Redshift
 Getting Started with Amazon Redshift Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftAmazon Web Services
 
In-Memory Logical Data Warehouse for accelerating Machine Learning Pipelines ...
In-Memory Logical Data Warehouse for accelerating Machine Learning Pipelines ...In-Memory Logical Data Warehouse for accelerating Machine Learning Pipelines ...
In-Memory Logical Data Warehouse for accelerating Machine Learning Pipelines ...Gianmario Spacagna
 
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...Codemotion
 
Intro to CouchDB
Intro to CouchDBIntro to CouchDB
Intro to CouchDBbenaldred
 
Introduction to Apache Spark
Introduction to Apache Spark Introduction to Apache Spark
Introduction to Apache Spark Hubert Fan Chiang
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebJames Rakich
 
Optimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at LocalyticsOptimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at LocalyticsBenjamin Darfler
 
JS App Architecture
JS App ArchitectureJS App Architecture
JS App ArchitectureCorey Butler
 
Building Analytic Apps for SaaS: “Analytics as a Service”
Building Analytic Apps for SaaS: “Analytics as a Service”Building Analytic Apps for SaaS: “Analytics as a Service”
Building Analytic Apps for SaaS: “Analytics as a Service”Amazon Web Services
 
Spark & Cassandra at DataStax Meetup on Jan 29, 2015
Spark & Cassandra at DataStax Meetup on Jan 29, 2015 Spark & Cassandra at DataStax Meetup on Jan 29, 2015
Spark & Cassandra at DataStax Meetup on Jan 29, 2015 Sameer Farooqui
 

Similar a CouchDB (20)

Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 Flow
 
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
 
Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011Mongodb in-anger-boston-rb-2011
Mongodb in-anger-boston-rb-2011
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problem
 
Analytics with Spark and Cassandra
Analytics with Spark and CassandraAnalytics with Spark and Cassandra
Analytics with Spark and Cassandra
 
Cassandra and Spark - Tim Berglund
Cassandra and Spark - Tim BerglundCassandra and Spark - Tim Berglund
Cassandra and Spark - Tim Berglund
 
New Developments in Spark
New Developments in SparkNew Developments in Spark
New Developments in Spark
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introduction
 
Five Lessons in Distributed Databases
Five Lessons  in Distributed DatabasesFive Lessons  in Distributed Databases
Five Lessons in Distributed Databases
 
Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!
 
Getting Started with Amazon Redshift
 Getting Started with Amazon Redshift Getting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
In-Memory Logical Data Warehouse for accelerating Machine Learning Pipelines ...
In-Memory Logical Data Warehouse for accelerating Machine Learning Pipelines ...In-Memory Logical Data Warehouse for accelerating Machine Learning Pipelines ...
In-Memory Logical Data Warehouse for accelerating Machine Learning Pipelines ...
 
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
 
Intro to CouchDB
Intro to CouchDBIntro to CouchDB
Intro to CouchDB
 
Introduction to Apache Spark
Introduction to Apache Spark Introduction to Apache Spark
Introduction to Apache Spark
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Optimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at LocalyticsOptimizing MongoDB: Lessons Learned at Localytics
Optimizing MongoDB: Lessons Learned at Localytics
 
JS App Architecture
JS App ArchitectureJS App Architecture
JS App Architecture
 
Building Analytic Apps for SaaS: “Analytics as a Service”
Building Analytic Apps for SaaS: “Analytics as a Service”Building Analytic Apps for SaaS: “Analytics as a Service”
Building Analytic Apps for SaaS: “Analytics as a Service”
 
Spark & Cassandra at DataStax Meetup on Jan 29, 2015
Spark & Cassandra at DataStax Meetup on Jan 29, 2015 Spark & Cassandra at DataStax Meetup on Jan 29, 2015
Spark & Cassandra at DataStax Meetup on Jan 29, 2015
 

Más de codebits

Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands Oncodebits
 
Aplicações Web TV no Meo
Aplicações Web TV no MeoAplicações Web TV no Meo
Aplicações Web TV no Meocodebits
 
Forms Usability 101
Forms Usability 101Forms Usability 101
Forms Usability 101codebits
 
Speak up: como criar Speech-based apps
Speak up: como criar Speech-based appsSpeak up: como criar Speech-based apps
Speak up: como criar Speech-based appscodebits
 
XMPP Hands-On
XMPP Hands-OnXMPP Hands-On
XMPP Hands-Oncodebits
 
Mitos da Acessibilidade Web
Mitos da Acessibilidade WebMitos da Acessibilidade Web
Mitos da Acessibilidade Webcodebits
 
Getting started with mobile devices development - Openmoko Freerunner
Getting started with mobile devices development - Openmoko FreerunnerGetting started with mobile devices development - Openmoko Freerunner
Getting started with mobile devices development - Openmoko Freerunnercodebits
 
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...codebits
 
Getting started with mobile devices development - Openmoko Freerunner
Getting started with mobile devices development - Openmoko FreerunnerGetting started with mobile devices development - Openmoko Freerunner
Getting started with mobile devices development - Openmoko Freerunnercodebits
 
Exploring XMPP
Exploring XMPPExploring XMPP
Exploring XMPPcodebits
 
Sapo BUS Hands-On
Sapo BUS Hands-OnSapo BUS Hands-On
Sapo BUS Hands-Oncodebits
 
Qtractor - An Audio/MIDI multi-track sequencer
Qtractor - An Audio/MIDI multi-track sequencerQtractor - An Audio/MIDI multi-track sequencer
Qtractor - An Audio/MIDI multi-track sequencercodebits
 
Making the Chumby
Making the ChumbyMaking the Chumby
Making the Chumbycodebits
 
Globs - Gestão de Glossários
Globs - Gestão de GlossáriosGlobs - Gestão de Glossários
Globs - Gestão de Glossárioscodebits
 
ATrad - Sistema de Garantia de Qualidade de Traduções
ATrad - Sistema de Garantia de Qualidade de TraduçõesATrad - Sistema de Garantia de Qualidade de Traduções
ATrad - Sistema de Garantia de Qualidade de Traduçõescodebits
 
Alto Desempenho com Java
Alto Desempenho com JavaAlto Desempenho com Java
Alto Desempenho com Javacodebits
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-Oncodebits
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008codebits
 
Optimização de pesquisas Web utilizando Colónias de Formigas
Optimização de pesquisas Web utilizando Colónias de FormigasOptimização de pesquisas Web utilizando Colónias de Formigas
Optimização de pesquisas Web utilizando Colónias de Formigascodebits
 

Más de codebits (20)

Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands On
 
Aplicações Web TV no Meo
Aplicações Web TV no MeoAplicações Web TV no Meo
Aplicações Web TV no Meo
 
Forms Usability 101
Forms Usability 101Forms Usability 101
Forms Usability 101
 
Speak up: como criar Speech-based apps
Speak up: como criar Speech-based appsSpeak up: como criar Speech-based apps
Speak up: como criar Speech-based apps
 
XMPP Hands-On
XMPP Hands-OnXMPP Hands-On
XMPP Hands-On
 
Mitos da Acessibilidade Web
Mitos da Acessibilidade WebMitos da Acessibilidade Web
Mitos da Acessibilidade Web
 
Getting started with mobile devices development - Openmoko Freerunner
Getting started with mobile devices development - Openmoko FreerunnerGetting started with mobile devices development - Openmoko Freerunner
Getting started with mobile devices development - Openmoko Freerunner
 
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
 
Getting started with mobile devices development - Openmoko Freerunner
Getting started with mobile devices development - Openmoko FreerunnerGetting started with mobile devices development - Openmoko Freerunner
Getting started with mobile devices development - Openmoko Freerunner
 
Exploring XMPP
Exploring XMPPExploring XMPP
Exploring XMPP
 
Sapo BUS Hands-On
Sapo BUS Hands-OnSapo BUS Hands-On
Sapo BUS Hands-On
 
Qtractor - An Audio/MIDI multi-track sequencer
Qtractor - An Audio/MIDI multi-track sequencerQtractor - An Audio/MIDI multi-track sequencer
Qtractor - An Audio/MIDI multi-track sequencer
 
Making the Chumby
Making the ChumbyMaking the Chumby
Making the Chumby
 
Globs - Gestão de Glossários
Globs - Gestão de GlossáriosGlobs - Gestão de Glossários
Globs - Gestão de Glossários
 
ATrad - Sistema de Garantia de Qualidade de Traduções
ATrad - Sistema de Garantia de Qualidade de TraduçõesATrad - Sistema de Garantia de Qualidade de Traduções
ATrad - Sistema de Garantia de Qualidade de Traduções
 
Alto Desempenho com Java
Alto Desempenho com JavaAlto Desempenho com Java
Alto Desempenho com Java
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-On
 
Gis@sapo
Gis@sapoGis@sapo
Gis@sapo
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
 
Optimização de pesquisas Web utilizando Colónias de Formigas
Optimização de pesquisas Web utilizando Colónias de FormigasOptimização de pesquisas Web utilizando Colónias de Formigas
Optimização de pesquisas Web utilizando Colónias de Formigas
 

Último

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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
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
 
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
 

Último (20)

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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
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
 
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
 

CouchDB

  • 2. Who’s talking? jan@apache.org / @janl And you?
  • 3. RDBMS vs Just Storing Data Sorry for bashing!
  • 4. RDBMS vs Just Storing Data Design schema upfront Write or use software to translate your data into that schema …and back 1) beware of speed considerations without having an app to measure 2) or use an ORM which turns out to be a pain in the back for all sorts of reasons 3) Most Data is not inherently relational
  • 5.
  • 6.
  • 7. RDBMS vs Just Storing Data Isolated data records called Documents No schema (!) and semi- structured data records that make up the app’s data objects
  • 8. Documents in the Real World
  • 9. Documents in the Real World Bills, tax forms, letters… Same type != same structure Can be out of date Natural data behaviour Actual data record, no pointer
  • 10. { “_id”: ”BCCD12CBB”, “_rev”: ”AB764C”, “type”: ”person”, “name”: ”Darth Vader”, “age”: 63, “headware”: [“Helmet”, “Sombrero”], “dark_side”: true }
  • 11. { “_id”: ”BCCD12CBB”, “_rev”: ”AB764C”, “type”: ”person”, “name”: ”Darth Vader”, “age”: 63, “headware”: [“Helmet”, “Sombrero”], “dark_side”: true }
  • 12. { “_id”: ”BCCD12CBB”, “_rev”: ”AB764C”, “type”: ”person”, “name”: ”Darth Vader”, “age”: 63, “headware”: [“Helmet”, “Sombrero”], “dark_side”: true }
  • 13. { “_id”: ”BCCD12CBB”, “_rev”: ”AB764C”, “type”: ”person”, “name”: ”Darth Vader”, “age”: 63, “headware”: [“Helmet”, “Sombrero”], “dark_side”: true }
  • 14. CRUD — Arbeiten mit Dokumenten Create: HTTP POST /db/BCCD12CBB Read: HTTP GET /db/BCCD12CBB Update: HTTP PUT /db/BCCD12CBB Delete: HTTP DELETE /db/BCCD12CBB
  • 15. $ curl -X GET http://server/ database/document {“_id”:”ABC”,“_rev”:”1D4”,”data ”:...} $
  • 16. Zend_Http_Client <?php $url = 'http://server:5984/db/doc'; $client = new Zend_Http_Client($url); $response = $client->request('GET'); echo $response->getBody();
  • 17. PHPillow – Kore Nordmann <?php $doc = new myBlogDocument(); $doc->title = 'New blog post'; $doc->text = 'Hello world.'; $doc->save(); echo $doc->_id; $doc = myBlogDocument::fetchById('123');
  • 19. Views Filter, Collate, Aggregate Powered by Map/Reduce Design documents functions get executed, you don’t do that
  • 20. View Examples – Docs by Date Key Value [2007, 10, 12, 20, 13, 12] {quot;_idquot;:quot;...quot;} [2007, 12, 26, 8, 37, 55] {quot;_idquot;:quot;...quot;} [2008, 2, 3, 10, 22, 34] {quot;_idquot;:quot;...quot;} [2008, 5, 1, 14, 16, 11] {quot;_idquot;:quot;...quot;}
  • 21. View Examples – Docs by Date function(doc) { emit(doc.date, doc); }
  • 22. View Examples – Docs by Date function(doc) { emit(<key>, <value>); }
  • 23. Views Built incrementally… …and on demand Reduce optional map/reduce can be parallelised
  • 26. Replication Take your data with you CouchDB makes it easy to synchronise machines rsync-like Large spectrum of architectures: - P2P, Failover, Load Balancing, Backup Conflicts: auto-detect & resolve, data consistency
  • 27. Built for the Future Written in Erlang - a telco- grade concurrent platform Non-locking MVCC and ACID compliant data store Erlang Processes + messaging Ericsson AXD 301 - nine nines - 1/30th second per year Crash resistant
  • 28. Number Bragging Silly read-only benchmark with memory saturation 2,500 req/s sustained on a 2Ghz dual core Athlon
  • 29. Number Bragging Silly read-only benchmark with memory saturation 2,500 req/s sustained on a 2Ghz dual core Athlon Using 9.8 MB RAM
  • 30. A Little History Damien Katz self funded fulltime development for 2 years Now backed by IBM
  • 31.
  • 32. A Little History Accepted to the Apache Software Foundation Open Source License
  • 33.
  • 36. Where is my auto increment What is auto_increment? Unique identifier Sequence denominator
  • 37. Where is my auto_increment? Documents have `_id`s Sequences in distributed applications are not Timestamps get you a long way, though.
  • 38. Relation(ship)s JOINs plz! What for? Get data that “belongs together”
  • 39. Relation(ship)s One big fat doc? Pros: Easy – Cons: Bad with the concurrent updates Use for: Low volume updates e.g. user-supplied tags
  • 40. Relation(ship)s Master Doc – Slave Doc Pros: A little complex – Cons: Fast, good with concurrent updates, tree operations Use for: Everything else
  • 41. Relation(ship)s function(doc) { if(doc.ismaster) { emit([doc._id, doc.date], doc); } else { emit([doc.master_id, doc.date], doc); } }
  • 42. Relation(ship)s ... ... [quot;BAAC67quot;, quot;2008-09-21quot;] {quot;is_parentquot;,true} [quot;BAAC67quot;, quot;2008-09-22quot;] {quot;...quot;,quot;...quot;} [quot;BAAC67quot;, quot;2008-09-23quot;] {quot;...quot;,quot;...quot;} [quot;BAAC67quot;, quot;2008-09-24quot;] {quot;...quot;,quot;...quot;} ... ...
  • 43. Transactions! Run multiple operations at once They all succeed or none gets applied
  • 44. Transactions POST { quot;docsquot;: [ {quot;_idquot;: quot;0quot;, quot;intquot;: 0, quot;strquot;: quot;0quot;}, {quot;_idquot;: quot;1quot;, quot;intquot;: 1, quot;strquot;: quot;1quot;}, {quot;_idquot;: quot;2quot;, quot;intquot;: 2, quot;strquot;: quot;2quot;} ] }
  • 45. Transactions! Caveats: Statement transaction No data transaction No multi-node transactions
  • 46. Multi-Node Transactions! Why? – Data redundancy Use an HTTP proxy Nice to build on standard protocols Caveat: 2-phase-commit in disguise
  • 48. View Examples – Docs by Date Map Key Value [2007, 10, 12, 20, 13, 12] 3465 [2007, 12, 26, 8, 37, 55] 4200 [2008, 2, 3, 10, 22, 34] 3782 [2008, 5, 1, 14, 16, 11] 5984
  • 49. View Examples – Docs by Date Reduce Key Value null 17431
  • 50. View Examples – Docs by Date Reduce with group_level=1 Key Value [2007] 7665 [2008] 9766
  • 51. View Examples – Docs by Date Map Key Value [2007, 10, 12, 20, 13, 12] 3465 [2007, 12, 26, 8, 37, 55] 4200 [2008, 2, 3, 10, 22, 34] 3782 [2008, 5, 1, 14, 16, 11] 5984
  • 53. Hot backup? $ cp -r /var/lib/couchdb/* /mnt/backup
  • 54. Resources Twitter: @CouchDB & http://couchdb.org/ Dress like a Couch: http://shop.couchdb.com http://damienkatz.net/ & http://jan.prima.de/ http://blog.racklabs.com/?p=74 https://peepcode.com/products/couchdb- with-rails not covered everything, other talks + tutorials
  • 57. Built for the Future “640k processors should be enough for anybody.”
  • 63. Lots of small servers Today
  • 64. CPU, RAM and disks == $$$ Back then