SlideShare une entreprise Scribd logo
1  sur  53
Télécharger pour lire hors ligne
BDhcuoC
Who’s talking?

         Jan Lehnardt
         CouchDB Developer
         jan@apache.org


And you?
Who hasn't seen previous talk? Joe's Talk? Tim's?
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
Views
of Keys and Values
Views — Map Tags
              Keys     Values
             family      1
             friends     1
             friends     1
              work       1
              work       1
             youtube     1
               …         …
Views — Reduce Tag Count
 Keys     Values    Keys     Values
family      1
                   family      1
friends     1
friends     1      friends     2
 work       1       work       2
 work       1
                   youtube     1
youtube     1
  …         …        …         …
Views — Map Tags


function (doc) {
  for(var i in doc.tags)
    emit(doc.tags[i], 1);
}
Views — Reduce Tag Count
 Keys     Values    Keys     Values
family      1
                   family      1
friends     1
friends     1      friends     2
 work       1       work       2
 work       1
                   youtube     1
youtube     1
  …         …        …         …
Views — Reduce Tag Count

     function (key, values)
     {
       var sum = 0;
       for(var i in values)
         sum += values[i];
       return sum;
     }


Incremental, On-demand
reduce optional
View Examples – Docs by Date


function(doc) {
  emit(doc.date, doc.amount);
}


  [2007, 10, 12, 20, 13, 12]   3000
View Examples – Docs by Date
                 Map

           Key               Value

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

[2007, 10, 26, 08, 37, 55]   4000

[2008, 02, 03, 10, 22, 34]   2000

[2008, 05, 01, 14, 16, 11]   6000
View Examples – Docs by Date


function(key, values) {
  return sum(values);
}
View Examples – Docs by Date
               Reduce

        Key             Value

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

         Key                  Value

        [2007]                7000

        [2008]                8000
View Examples – Docs by Date
                  Reduce with group_level = 2

                              Key                                      Value

                      [2007, 10]                                       7000

                      [2008, 02]                                       2000

                      [2008, 05]                                       6000




Just the beginning, knock yourself out, averages, standard deviation, jchris twitter tag cloud
ranking.
Relation(ship)s
http://flickr.com/photos/fazen
Relation(ship)s
 JOINs please!
 What for?
 Get data that “belongs
 together”
Relation(ship)s — One Big Doc
{
    "type": "person",
    "name": "Darth Vader",
    "children":[
      {"name": "Luke"...},
      {"name": "Leia"...}
    ],
    "dark_side": true
}
Relation(ship)s — One Big Doc


           Pros: Easy – Cons: Bad with
           concurrent updates
           Use for: Low volume updates


e.g. user-supplied tags, postings
Relation(ship)s — Master-
Slave Docs
 Cons: A little more complex –
 Pros: Fast; good with
 concurrent updates; gives you
 tree operations
 Use for: Everything else
Relation(ship)s
function(doc) {
  if(doc.is_master) {
    emit([doc._id, doc.date], doc);
  } else {
    emit([doc.master_id, doc.date], doc);
  }
}
Relation(ship)s
                        ...              ...
  ["BAAC67", "2008-09-21"]        {"is_parent",true}
  ["BAAC67", "2008-09-22"]          {"...","..."}
  ["BAAC67", "2008-09-23"]          {"...","..."}
  ["BAAC67", "2008-09-24"]          {"...","..."}
  ["DBCA82", "2008-09-21"]        {"is_parent",true}
                        ...              ...

arbitrary trees, deeper nesting
Where is my auto_increment
 What is auto_increment?
 Unique identifier
 Sequence denominator
Where is my auto_increment?




what's it used for? identification, sequences / sorting
location prefixes, datacenters, digg, facebook
Where is my auto_increment?
        Documents have _ids




what's it used for? identification, sequences / sorting
location prefixes, datacenters, digg, facebook
Where is my auto_increment?
        Documents have _ids
         Sequences in distributed
         databases are…




