尊敬的 微信汇率:1円 ≈ 0.046089 元 支付宝汇率:1円 ≈ 0.04618元 [退出登录]
SlideShare a Scribd company logo
Couch DB
Mohammad Hossain Amini
Advanced Database
Dr.Niyazi
1
2.0
2
What is Apache CouchDB?
CouchDB Is..
• An Apache Project.
• An Open-Source Document-Oriented Database.
• it uses JSON to store data.
• Written in Erlang.
• CouchDB project was created in April 2005 by Damien Katz.
• CouchDB became an Apache Software Foundation project in 2008.
• In early 2012, Katz left the project to focus on Couchbase Server.
3
Technical Overview
4
Document Storage
• A CouchDB server hosts named databases, which store documents.
• CouchDB provides a RESTful HTTP API for reading and updating (add, edit, delete) database documents.
• Document fields are uniquely named and contain values of varying types (text, number, boolean, lists, etc).
• The CouchDB document update model is lockless and optimistic.
• CouchDB read operations use a Multi-Version Concurrency Control (MVCC).
• The database never contains partially saved or edited documents.
• Document updates (add, edit, delete) are serialized, except for binary blobs which are written concurrently.
• Documents are indexed in B-trees by their name (DocID) and a Sequence ID.
5
The CAP Theorem
• Consistency: All database clients see the same data, even with concurrent updates.
• Availability: All database clients are able to access some version of the data.
• Partition tolerance: The database can be split over multiple servers.
6
MapReduce
7
Anatomy of a view request
8
MapReduce Views
9
{ “user” : “Chris”,
“points” : 3 }
{ “user” : “Joe”,
“points” : 10 }
{ “user” : “Alice”,
“points” : 5 }
{ “user” : “Mary”,
“points” : 9 }
{ “user” : “Bob”,
“points” : 7 }
{ “key” : “Alice”,
“value” : 5 }
{ “key” : “Bob”,
“value” : 7 }
{ “key” : “Chris”,
“value” : 3 }
{ “key” : “Joe”,
“value” : 10 }
{ “key” : “Mary”,
“value” : 9 }
function(doc) {
if (doc.user && doc.points) {
emit(doc.user, doc.points);
}
}
MAP
Everyone: 34
function(keys, values, rereduce) {
return sum(values);
}
Reduce
Replication
10
Introduction to Replication
• One of CouchDB’s strengths is the ability to synchronize two copies of the same database.
• CouchDB will compare the source and the destination database(Changes Feeds).
• Master - Master replication.
• Local documents are never replicated (non-replicating).
• The document will only be replicated if the filter function returns true.
11
Migrating Data to Clients
• Cloudant
• PouchDB
• TouchDB
• Couchbase Lite
12
Examples
13
Document & Query
14
Document Query
Fauxton
15
16
http://127.0.0.1:5984/_utils/
17

More Related Content

What's hot

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Marin Dimitrov
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
MongoDB
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
PolarSeven Pty Ltd
 
Hadoop File system (HDFS)
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)
Prashant Gupta
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
Ram kumar
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
Mongodb vs mysql
Mongodb vs mysqlMongodb vs mysql
Mongodb vs mysql
hemal sharma
 
Couchdb + Membase = Couchbase
Couchdb + Membase = CouchbaseCouchdb + Membase = Couchbase
Couchdb + Membase = Couchbase
iammutex
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
NodeXperts
 
Apache Sqoop: A Data Transfer Tool for Hadoop
Apache Sqoop: A Data Transfer Tool for HadoopApache Sqoop: A Data Transfer Tool for Hadoop
Apache Sqoop: A Data Transfer Tool for Hadoop
Cloudera, Inc.
 
NoSql
NoSqlNoSql
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
Simplilearn
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
Bishal Khanal
 
Introduction to AWS Glue
Introduction to AWS Glue Introduction to AWS Glue
Introduction to AWS Glue
Amazon Web Services
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
JWORKS powered by Ordina
 
NoSql
NoSqlNoSql
Implement SQL Server on an Azure VM
Implement SQL Server on an Azure VMImplement SQL Server on an Azure VM
Implement SQL Server on an Azure VM
James Serra
 
SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL Databases
Osama Jomaa
 
Developing ssas cube
Developing ssas cubeDeveloping ssas cube
Developing ssas cube
Slava Kokaev
 

What's hot (20)

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Hadoop File system (HDFS)
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongodb vs mysql
Mongodb vs mysqlMongodb vs mysql
Mongodb vs mysql
 
Couchdb + Membase = Couchbase
Couchdb + Membase = CouchbaseCouchdb + Membase = Couchbase
Couchdb + Membase = Couchbase
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Apache Sqoop: A Data Transfer Tool for Hadoop
Apache Sqoop: A Data Transfer Tool for HadoopApache Sqoop: A Data Transfer Tool for Hadoop
Apache Sqoop: A Data Transfer Tool for Hadoop
 
NoSql
NoSqlNoSql
NoSql
 
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
 
Introduction to AWS Glue
Introduction to AWS Glue Introduction to AWS Glue
Introduction to AWS Glue
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
NoSql
NoSqlNoSql
NoSql
 
Implement SQL Server on an Azure VM
Implement SQL Server on an Azure VMImplement SQL Server on an Azure VM
Implement SQL Server on an Azure VM
 
SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL Databases
 
Developing ssas cube
Developing ssas cubeDeveloping ssas cube
Developing ssas cube
 

Similar to Couch db

CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009
Jason Davies
 
No sql Database
No sql DatabaseNo sql Database
No sql Database
mymail2ashok
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Sean Laurent
 
MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overview
Antonio Pintus
 
Hadoop - Introduction to Hadoop
Hadoop - Introduction to HadoopHadoop - Introduction to Hadoop
Hadoop - Introduction to Hadoop
Vibrant Technologies & Computers
 
MongoDB
MongoDBMongoDB
MongoDB
Rony Gregory
 
Dealing with Azure Cosmos DB
Dealing with Azure Cosmos DBDealing with Azure Cosmos DB
Dealing with Azure Cosmos DB
Mihail Mateev
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
christkv
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The Move
IBM Cloud Data Services
 
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
Tuan Luong
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDB
MongoDB
 
Couchdb Nosql
Couchdb NosqlCouchdb Nosql
Couchdb Nosql
elliando dias
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
Michael Bright
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
Mike Bright
 
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
NoSQLmatters
 
Couchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionCouchbase - Yet Another Introduction
Couchbase - Yet Another Introduction
Kelum Senanayake
 
Node.js and couchbase Full Stack JSON - Munich NoSQL
Node.js and couchbase   Full Stack JSON - Munich NoSQLNode.js and couchbase   Full Stack JSON - Munich NoSQL
Node.js and couchbase Full Stack JSON - Munich NoSQL
Philipp Fehre
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
TO THE NEW | Technology
 
ElasticSearch - index server used as a document database
ElasticSearch - index server used as a document databaseElasticSearch - index server used as a document database
ElasticSearch - index server used as a document database
Robert Lujo
 
Slides: NoSQL Data Modeling Using JSON Documents – A Practical Approach
Slides: NoSQL Data Modeling Using JSON Documents – A Practical ApproachSlides: NoSQL Data Modeling Using JSON Documents – A Practical Approach
Slides: NoSQL Data Modeling Using JSON Documents – A Practical Approach
DATAVERSITY
 

Similar to Couch db (20)

CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009
 
No sql Database
No sql DatabaseNo sql Database
No sql Database
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overview
 
Hadoop - Introduction to Hadoop
Hadoop - Introduction to HadoopHadoop - Introduction to Hadoop
Hadoop - Introduction to Hadoop
 
MongoDB
MongoDBMongoDB
MongoDB
 
Dealing with Azure Cosmos DB
Dealing with Azure Cosmos DBDealing with Azure Cosmos DB
Dealing with Azure Cosmos DB
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The Move
 
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDB
 
Couchdb Nosql
Couchdb NosqlCouchdb Nosql
Couchdb Nosql
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
 
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
 
Couchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionCouchbase - Yet Another Introduction
Couchbase - Yet Another Introduction
 
