SlideShare a Scribd company logo
1 of 32
Download to read offline
CouchDB

King Chung Huang
Information Technologies
   University of Calgary
Relax
Document-oriented Databases
Today’s Talk   CouchDB Overview
               Demonstrations
Document-oriented Databases
Databases
Flat
Hierarchical
   Network
 Relational Databases
Post-Relational Databases
     Dimensional
            Object
Document-oriented
Document-oriented Databases
    Comparable to documents in the real world
•

    Records are stored as schema-less documents
•
         Each document is uniquely named
     ■



         Documents are the primary unit of storage
     ■



    Structures are not explicitly defined
•
         No tables with uniform, pre-defined fields
     ■



         Every document can have varying fields of different types
     ■



    Documents are self contained
•
         Data is not decomposed into tables with relations
     ■



         Documents contain the context needed to understand them
     ■
Document-oriented Databases
    Examples
•
         Lotus Notes
     ■



         Amazon SimpleDB
     ■



         CouchDB
     ■




    Key-Value Stores
•
         Amazon S3
     ■



            Dynamo: Amazon’s Highly Available Key-value Store, DeCandia, et al., 2007
          ■



         Facebook Cassandra
     ■



            Recently accepted as an Apache incubation project
          ■



         Google BigTable
     ■



            Bigtable: A Distributed Storage System for Structured Data, Chang, et al.,
          ■


            2006
CouchDB Overview
Document database server
                   REST API
What is CouchDB?   JSON documents
                   Views with MapReduce
                   Highly Scalable
Document Database Server
    Implemented in Erlang
•
         Ericsson Language
     ■



         Highly concurrent, functional programming language
     ■



    Designed with modern web applications in mind
•

    Atomic Consistent Isolated Durable (ACID)
•

    “Crash-only” design
•

    Supports external handlers
•
         Change notification
     ■



         Custom processing
     ■



•
REST HTTP API
    Representational State Transfer
•
         A set of principles about how resources are defined and addressed
     ■




    World Wide Web (HTTP) is RESTful
•
         Uniform interface for accessing resources
     ■



         Resources identified by URI
     ■



         Actions transmitted in HTTP methods
     ■



         Status communicated in status codes
     ■
REST HTTP API
CRUD
  Create, Read, Update, and Delete
•
• In HTTP
        POST /some/resource/id
    ■



        GET /some/resource/id
    ■



        PUT /some/resource/id
    ■



        DELETE /some/resource/id
    ■
JSON Documents
    JavaScript Object Notation
•
         Considered language-independent
     ■




    CouchDB stored XML documents before version 0.8
•
         Suitable if content is already in XML
     ■



         Human readable, but can be onerous to type
     ■



         Markup language, requires transformation from/to data structures
     ■



    Represents primitive data types and structures
•
         Strings, numbers, booleans
     ■



         Arrays, dictionaries
     ■



         Null
     ■




    Documents can have attachments
•
JSON Documents
Example
{
                   _id:   “post1”,
                  _rev:   “123456”,
                 title:   “A Blog Post”,
                  tags:   [“blue”, “glue”],
             post_date:   1239910768,
                  body:   “Once upon a time…”,
          is_published:   true
}
JSON Documents
Example
{
                   _id:   “post1”,
                  _rev:   “123456”,
                 title:   “A Blog Post”,
                  tags:   [“blue”, “glue”],
             post_date:   1239910768,
                  body:   “Once upon a time…”,
          is_published:   true
}
JSON Documents
Example
{
                   _id:   “post1”,
                  _rev:   “123456”,
                 title:   “A Blog Post”,
                  tags:   [“blue”, “glue”],
             post_date:   1239910768,
                  body:   “Once upon a time…”,
          is_published:   true
}
JSON Documents
Example
{
                   _id:   “post1”,
                  _rev:   “123456”,
                 title:   “A Blog Post”,
                  tags:   [“blue”, “glue”],
             post_date:   1239910768,
                  body:   “Once upon a time…”,
          is_published:   true
}
JSON Documents
Example
{
                  _id:    “post1”,
                 _rev:    “123456”,
                          …
          _attachments:   {
                            “picture.png”: {
                               stub: true,
                               content_type: “image/png”,
                               length: 384
                            }
                          }
}
Views
    Used to sort and filter through data
•

    Lazily evaluated, highly efficient
•
         Similar to indexing in relational databases
     ■




    Defined in design documents
•
         Documents named _design/…
     ■



    Consist of map and reduce functions
•
         Language independent
     ■



         JavaScript supported by default
     ■



            Mozilla Spidermonkey included
          ■