what's it used for? identification, sequences / sorting
location prefixes, datacenters, digg, facebook
Where is my auto_increment?
        Documents have _ids
         Sequences in distributed
         databases are…
         …not


what's it used for? identification, sequences / sorting
location prefixes, datacenters, digg, facebook
Where is my auto_increment?
        Documents have _ids
         Sequences in distributed
         databases are…
         …not
         Use natural keys
what's it used for? identification, sequences / sorting
location prefixes, datacenters, digg, facebook
Transactions
 Run multiple operations at
 once
 They all succeed or none gets
 applied
Transactions
POST
{
  "docs": [
    {"_id": "0", "int": 0, "str": "0"},
    {"_id": "1", "int": 1, "str": "1"},
    {"_id": "2", "int": 2, "str": "2"}
  ]
}
Transactions — Watch out
 Statement transaction, not
 data transaction
 No roundtripping
 No multi-node transactions
 (It's a good thing)
Multi-Node Transactions
 Why? – Data redundancy
 Use an HTTP proxy
 Nice and easy to build on
 standard protocols
 Projects in development for
 consistent hashing & Paxos
Architectures
periodic, notifier system
P2P apps
Hot backup?



 POSIX compliant
Hot backup?



$ cp -r /var/lib/couchdb/* 
  /mnt/backup
Commercial Break
The Book

O'Reilly
http://books.couchdb.org/relax
Apache 2.0 Licensed
Summer 2009
The Book —Can’t wait?

 Help CouchDB
 Hire me for Consulting,
 Training, Development
 jan@apache.org
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
Jan Lehnardt Couch Db In A Real World Setting

Contenu connexe

Tendances

Building a Social Network with MongoDB
  Building a Social Network with MongoDB  Building a Social Network with MongoDB
Building a Social Network with MongoDB
Fred Chu
 
Distributed DataFrame (DDF) Simplifying Big Data For The Rest Of Us
Distributed DataFrame (DDF) Simplifying Big Data  For The Rest Of UsDistributed DataFrame (DDF) Simplifying Big Data  For The Rest Of Us
Distributed DataFrame (DDF) Simplifying Big Data For The Rest Of Us
Arimo, Inc.
 
Java Development with MongoDB
Java Development with MongoDBJava Development with MongoDB
Java Development with MongoDB
Scott Hernandez
 

Tendances (20)

CodeIgniter Class Reference
CodeIgniter Class ReferenceCodeIgniter Class Reference
CodeIgniter Class Reference
 
Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling
 
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
 
Schema Design with MongoDB
Schema Design with MongoDBSchema Design with MongoDB
Schema Design with MongoDB
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in Documents
 
Building a Social Network with MongoDB
  Building a Social Network with MongoDB  Building a Social Network with MongoDB
Building a Social Network with MongoDB
 
Indexing
IndexingIndexing
Indexing
 
Introduction To Core Data
Introduction To Core DataIntroduction To Core Data
Introduction To Core Data
 
MongoDB World 2018: Using Change Streams to Keep Up with Your Data
MongoDB World 2018: Using Change Streams to Keep Up with Your DataMongoDB World 2018: Using Change Streams to Keep Up with Your Data
MongoDB World 2018: Using Change Streams to Keep Up with Your Data
 
Montreal Sql saturday: moving data from no sql db to azure data lake
Montreal Sql saturday: moving data from no sql db to azure data lakeMontreal Sql saturday: moving data from no sql db to azure data lake
Montreal Sql saturday: moving data from no sql db to azure data lake
 
Dealing with Azure Cosmos DB
Dealing with Azure Cosmos DBDealing with Azure Cosmos DB
Dealing with Azure Cosmos DB
 
Building a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and JavaBuilding a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and Java
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
The State of NoSQL
The State of NoSQLThe State of NoSQL
The State of NoSQL
 
Distributed DataFrame (DDF) Simplifying Big Data For The Rest Of Us
Distributed DataFrame (DDF) Simplifying Big Data  For The Rest Of UsDistributed DataFrame (DDF) Simplifying Big Data  For The Rest Of Us
Distributed DataFrame (DDF) Simplifying Big Data For The Rest Of Us
 
Database2
Database2Database2
Database2
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 
Webinar: Schema Design
Webinar: Schema DesignWebinar: Schema Design
Webinar: Schema Design
 
Java Development with MongoDB
Java Development with MongoDBJava Development with MongoDB
Java Development with MongoDB
 
MySQL Rises with JSON Support
MySQL Rises with JSON SupportMySQL Rises with JSON Support
MySQL Rises with JSON Support
 

En vedette

Couch Db In 60 Minutes
Couch Db In 60 MinutesCouch Db In 60 Minutes
Couch Db In 60 Minutes
George Ang
 
Laravel - back-end framework in persian language
Laravel - back-end framework in persian languageLaravel - back-end framework in persian language
Laravel - back-end framework in persian language
Omid Khosrojerdi
 
Couch db@nosql+taiwan
Couch db@nosql+taiwanCouch db@nosql+taiwan
Couch db@nosql+taiwan
Kenzou Yeh
 
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
Stefan Kögl
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on Android
Sven Haiges
 

En vedette (19)

Couchdb
CouchdbCouchdb
Couchdb
 
Couch db and_the_web
Couch db and_the_webCouch db and_the_web
Couch db and_the_web
 
Couch db
Couch dbCouch db
Couch db
 
Couch Db In 60 Minutes
Couch Db In 60 MinutesCouch Db In 60 Minutes
Couch Db In 60 Minutes
 
HamidHamed-Twitter
HamidHamed-TwitterHamidHamed-Twitter
HamidHamed-Twitter
 
No sql Database
No sql DatabaseNo sql Database
No sql Database
 
Meet Couch DB
Meet Couch DBMeet Couch DB
Meet Couch DB
 
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
 
Aws, play! couch db scaling soa in the cloud
Aws, play! couch db  scaling soa in the cloudAws, play! couch db  scaling soa in the cloud
Aws, play! couch db scaling soa in the cloud
 
Laravel - back-end framework in persian language
Laravel - back-end framework in persian languageLaravel - back-end framework in persian language
Laravel - back-end framework in persian language
 
Couch db@nosql+taiwan
Couch db@nosql+taiwanCouch db@nosql+taiwan
Couch db@nosql+taiwan
 
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
 
Couch db skillsmatter-prognosql
Couch db skillsmatter-prognosqlCouch db skillsmatter-prognosql
Couch db skillsmatter-prognosql
 
MongoDB
MongoDBMongoDB
MongoDB
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on Android
 
اسلايد آموزشي هوش تجاري
اسلايد آموزشي هوش تجارياسلايد آموزشي هوش تجاري
اسلايد آموزشي هوش تجاري
 
Intro To Couch Db
Intro To Couch DbIntro To Couch Db
Intro To Couch Db
 
Couch db
Couch dbCouch db
Couch db
 
معماری جاری نرم افزار های شرکت
معماری جاری نرم افزار های شرکتمعماری جاری نرم افزار های شرکت
معماری جاری نرم افزار های شرکت
 

Similaire à Jan Lehnardt Couch Db In A Real World Setting

2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new
MongoDB
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
MongoDB
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
MongoDB
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
MongoDB
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
MongoDB
 
PHP Development With MongoDB
PHP Development With MongoDBPHP Development With MongoDB
PHP Development With MongoDB
Fitz Agard
 

Similaire à Jan Lehnardt Couch Db In A Real World Setting (20)

CouchDB
CouchDBCouchDB
CouchDB
 
2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
 
AMD - Why, What and How
AMD - Why, What and HowAMD - Why, What and How
AMD - Why, What and How
 
When Relational Isn't Enough: Neo4j at Squidoo
When Relational Isn't Enough: Neo4j at SquidooWhen Relational Isn't Enough: Neo4j at Squidoo
When Relational Isn't Enough: Neo4j at Squidoo
 
Hadoop
HadoopHadoop
Hadoop
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
 
Unlock user behavior with 87 Million events using Hudi, StarRocks & MinIO
Unlock user behavior with 87 Million events using Hudi, StarRocks & MinIOUnlock user behavior with 87 Million events using Hudi, StarRocks & MinIO
Unlock user behavior with 87 Million events using Hudi, StarRocks & MinIO
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
 
Scaling Big Data Mining Infrastructure Twitter Experience
Scaling Big Data Mining Infrastructure Twitter ExperienceScaling Big Data Mining Infrastructure Twitter Experience
Scaling Big Data Mining Infrastructure Twitter Experience
 
New Developments in Spark
New Developments in SparkNew Developments in Spark
New Developments in Spark
 
Stream Execution with Clojure and Fork/join
Stream Execution with Clojure and Fork/joinStream Execution with Clojure and Fork/join
Stream Execution with Clojure and Fork/join
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & Analytics
 
Evolution of Spark APIs
Evolution of Spark APIsEvolution of Spark APIs
Evolution of Spark APIs
 
Green dao
Green daoGreen dao
Green dao
 
Latinoware
LatinowareLatinoware
Latinoware
 
Your Database Cannot Do this (well)
Your Database Cannot Do this (well)Your Database Cannot Do this (well)
Your Database Cannot Do this (well)
 
GOTO 2011 preso: 3x Hadoop
GOTO 2011 preso: 3x HadoopGOTO 2011 preso: 3x Hadoop
GOTO 2011 preso: 3x Hadoop
 
PHP Development With MongoDB
PHP Development With MongoDBPHP Development With MongoDB
PHP Development With MongoDB
 

Plus de George Ang

Wrapper induction construct wrappers automatically to extract information f...
Wrapper induction   construct wrappers automatically to extract information f...Wrapper induction   construct wrappers automatically to extract information f...
Wrapper induction construct wrappers automatically to extract information f...
George Ang
 
Opinion mining and summarization
Opinion mining and summarizationOpinion mining and summarization
Opinion mining and summarization
George Ang
 
Huffman coding
Huffman codingHuffman coding
Huffman coding
George Ang
 
Do not crawl in the dust 
different ur ls similar text
Do not crawl in the dust 
different ur ls similar textDo not crawl in the dust 
different ur ls similar text
Do not crawl in the dust 
different ur ls similar text
George Ang
 
大规模数据处理的那些事儿
大规模数据处理的那些事儿大规模数据处理的那些事儿
大规模数据处理的那些事儿
George Ang
 
腾讯大讲堂02 休闲游戏发展的文化趋势
腾讯大讲堂02 休闲游戏发展的文化趋势腾讯大讲堂02 休闲游戏发展的文化趋势
腾讯大讲堂02 休闲游戏发展的文化趋势
George Ang
 
腾讯大讲堂03 qq邮箱成长历程
腾讯大讲堂03 qq邮箱成长历程腾讯大讲堂03 qq邮箱成长历程
腾讯大讲堂03 qq邮箱成长历程
George Ang
 
腾讯大讲堂04 im qq
腾讯大讲堂04 im qq腾讯大讲堂04 im qq
腾讯大讲堂04 im qq
George Ang
 
腾讯大讲堂05 面向对象应对之道
腾讯大讲堂05 面向对象应对之道腾讯大讲堂05 面向对象应对之道
腾讯大讲堂05 面向对象应对之道
George Ang
 
腾讯大讲堂06 qq邮箱性能优化
腾讯大讲堂06 qq邮箱性能优化腾讯大讲堂06 qq邮箱性能优化
腾讯大讲堂06 qq邮箱性能优化
George Ang
 
腾讯大讲堂07 qq空间
腾讯大讲堂07 qq空间腾讯大讲堂07 qq空间
腾讯大讲堂07 qq空间
George Ang
 
腾讯大讲堂08 可扩展web架构探讨
腾讯大讲堂08 可扩展web架构探讨腾讯大讲堂08 可扩展web架构探讨
腾讯大讲堂08 可扩展web架构探讨
George Ang
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站
George Ang
 
腾讯大讲堂01 移动qq产品发展历程
腾讯大讲堂01 移动qq产品发展历程腾讯大讲堂01 移动qq产品发展历程
腾讯大讲堂01 移动qq产品发展历程
George Ang
 
腾讯大讲堂10 customer engagement
腾讯大讲堂10 customer engagement腾讯大讲堂10 customer engagement
腾讯大讲堂10 customer engagement
George Ang
 
腾讯大讲堂11 拍拍ce工作经验分享
腾讯大讲堂11 拍拍ce工作经验分享腾讯大讲堂11 拍拍ce工作经验分享
腾讯大讲堂11 拍拍ce工作经验分享
George Ang
 
腾讯大讲堂14 qq直播(qq live) 介绍
腾讯大讲堂14 qq直播(qq live) 介绍腾讯大讲堂14 qq直播(qq live) 介绍
腾讯大讲堂14 qq直播(qq live) 介绍
George Ang
 
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
George Ang
 
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
George Ang
 
腾讯大讲堂16 产品经理工作心得分享
腾讯大讲堂16 产品经理工作心得分享腾讯大讲堂16 产品经理工作心得分享
腾讯大讲堂16 产品经理工作心得分享
George Ang
 

Plus de George Ang (20)

Wrapper induction construct wrappers automatically to extract information f...
Wrapper induction   construct wrappers automatically to extract information f...Wrapper induction   construct wrappers automatically to extract information f...
Wrapper induction construct wrappers automatically to extract information f...
 
Opinion mining and summarization
Opinion mining and summarizationOpinion mining and summarization
Opinion mining and summarization
 
Huffman coding
Huffman codingHuffman coding
Huffman coding
 
Do not crawl in the dust 
different ur ls similar text
Do not crawl in the dust 
different ur ls similar textDo not crawl in the dust 
different ur ls similar text
Do not crawl in the dust 
different ur ls similar text
 
大规模数据处理的那些事儿
大规模数据处理的那些事儿大规模数据处理的那些事儿
大规模数据处理的那些事儿
 
腾讯大讲堂02 休闲游戏发展的文化趋势
腾讯大讲堂02 休闲游戏发展的文化趋势腾讯大讲堂02 休闲游戏发展的文化趋势
腾讯大讲堂02 休闲游戏发展的文化趋势
 
腾讯大讲堂03 qq邮箱成长历程
腾讯大讲堂03 qq邮箱成长历程腾讯大讲堂03 qq邮箱成长历程
腾讯大讲堂03 qq邮箱成长历程
 
腾讯大讲堂04 im qq
腾讯大讲堂04 im qq腾讯大讲堂04 im qq
腾讯大讲堂04 im qq
 
腾讯大讲堂05 面向对象应对之道
腾讯大讲堂05 面向对象应对之道腾讯大讲堂05 面向对象应对之道
腾讯大讲堂05 面向对象应对之道
 
腾讯大讲堂06 qq邮箱性能优化
腾讯大讲堂06 qq邮箱性能优化腾讯大讲堂06 qq邮箱性能优化
腾讯大讲堂06 qq邮箱性能优化
 
腾讯大讲堂07 qq空间
腾讯大讲堂07 qq空间腾讯大讲堂07 qq空间
腾讯大讲堂07 qq空间
 
腾讯大讲堂08 可扩展web架构探讨
腾讯大讲堂08 可扩展web架构探讨腾讯大讲堂08 可扩展web架构探讨
腾讯大讲堂08 可扩展web架构探讨
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站
 
腾讯大讲堂01 移动qq产品发展历程
腾讯大讲堂01 移动qq产品发展历程腾讯大讲堂01 移动qq产品发展历程
腾讯大讲堂01 移动qq产品发展历程
 
腾讯大讲堂10 customer engagement
腾讯大讲堂10 customer engagement腾讯大讲堂10 customer engagement
腾讯大讲堂10 customer engagement
 
腾讯大讲堂11 拍拍ce工作经验分享
腾讯大讲堂11 拍拍ce工作经验分享腾讯大讲堂11 拍拍ce工作经验分享
腾讯大讲堂11 拍拍ce工作经验分享
 
腾讯大讲堂14 qq直播(qq live) 介绍
腾讯大讲堂14 qq直播(qq live) 介绍腾讯大讲堂14 qq直播(qq live) 介绍
腾讯大讲堂14 qq直播(qq live) 介绍
 
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
 
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
 
腾讯大讲堂16 产品经理工作心得分享
腾讯大讲堂16 产品经理工作心得分享腾讯大讲堂16 产品经理工作心得分享
腾讯大讲堂16 产品经理工作心得分享
 

Dernier

Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort GoaDesi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
russian goa call girl and escorts service
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
aamir
 
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
mriyagarg453
 

Dernier (20)

❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
 
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
 
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
 
Tikiapara Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex A...
Tikiapara Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex A...Tikiapara Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex A...
Tikiapara Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex A...
 
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
 
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
 
Independent Diamond Harbour Escorts ✔ 9332606886✔ Full Night With Room Online...
Independent Diamond Harbour Escorts ✔ 9332606886✔ Full Night With Room Online...Independent Diamond Harbour Escorts ✔ 9332606886✔ Full Night With Room Online...
Independent Diamond Harbour Escorts ✔ 9332606886✔ Full Night With Room Online...
 
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingAlmora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
 
Top Rated Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort GoaDesi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
 
Bhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRL
Bhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRLBhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRL
Bhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRL
 
Borum Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Borum Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceBorum Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Borum Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
 
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
 
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
 
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
 
Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034 Independent Chenna...
 
📞 Contact Number 8617697112 VIP Ganderbal Call Girls
📞 Contact Number 8617697112 VIP Ganderbal Call Girls📞 Contact Number 8617697112 VIP Ganderbal Call Girls
📞 Contact Number 8617697112 VIP Ganderbal Call Girls
 
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
 
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
 

Jan Lehnardt Couch Db In A Real World Setting

  • 2. Who’s talking? Jan Lehnardt CouchDB Developer jan@apache.org And you? Who hasn't seen previous talk? Joe's Talk? Tim's?
  • 3. Number Bragging Silly read-only benchmark with memory saturation 2,500 req/s sustained on a 2Ghz dual core Athlon
  • 4. 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
  • 6. Views — Map Tags Keys Values family 1 friends 1 friends 1 work 1 work 1 youtube 1 … …
  • 7. Views — Reduce Tag Count Keys Values Keys Values family 1 family 1 friends 1 friends 1 friends 2 work 1 work 2 work 1 youtube 1 youtube 1 … … … …
  • 8. Views — Map Tags function (doc) { for(var i in doc.tags) emit(doc.tags[i], 1); }
  • 9. Views — Reduce Tag Count Keys Values Keys Values family 1 family 1 friends 1 friends 1 friends 2 work 1 work 2 work 1 youtube 1 youtube 1 … … … …
  • 10. Views — Reduce Tag Count function (key, values) { var sum = 0; for(var i in values) sum += values[i]; return sum; } Incremental, On-demand reduce optional
  • 11. View Examples – Docs by Date function(doc) { emit(doc.date, doc.amount); } [2007, 10, 12, 20, 13, 12] 3000
  • 12. View Examples – Docs by Date Map Key Value [2007, 10, 12, 20, 13, 12] 3000 [2007, 10, 26, 08, 37, 55] 4000 [2008, 02, 03, 10, 22, 34] 2000 [2008, 05, 01, 14, 16, 11] 6000
  • 13. View Examples – Docs by Date function(key, values) { return sum(values); }
  • 14. View Examples – Docs by Date Reduce Key Value null 15000
  • 15. View Examples – Docs by Date Reduce with group_level = 1 Key Value [2007] 7000 [2008] 8000
  • 16. View Examples – Docs by Date Reduce with group_level = 2 Key Value [2007, 10] 7000 [2008, 02] 2000 [2008, 05] 6000 Just the beginning, knock yourself out, averages, standard deviation, jchris twitter tag cloud ranking.
  • 18. Relation(ship)s JOINs please! What for? Get data that “belongs together”
  • 19. Relation(ship)s — One Big Doc { "type": "person", "name": "Darth Vader", "children":[ {"name": "Luke"...}, {"name": "Leia"...} ], "dark_side": true }
  • 20. Relation(ship)s — One Big Doc Pros: Easy – Cons: Bad with concurrent updates Use for: Low volume updates e.g. user-supplied tags, postings
  • 21. Relation(ship)s — Master- Slave Docs Cons: A little more complex – Pros: Fast; good with concurrent updates; gives you tree operations Use for: Everything else
  • 22. Relation(ship)s function(doc) { if(doc.is_master) { emit([doc._id, doc.date], doc); } else { emit([doc.master_id, doc.date], doc); } }
  • 23. Relation(ship)s ... ... ["BAAC67", "2008-09-21"] {"is_parent",true} ["BAAC67", "2008-09-22"] {"...","..."} ["BAAC67", "2008-09-23"] {"...","..."} ["BAAC67", "2008-09-24"] {"...","..."} ["DBCA82", "2008-09-21"] {"is_parent",true} ... ... arbitrary trees, deeper nesting
  • 24. Where is my auto_increment What is auto_increment? Unique identifier Sequence denominator
  • 25. Where is my auto_increment? what's it used for? identification, sequences / sorting location prefixes, datacenters, digg, facebook
  • 26. Where is my auto_increment? Documents have _ids what's it used for? identification, sequences / sorting location prefixes, datacenters, digg, facebook
  • 27. Where is my auto_increment? Documents have _ids Sequences in distributed databases are… what's it used for? identification, sequences / sorting location prefixes, datacenters, digg, facebook
  • 28. Where is my auto_increment? Documents have _ids Sequences in distributed databases are… …not what's it used for? identification, sequences / sorting location prefixes, datacenters, digg, facebook
  • 29. Where is my auto_increment? Documents have _ids Sequences in distributed databases are… …not Use natural keys what's it used for? identification, sequences / sorting location prefixes, datacenters, digg, facebook
  • 30. Transactions Run multiple operations at once They all succeed or none gets applied
  • 31. Transactions POST { "docs": [ {"_id": "0", "int": 0, "str": "0"}, {"_id": "1", "int": 1, "str": "1"}, {"_id": "2", "int": 2, "str": "2"} ] }
  • 32. Transactions — Watch out Statement transaction, not data transaction No roundtripping No multi-node transactions (It's a good thing)
  • 33. Multi-Node Transactions Why? – Data redundancy Use an HTTP proxy Nice and easy to build on standard protocols Projects in development for consistent hashing & Paxos
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 43.
  • 45. Hot backup? POSIX compliant
  • 46. Hot backup? $ cp -r /var/lib/couchdb/* /mnt/backup
  • 49. The Book —Can’t wait? Help CouchDB Hire me for Consulting, Training, Development jan@apache.org
  • 50. 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