Upload
paul-webster
View
233
Download
0
Embed Size (px)
Citation preview
Moohanad HassanMaedeh Pishvaei
Introduction Open Source Apache foundation project Relational DB: SQL Server CouchDB : JSON document-oriented DB (NoSQL) CouchDB database is made up collections You can think of collections as tables from relational databases Collections are made up of zero or more `documents'. You can think of documents as a row from relational databases Schema free: No need to design your tables, you can simply start storing
new values Example:1. FirstName="Bob", Address="5 Oak St.", Hobby="sailing“
2. FirstName="Jonathan", Address="15 Wanamassa Point Road", Children=("Michael,10", "Jennifer,8", "Samantha,5", "Elena,2").
No wasting storage on empty, or null fields.
CouchDBWeb Server /Application Server: Write a client side application that talks
directly to the Couch without the need for a server side middle layerHaving the database stored locally, your client side application can run
with almost no latency. Data replication model: devices (like Android phones) that can go offline
and handle data sync for you when the device is back online.Add attachments to documentsScalable and fault tolerant Use RESTful Interface to store JSON documents: Data creation/replication/insertion, every management and data task
can be done via HTTP.REST=Representational State TransferUse map/reduce query written in JavaScriptFaster than SQL because of using pointers instead of joints
Querying documents
Map function
Key, Value
Key, Value
Key, Value
Key, Value
All Documents
Query by KeyKey, Value
Key, Value
•Map function (extracting data)is executed on every document in the database•Emits key/value pairs (Can emit 0, 1, or more KV pairs for each document in the database)•key/value pairs are then ordered and indexed by key•Query types:• Exact: key = x• Range: key is between x and y• Multiple: key is in list (x,y,z)
•Reduce functions(data aggregation)• e.g. count, sum, group
CouchDB GUI
Who Use CouchDB?
• Independet Facebook Developers•Mobile Developers(iPhone, Android)•Bloggers
Conclusion & More InformationIf your data is truly relational, stick with RDBMSCouchDB is quite low-level, but is very helpfulA database designed to run on the internet of
today for today’s desktop-like applications and the connected devices through which we access the internet.
Tutorial: http://guide.couchdb.org/http://tutorial.mongly.com/tutorial/index
CouchDB Project: http://couchdb.apache.org/ A list of organizations using CouchDB:http://wiki.apache.org/couchdb/CouchDB_in_the_wild