Data Processing with MapReduce
    Programming model for processing and generating large data sets
•

    Related, but not equivalent to map and reduce operations in
•
    functional languages
    Take and produce key/value pairs with map and reduce functions
•

    Map functions
•
         Take input key/value pairs and produce an intermediate set of key/value pairs
     ■



    Reduce functions
•
         Take intermediate key and set of values for the key, and merges them into a
     ■


         possibly smaller set of values
    MapReduce: Simplified Data Processing on Large Clusters
•
    Jeff Dean, Sanjay Ghemawat, Google Inc.
Data Processing with MapReduce
Example
{
                   _id:   “post1”,
                  _rev:   “123456”,
                 title:   “A Blog Post”,
                  tags:   [“blue”, “glue”],
             post_date:   1239910768,
                  body:   “Once upon a time…”,
          is_published:   true
}
Data Processing with MapReduce
Example
“post1” = {
                   _id:   “post1”,
                  _rev:   “123456”,
                 title:   “A Blog Post”,
                  tags:   [“blue”, “glue”],
             post_date:   1239910768,
                  body:   “Once upon a time…”,
          is_published:   true
}
Data Processing with MapReduce
Example
“post1” = {
              title:   “A Blog Post”,
               tags:   [“blue”, “glue”],
          post_date:   1239910768,
               body:   “Once upon a time…”
}
Data Processing with MapReduce
Emit Posts by post_date
“post1” = {
                title:    “A Blog Post”,
                 tags:    [“blue”, “glue”],
            post_date:    1239910768,
                 body:    “Once upon a time…”
}
1239910768 = {
                 title:   “A Blog Post”,
                  tags:   [“blue”, “glue”],
             post_date:   1239910768,
                  body:   “Once upon a time…”
}
Data Processing with MapReduce
Emit Posts by post_date

       1208456184 {title: “A bloody long time ago”, …}

       1215421546 {title: “A blue moon ago”, …}

       1222654641 {title: “Just Yesterday”, …}

       1239910768 {title: “A Blog Post”, …}

       1246816518 {title: “That was Then”, …}

       1251687980 {title: “This is Now”, …}

       1264836981 {title: “When Will Then Be Now?”, …}
Data Processing with MapReduce
Emit Posts by tag
“post1” = {
                 title:      “A Blog Post”,
                  tags:      [“blue”, “glue”],
             post_date:      1239910768,
                  body:      “Once upon a time…”
}

“blue” = {          title:   “A Blog Post”, … }
“glue” = {          title:   “A Blog Post”, … }
Data Processing with MapReduce
Emit Posts by tag

               blue {title: “Just Yesterday”, …}

               blue {title: “A Blog Post”, …}

               clue {title: “Just Yesterday”, …}

               flue {title: “When Will Then Be Now?”, …}

               flue {title: “This is Now”, …}

               glue {title: “A Blog Post”, …}

             wazoo {title: “That was Then”, …}
Data Processing with MapReduce
Emit Posts by tag, Reduced
                   {title: “Just Yesterday”, …},
              blue
                   {title: “A Blog Post”, …}

              clue {title: “Just Yesterday”, …}

                   {title: “When Will Then Be Now?”, …},
              flue
                   {title: “This is Now”, …}

              glue {title: “A Blog Post”, …}


             wazoo {title: “That was Then”, …}
Scalability
    Incremental MapReduce
•

    Multiversion Concurrency Control (MVCC)
•
         Achieves serializability through multiversioning instead of locking
     ■



         Eliminates waits to access objects
     ■



         Updates create new documents
     ■



         Tradeoff point: no waits, increased data storage
     ■



    Incremental Distributed Replication
•

    Eventual Consistency
•
         Changes eventually propagate through distributed systems
     ■



         Tradeoff point: increase availability and tolerancy, decreased freshness
     ■
Demonstrations

More Related Content

What's hot

MongoDB @ Frankfurt NoSql User Group
MongoDB @  Frankfurt NoSql User GroupMongoDB @  Frankfurt NoSql User Group
MongoDB @ Frankfurt NoSql User GroupChris Harris
 
MongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL DatabaseMongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL DatabaseRuben Inoto Soto
 
Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012Stefan Kögl
 
Mongo db – document oriented database
Mongo db – document oriented databaseMongo db – document oriented database
Mongo db – document oriented databaseWojciech Sznapka
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodbKnoldus Inc.
 
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 Norberto Leite
 
Introduction to couchdb
Introduction to couchdbIntroduction to couchdb
Introduction to couchdbiammutex
 