Node.js and couchbase Full Stack JSON - Munich NoSQL
Node.js and couchbase   Full Stack JSON - Munich NoSQLNode.js and couchbase   Full Stack JSON - Munich NoSQL
Node.js and couchbase Full Stack JSON - Munich NoSQL
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
 
ElasticSearch - index server used as a document database
ElasticSearch - index server used as a document databaseElasticSearch - index server used as a document database
ElasticSearch - index server used as a document database
 
Slides: NoSQL Data Modeling Using JSON Documents – A Practical Approach
Slides: NoSQL Data Modeling Using JSON Documents – A Practical ApproachSlides: NoSQL Data Modeling Using JSON Documents – A Practical Approach
Slides: NoSQL Data Modeling Using JSON Documents – A Practical Approach
 

Recently uploaded

Angle-or,,,,,-Pull-of-Muscleexercise therapy.pptx
Angle-or,,,,,-Pull-of-Muscleexercise therapy.pptxAngle-or,,,,,-Pull-of-Muscleexercise therapy.pptx
Angle-or,,,,,-Pull-of-Muscleexercise therapy.pptx
siddhimeena3
 
Images as attribute values in the Odoo 17
Images as attribute values in the Odoo 17Images as attribute values in the Odoo 17
Images as attribute values in the Odoo 17
Celine George
 
Art Integrated Project between Maharashtra and Sikkim
Art Integrated Project between Maharashtra and SikkimArt Integrated Project between Maharashtra and Sikkim
Art Integrated Project between Maharashtra and Sikkim
pranavsawarbandhe24
 
Keynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse CityKeynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse City
PJ Caposey
 
Music Business Model Presentation Full Sail University
Music Business Model Presentation Full Sail UniversityMusic Business Model Presentation Full Sail University
Music Business Model Presentation Full Sail University
camakaiclarkmusic
 
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 9 - GLOBAL SUCCESS - FORM MỚI 2025 - C...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 9 - GLOBAL SUCCESS - FORM MỚI 2025 - C...BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 9 - GLOBAL SUCCESS - FORM MỚI 2025 - C...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 9 - GLOBAL SUCCESS - FORM MỚI 2025 - C...
Nguyen Thanh Tu Collection
 
Talking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual AidsTalking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual Aids
MattVassar1
 
A Quiz on Drug Abuse Awareness by Quizzito
A Quiz on Drug Abuse Awareness by QuizzitoA Quiz on Drug Abuse Awareness by Quizzito
A Quiz on Drug Abuse Awareness by Quizzito
Quizzito The Quiz Society of Gargi College
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
MJDuyan
 
Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
Forum of Blended Learning
 
The Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teachingThe Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teaching
Derek Wenmoth
 
Creativity for Innovation and Speechmaking
Creativity for Innovation and SpeechmakingCreativity for Innovation and Speechmaking
Creativity for Innovation and Speechmaking
MattVassar1
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
Friends of African Village Libraries
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
roshanranjit222
 
bryophytes.pptx bsc botany honours second semester
bryophytes.pptx bsc botany honours  second semesterbryophytes.pptx bsc botany honours  second semester
bryophytes.pptx bsc botany honours second semester
Sarojini38
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
Celine George
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
Kalna College
 
Hospital pharmacy and it's organization (1).pdf
Hospital pharmacy and it's organization (1).pdfHospital pharmacy and it's organization (1).pdf
Hospital pharmacy and it's organization (1).pdf
ShwetaGawande8
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
khabri85
 

Recently uploaded (20)

Angle-or,,,,,-Pull-of-Muscleexercise therapy.pptx
Angle-or,,,,,-Pull-of-Muscleexercise therapy.pptxAngle-or,,,,,-Pull-of-Muscleexercise therapy.pptx
Angle-or,,,,,-Pull-of-Muscleexercise therapy.pptx
 
Images as attribute values in the Odoo 17
Images as attribute values in the Odoo 17Images as attribute values in the Odoo 17
Images as attribute values in the Odoo 17
 
