SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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?
 

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

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

Kürzlich hochgeladen

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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
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
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
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
 
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
 

Kürzlich hochgeladen (20)

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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
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
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
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
 
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
 

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 ■