Jaxitalia09 Spring Best Practices
Jaxitalia09 Spring Best PracticesJaxitalia09 Spring Best Practices
Jaxitalia09 Spring Best PracticesMassimiliano Dessì
 
Socialite, the Open Source Status Feed
Socialite, the Open Source Status FeedSocialite, the Open Source Status Feed
Socialite, the Open Source Status FeedMongoDB
 
Scaling Databases with DBIx::Router
Scaling Databases with DBIx::RouterScaling Databases with DBIx::Router
Scaling Databases with DBIx::RouterPerrin Harkins
 
OSCON 2011 CouchApps
OSCON 2011 CouchAppsOSCON 2011 CouchApps
OSCON 2011 CouchAppsBradley Holt
 
Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBJustin Smestad
 

What's hot (20)

Grails 2.0 Update
Grails 2.0 UpdateGrails 2.0 Update
Grails 2.0 Update
 
MongoDB @ Frankfurt NoSql User Group
MongoDB @  Frankfurt NoSql User GroupMongoDB @  Frankfurt NoSql User Group
MongoDB @ Frankfurt NoSql User Group
 
MongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL DatabaseMongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL Database
 
Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012
 
Mongo db – document oriented database
Mongo db – document oriented databaseMongo db – document oriented database
Mongo db – document oriented database
 
Cassandra
CassandraCassandra
Cassandra
 
Introduction to JSON & AJAX
Introduction to JSON & AJAXIntroduction to JSON & AJAX
Introduction to JSON & AJAX
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodb
 
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
 
Introduction to couchdb
Introduction to couchdbIntroduction to couchdb
Introduction to couchdb
 
Jaxitalia09 Spring Best Practices
Jaxitalia09 Spring Best PracticesJaxitalia09 Spring Best Practices
Jaxitalia09 Spring Best Practices
 
Socialite, the Open Source Status Feed
Socialite, the Open Source Status FeedSocialite, the Open Source Status Feed
Socialite, the Open Source Status Feed
 
Scaling Databases with DBIx::Router
Scaling Databases with DBIx::RouterScaling Databases with DBIx::Router
Scaling Databases with DBIx::Router
 
Scala with MongoDB
Scala with MongoDBScala with MongoDB
Scala with MongoDB
 
MySQL Rises with JSON Support
MySQL Rises with JSON SupportMySQL Rises with JSON Support
MySQL Rises with JSON Support
 
CQL3 in depth
CQL3 in depthCQL3 in depth
CQL3 in depth
 
OSCON 2011 CouchApps
OSCON 2011 CouchAppsOSCON 2011 CouchApps
OSCON 2011 CouchApps
 
Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 

Viewers also liked

Cloud Computing in Practice
Cloud Computing in PracticeCloud Computing in Practice
Cloud Computing in PracticeKing Huang
 
Modeling with Document Database: 5 Key Patterns
Modeling with Document Database: 5 Key PatternsModeling with Document Database: 5 Key Patterns
Modeling with Document Database: 5 Key PatternsDan Sullivan, Ph.D.
 
Harvesting The Web With Cloud Computing
Harvesting The Web With Cloud ComputingHarvesting The Web With Cloud Computing
Harvesting The Web With Cloud ComputingKing Huang
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionIn a Rocket
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldabaux singapore
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting PersonalKirsty Hulse
 

Viewers also liked (7)

Cloud Computing in Practice
Cloud Computing in PracticeCloud Computing in Practice
Cloud Computing in Practice
 
Modeling with Document Database: 5 Key Patterns
Modeling with Document Database: 5 Key PatternsModeling with Document Database: 5 Key Patterns
Modeling with Document Database: 5 Key Patterns
 
Harvesting The Web With Cloud Computing
Harvesting The Web With Cloud ComputingHarvesting The Web With Cloud Computing
Harvesting The Web With Cloud Computing
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
 

Similar to CouchDB

Ruby sittin' on the Couch
Ruby sittin' on the CouchRuby sittin' on the Couch
Ruby sittin' on the Couchlangalex
 
MongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchMongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchWynn Netherland
 
Aggregation Framework
Aggregation FrameworkAggregation Framework
Aggregation FrameworkMongoDB
 
Visualizing Web Data Query Results
Visualizing Web Data Query ResultsVisualizing Web Data Query Results
Visualizing Web Data Query ResultsAnja Jentzsch
 
WWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL QueriesWWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL QueriesPablo Mendes
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbMongoDB APAC
 
2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_newMongoDB
 
jQuery Presentation to Rails Developers
jQuery Presentation to Rails DevelopersjQuery Presentation to Rails Developers
jQuery Presentation to Rails DevelopersYehuda Katz
 
Webinar: Data Processing and Aggregation Options
Webinar: Data Processing and Aggregation OptionsWebinar: Data Processing and Aggregation Options
Webinar: Data Processing and Aggregation OptionsMongoDB
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuerykatbailey
 
d3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in Berlind3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in BerlinToshiaki Katayama
 
LuSql: (Quickly and easily) Getting your data from your DBMS into Lucene
LuSql: (Quickly and easily) Getting your data from your DBMS into LuceneLuSql: (Quickly and easily) Getting your data from your DBMS into Lucene
LuSql: (Quickly and easily) Getting your data from your DBMS into Luceneeby
 
Gab document db scaling database
Gab   document db scaling databaseGab   document db scaling database
Gab document db scaling databaseMUG Perú
 
Webscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling StrategiesWebscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling StrategiesJonathan Katz
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation FrameworkMongoDB
 

Similar to CouchDB (20)

Ruby sittin' on the Couch
Ruby sittin' on the CouchRuby sittin' on the Couch
Ruby sittin' on the Couch
 
MongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchMongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouch
 
Einführung in MongoDB
Einführung in MongoDBEinführung in MongoDB
Einführung in MongoDB
 
Aggregation Framework
Aggregation FrameworkAggregation Framework
Aggregation Framework
 
Visualizing Web Data Query Results
Visualizing Web Data Query ResultsVisualizing Web Data Query Results
Visualizing Web Data Query Results
 
WWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL QueriesWWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL Queries
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
Buildingsocialanalyticstoolwithmongodb
 
2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new
 
jQuery Presentation to Rails Developers
jQuery Presentation to Rails DevelopersjQuery Presentation to Rails Developers
jQuery Presentation to Rails Developers
 
Webinar: Data Processing and Aggregation Options
Webinar: Data Processing and Aggregation OptionsWebinar: Data Processing and Aggregation Options
Webinar: Data Processing and Aggregation Options
 
CouchDB
CouchDBCouchDB
CouchDB
 
Vidoop CouchDB Talk
Vidoop CouchDB TalkVidoop CouchDB Talk
Vidoop CouchDB Talk
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
 
d3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in Berlind3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in Berlin
 
LuSql: (Quickly and easily) Getting your data from your DBMS into Lucene
LuSql: (Quickly and easily) Getting your data from your DBMS into LuceneLuSql: (Quickly and easily) Getting your data from your DBMS into Lucene
LuSql: (Quickly and easily) Getting your data from your DBMS into Lucene
 
Gab document db scaling database
Gab   document db scaling databaseGab   document db scaling database
Gab document db scaling database
 
Webscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling StrategiesWebscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling Strategies
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
MongoDB 3.2 - Analytics
MongoDB 3.2  - AnalyticsMongoDB 3.2  - Analytics
MongoDB 3.2 - Analytics
 
Latinoware
LatinowareLatinoware
Latinoware
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

CouchDB

  • 1. CouchDB King Chung Huang Information Technologies University of Calgary
  • 3. Document-oriented Databases Today’s Talk CouchDB Overview Demonstrations
  • 6. Flat Hierarchical Network Relational Databases
  • 7. Post-Relational Databases Dimensional Object Document-oriented
  • 8. Document-oriented Databases Comparable to documents in the real world • Records are stored as schema-less documents • Each document is uniquely named ■ Documents are the primary unit of storage ■ Structures are not explicitly defined • No tables with uniform, pre-defined fields ■ Every document can have varying fields of different types ■ Documents are self contained • Data is not decomposed into tables with relations ■ Documents contain the context needed to understand them ■
  • 9. Document-oriented Databases Examples • Lotus Notes ■ Amazon SimpleDB ■ CouchDB ■ Key-Value Stores • Amazon S3 ■ Dynamo: Amazon’s Highly Available Key-value Store, DeCandia, et al., 2007 ■ Facebook Cassandra ■ Recently accepted as an Apache incubation project ■ Google BigTable ■ Bigtable: A Distributed Storage System for Structured Data, Chang, et al., ■ 2006
  • 11. Document database server REST API What is CouchDB? JSON documents Views with MapReduce Highly Scalable
  • 12. Document Database Server Implemented in Erlang • Ericsson Language ■ Highly concurrent, functional programming language ■ Designed with modern web applications in mind • Atomic Consistent Isolated Durable (ACID) • “Crash-only” design • Supports external handlers • Change notification ■ Custom processing ■ •
  • 13. REST HTTP API Representational State Transfer • A set of principles about how resources are defined and addressed ■ World Wide Web (HTTP) is RESTful • Uniform interface for accessing resources ■ Resources identified by URI ■ Actions transmitted in HTTP methods ■ Status communicated in status codes ■
  • 14. REST HTTP API CRUD Create, Read, Update, and Delete • • In HTTP POST /some/resource/id ■ GET /some/resource/id ■ PUT /some/resource/id ■ DELETE /some/resource/id ■
  • 15. JSON Documents JavaScript Object Notation • Considered language-independent ■ CouchDB stored XML documents before version 0.8 • Suitable if content is already in XML ■ Human readable, but can be onerous to type ■ Markup language, requires transformation from/to data structures ■ Represents primitive data types and structures • Strings, numbers, booleans ■ Arrays, dictionaries ■ Null ■ Documents can have attachments •
  • 16. JSON Documents Example { _id: “post1”, _rev: “123456”, title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…”, is_published: true }
  • 17. JSON Documents Example { _id: “post1”, _rev: “123456”, title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…”, is_published: true }
  • 18. JSON Documents Example { _id: “post1”, _rev: “123456”, title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…”, is_published: true }
  • 19. JSON Documents Example { _id: “post1”, _rev: “123456”, title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…”, is_published: true }
  • 20. JSON Documents Example { _id: “post1”, _rev: “123456”, … _attachments: { “picture.png”: { stub: true, content_type: “image/png”, length: 384 } } }
  • 21. Views Used to sort and filter through data • Lazily evaluated, highly efficient • Similar to indexing in relational databases ■ Defined in design documents • Documents named _design/… ■ Consist of map and reduce functions • Language independent ■ JavaScript supported by default ■ Mozilla Spidermonkey included ■
  • 22. Data Processing with MapReduce Programming model for processing and generating large data sets • Related, but not equivalent to map and reduce operations in • functional languages Take and produce key/value pairs with map and reduce functions • Map functions • Take input key/value pairs and produce an intermediate set of key/value pairs ■ Reduce functions • Take intermediate key and set of values for the key, and merges them into a ■ possibly smaller set of values MapReduce: Simplified Data Processing on Large Clusters • Jeff Dean, Sanjay Ghemawat, Google Inc.
  • 23. Data Processing with MapReduce Example { _id: “post1”, _rev: “123456”, title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…”, is_published: true }
  • 24. Data Processing with MapReduce Example “post1” = { _id: “post1”, _rev: “123456”, title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…”, is_published: true }
  • 25. Data Processing with MapReduce Example “post1” = { title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…” }
  • 26. Data Processing with MapReduce Emit Posts by post_date “post1” = { title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…” } 1239910768 = { title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…” }
  • 27. Data Processing with MapReduce Emit Posts by post_date 1208456184 {title: “A bloody long time ago”, …} 1215421546 {title: “A blue moon ago”, …} 1222654641 {title: “Just Yesterday”, …} 1239910768 {title: “A Blog Post”, …} 1246816518 {title: “That was Then”, …} 1251687980 {title: “This is Now”, …} 1264836981 {title: “When Will Then Be Now?”, …}
  • 28. Data Processing with MapReduce Emit Posts by tag “post1” = { title: “A Blog Post”, tags: [“blue”, “glue”], post_date: 1239910768, body: “Once upon a time…” } “blue” = { title: “A Blog Post”, … } “glue” = { title: “A Blog Post”, … }
  • 29. Data Processing with MapReduce Emit Posts by tag blue {title: “Just Yesterday”, …} blue {title: “A Blog Post”, …} clue {title: “Just Yesterday”, …} flue {title: “When Will Then Be Now?”, …} flue {title: “This is Now”, …} glue {title: “A Blog Post”, …} wazoo {title: “That was Then”, …}
  • 30. Data Processing with MapReduce Emit Posts by tag, Reduced {title: “Just Yesterday”, …}, blue {title: “A Blog Post”, …} clue {title: “Just Yesterday”, …} {title: “When Will Then Be Now?”, …}, flue {title: “This is Now”, …} glue {title: “A Blog Post”, …} wazoo {title: “That was Then”, …}
  • 31. Scalability Incremental MapReduce • Multiversion Concurrency Control (MVCC) • Achieves serializability through multiversioning instead of locking ■ Eliminates waits to access objects ■ Updates create new documents ■ Tradeoff point: no waits, increased data storage ■ Incremental Distributed Replication • Eventual Consistency • Changes eventually propagate through distributed systems ■ Tradeoff point: increase availability and tolerancy, decreased freshness ■