Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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 ...
Technical Overview
4
Document Storage
• A CouchDB server hosts named databases, which store documents.
• CouchDB provides a RESTful HTTP API fo...
The CAP Theorem
• Consistency: All database clients see the same data, even with concurrent updates.
• Availability: All d...
MapReduce
7
Anatomy of a view request
8
MapReduce Views
9
{ “user” : “Chris”,
“points” : 3 }
{ “user” : “Joe”,
“points” : 10 }
{ “user” : “Alice”,
“points” : 5 }
...
Replication
10
Introduction to Replication
• One of CouchDB’s strengths is the ability to synchronize two copies of the same database.
• ...
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
Upcoming SlideShare
Loading in …5
×

Couch db

Couch db presentation in university

  • Be the first to comment

Couch db

  1. 1. Couch DB Mohammad Hossain Amini Advanced Database Dr.Niyazi 1 2.0
  2. 2. 2 What is Apache CouchDB?
  3. 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
  4. 4. Technical Overview 4
  5. 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. 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
  7. 7. MapReduce 7
  8. 8. Anatomy of a view request 8
  9. 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
  10. 10. Replication 10
  11. 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. 12. Migrating Data to Clients • Cloudant • PouchDB • TouchDB • Couchbase Lite 12
  13. 13. Examples 13
  14. 14. Document & Query 14 Document Query
  15. 15. Fauxton 15
  16. 16. 16 http://127.0.0.1:5984/_utils/
  17. 17. 17

×