Art Integrated Project between Maharashtra and Sikkim
Art Integrated Project between Maharashtra and SikkimArt Integrated Project between Maharashtra and Sikkim
Art Integrated Project between Maharashtra and Sikkim
 
Keynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse CityKeynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse City
 
Music Business Model Presentation Full Sail University
Music Business Model Presentation Full Sail UniversityMusic Business Model Presentation Full Sail University
Music Business Model Presentation Full Sail University
 
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 9 - GLOBAL SUCCESS - FORM MỚI 2025 - C...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 9 - GLOBAL SUCCESS - FORM MỚI 2025 - C...BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 9 - GLOBAL SUCCESS - FORM MỚI 2025 - C...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 9 - GLOBAL SUCCESS - FORM MỚI 2025 - C...
 
Talking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual AidsTalking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual Aids
 
A Quiz on Drug Abuse Awareness by Quizzito
A Quiz on Drug Abuse Awareness by QuizzitoA Quiz on Drug Abuse Awareness by Quizzito
A Quiz on Drug Abuse Awareness by Quizzito
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
 
Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
 
The Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teachingThe Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teaching
 
Creativity for Innovation and Speechmaking
Creativity for Innovation and SpeechmakingCreativity for Innovation and Speechmaking
Creativity for Innovation and Speechmaking
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
 
bryophytes.pptx bsc botany honours second semester
bryophytes.pptx bsc botany honours  second semesterbryophytes.pptx bsc botany honours  second semester
bryophytes.pptx bsc botany honours second semester
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
 
Hospital pharmacy and it's organization (1).pdf
Hospital pharmacy and it's organization (1).pdfHospital pharmacy and it's organization (1).pdf
Hospital pharmacy and it's organization (1).pdf
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
 

Couch db

  • 1. Couch DB Mohammad Hossain Amini Advanced Database Dr.Niyazi 1 2.0
  • 2. 2 What is Apache CouchDB?
  • 3. CouchDB Is.. • An Apache Project. • An Open-Source Document-Oriented Database. • it uses JSON to store data. • Written in Erlang. • CouchDB project was created in April 2005 by Damien Katz. • CouchDB became an Apache Software Foundation project in 2008. • In early 2012, Katz left the project to focus on Couchbase Server. 3
  • 5. Document Storage • A CouchDB server hosts named databases, which store documents. • CouchDB provides a RESTful HTTP API for reading and updating (add, edit, delete) database documents. • Document fields are uniquely named and contain values of varying types (text, number, boolean, lists, etc). • The CouchDB document update model is lockless and optimistic. • CouchDB read operations use a Multi-Version Concurrency Control (MVCC). • The database never contains partially saved or edited documents. • Document updates (add, edit, delete) are serialized, except for binary blobs which are written concurrently. • Documents are indexed in B-trees by their name (DocID) and a Sequence ID. 5
  • 6. The CAP Theorem • Consistency: All database clients see the same data, even with concurrent updates. • Availability: All database clients are able to access some version of the data. • Partition tolerance: The database can be split over multiple servers. 6
  • 8. Anatomy of a view request 8
  • 9. MapReduce Views 9 { “user” : “Chris”, “points” : 3 } { “user” : “Joe”, “points” : 10 } { “user” : “Alice”, “points” : 5 } { “user” : “Mary”, “points” : 9 } { “user” : “Bob”, “points” : 7 } { “key” : “Alice”, “value” : 5 } { “key” : “Bob”, “value” : 7 } { “key” : “Chris”, “value” : 3 } { “key” : “Joe”, “value” : 10 } { “key” : “Mary”, “value” : 9 } function(doc) { if (doc.user && doc.points) { emit(doc.user, doc.points); } } MAP Everyone: 34 function(keys, values, rereduce) { return sum(values); } Reduce
  • 11. Introduction to Replication • One of CouchDB’s strengths is the ability to synchronize two copies of the same database. • CouchDB will compare the source and the destination database(Changes Feeds). • Master - Master replication. • Local documents are never replicated (non-replicating). • The document will only be replicated if the filter function returns true. 11
  • 12. Migrating Data to Clients • Cloudant • PouchDB • TouchDB • Couchbase Lite 12
  • 17. 17
  翻译: