Database / CouchDB Interview Questions
What is Apache CouchDB and what makes it different from relational databases?
Apache CouchDB is an open-source NoSQL document database that stores all data as self-contained JSON documents and exposes its entire API over plain HTTP/HTTPS. No proprietary wire protocol or special client driver is required. It was created by Damien Katz, open-sourced in 2005, and graduated to an Apache Software Foundation top-level project in 2008. The 3.x line introduced a native clustered mode built on the existing Erlang OTP foundation.
Three properties set CouchDB apart from relational databases:
- Schema-free JSON documents — there are no tables or fixed column definitions. Each document in a database can have a completely different structure, and adding a field to one document has zero effect on any other.
- HTTP as the primary interface — every operation (CRUD, querying, replication, admin) is a plain HTTP request. You can interact with CouchDB using curl, a browser, or any HTTP library without installing a database driver.
- Built-in, protocol-level replication — CouchDB's replication is a peer-to-peer HTTP protocol where any node can replicate to or from any other node, supporting master-master setups, offline sync, and mobile clients natively.
Relational databases enforce ACID across multi-row, multi-table transactions using row-level locks and a shared transaction log. CouchDB provides ACID at the single-document level through MVCC and an append-only B-tree engine. There are no JOINs; relationships are denormalized or referenced by document ID.
More Related questions...