Javatpoint Logo
Javatpoint Logo

CouchDB Tutorial

CouchDB Tutorial

CouchDB Tutorial provides basic and advanced concepts of CouchDB. Our CouchDB Tutorial is designed for beginners and professionals both.

CouchDB is an open source NoSQL database developed by Apache software foundation. It is written in Erlang programming language.

Our CouchDB Tutorial includes all topics of CouchDB such as Couchdb tutorial with couchdb fauxton, http api, installation, couchdb vs mongodb, create database, create document, features, introduction, update document, why couchdb etc.


Introduction to CouchDB

CouchDB is an open source NoSQL database developed by Apache software foundation. It is written in Erlang programming language.

There are two types of databases:

  • RDBMS (Which follows SQL)
  • NoSQL

RDBMS: Relational Database management System

RDBMS is based on relation model introduced by E.F. Codd. It is a basis for SQL and most of the database systems follow RDBMS. These databases are: Oracle, MySQL, MS SQL Server, IBM DB2, and Microsoft Access etc.

In RDBMS, data is stored in database objects like tables. A table is a collection of related data entries and it contains columns and rows. It stores only structured data.

NoSQL Databases

NoSQL databases are other type of databases which provide a mechanism to store and retrieve data other than the tabular form used in RDBMS.

NoSQL databases are schema-free, consistent, support easy replication, have simple API and can handle huge amount of data.

The main objective of NoSQL databases are:

  • Simplicity of design.
  • Horizontal scaling.
  • Finer control over availability.

NoSQL database is faster than RDBMS because it uses different data structure compared to relational database. NoSQL database can store both structured and non-structured data like audio files, video files, documents, etc.

NoSQL database can be divided in three types according to its data storing nature:

  • Key-value Store
  • Column Store
  • Document Store
CouchDB Introduction to couchdb 1

Key-value Store

These databases are designed to store data in key-value pairs. These databases don?t have any schema and each data value contains an indexed key and a value for that key.

The popular examples of Key-value store databases are: Cassandra, DynamoDB, BerkeleyDB, Riak etc.

Column Store

These databases are used to store data in cells. These cells are grouped in columns of data, and these columns are further grouped into Column families. These column families can contain any number of columns.

The popular examples of Column store databases are: BigTable, HBase, and HyperTable etc.

Document Store

These databases follow the basic idea of key-value stores where "documents" contain complex data and each document is assigned with a unique key, which is used to retrieve the document.

These databases are used to store, retrieve, and manage document-oriented information, also known as semi-structured data.

The popular examples of document store databases are: CouchDB , MongoDb etc.


What is CouchDB

CouchDB is an open source NoSQL database which focuses on ease of use. It is developed by Apache. It is fully compatible to web. CouchDB uses JSON to store data, JavaScript as its query language to transform the documents, using MapReduce, and HTTP for an API.

CouchDB is a multi master application released in 2005 and it became an apache project in 2008.


Why CouchDB

Apache CouchDB is one of the latest breed of databases. CouchDB has a schema-free document model which is better fit for common application. It is very powerful to query your data.

What is the main reason behind using CouchDB?

  • CouchDB is easy to use. There is one word to describe CouchDB "Relax". It is also the byline of CouchDB official logo.

"Apache CouchDB has started. Time to relax."

CouchDB Why couchdb 1
  • CouchDB have an HTTP-based REST API, which makes communication with the database very easy.
  • CouchDB has the simple structure of HTTP resources and methods (GET, PUT, DELETE) that are easy to understand and use.
  • In CouchDB, data is stored in the flexible document-based structure so, there is no need to worry about the structure of the data.
  • CouchDB facilitates users with powerful data mapping, which allows querying, combining, and filtering the information.
  • CouchDB provides easy-to-use replication, using which you can copy, share, and synchronize the data between databases and machines.

CouchDB Data Model

  • Database is the outermost data structure/container in CouchDB.
  • Each database is a collection of independent documents.
  • Each document is responsible for maintaining its own data and self-contained schema.
  • Document metadata contains revision information, which makes it possible to merge the differences occurred while the databases were disconnected.
  • CouchDB implements multi version concurrency control, to avoid the need to lock the database field during writes.

CouchDB Architecture:

CouchDB Why couchdb 2

CouchDB Index


Prerequisite

Before learning CouchDB, you must have the basic knowledge of Basic Sql and MySql Database.

Audience

Our CouchDB Tutorial is designed to help beginners and professionals.

Problem

We assure that you will not find any problem in this CouchDB tutorial. But if there is any mistake, please post the problem in contact form.

Next TopicCouchDB vs MongoDB




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials