CouchDB
In 2005, Damien Katz left IBM with an idea in mind. His years working on Lotus Notes had taught him what a document database was, but also what it could become. At that time, the computing world revolved almost exclusively around relational databases. Yet something was off. Modern web applications and collaborative tools demanded something else, a flexibility that SQL couldn’t quite deliver.
He started by writing CouchDB in C++. The early prototypes worked, but concurrency management tripped him up. He searched for a solution, browsed technical forums, and stumbled upon the blog "Lambda the Ultimate" where someone was discussing Erlang. This language, originally designed for telecommunications at Ericsson, had exactly what he needed. Fault tolerance, native distribution, concurrent processing: it was all there. Katz then made a radical decision. He threw away his C++ code and started over entirely in Erlang.
This technical choice shaped CouchDB. Erlang brought with it a philosophy: systems must survive failures, processes can fail without bringing down the whole system, data can be distributed naturally. These properties, designed for telephone exchanges that needed to run without interruption, fit perfectly with the needs of a modern database. The parallel between telecommunications and data storage wasn’t obvious at first glance, but it proved relevant.
CouchDB broke with several established conventions. No rigid schema: JSON documents could evolve freely, transform as needed without requiring database migration. This freedom addressed the realities of web development where structures constantly change. The interface spoke HTTP, used GET to read, PUT to write, DELETE to remove. Nothing more, nothing less. A web developer found themselves on familiar ground.
JavaScript became the query language. Where other databases imposed their own dialect, CouchDB bet on a language every web developer knew. Views, those custom indexes that allow querying data, were written in JavaScript. MapReduce too.
Bidirectional replication stood among CouchDB’s most distinctive strengths. Two instances could synchronize, exchange their modifications after operating separately for days. For example, a smartphone loses its connection, continues working locally, then synchronizes everything once reconnected. Shortly after Apple’s iPhone launch, this capability anticipated a world where mobile devices and intermittent connections would be the norm rather than the exception.
To handle concurrent writes, CouchDB adopted an optimistic approach. No locks that block, no forced waits. Each document has a revision number, somewhat like Git with its commits. When two modifications conflict, CouchDB keeps both versions and lets the application decide. This conflict management, inspired by version control systems, provided unusual flexibility for a database.
The story took a turn in 2011. CouchDB merged with Membase, a distributed cache technology with remarkable performance. From this union came Couchbase, which combined CouchDB’s document richness with Membase’s raw speed. The hybrid creature inherited from both worlds: persistence and flexibility on one side, velocity on the other.
Technically, CouchDB rests on a few well-designed components. The storage engine writes to disk while maintaining indexes for fast access. The view system transforms documents into queryable indexes. The replication protocol ensures consistency between distant instances. These components interact by leveraging Erlang’s strengths, which orchestrates everything with a certain elegance.
CouchDB participated in the emergence of the NoSQL movement, and proved that data storage could be thought of differently. Its influence can be seen in the architecture of many modern databases that adopted its ideas: schema-less documents, web-friendly APIs, intelligent replication. PouchDB, its JavaScript derivative for browsers, extended synchronization all the way to the web client.
Use cases multiplied where flexibility mattered. Mobile applications that needed to work offline, collaborative systems where users modified the same data, tools that needed to replicate between distant sites. CouchDB excelled in these situations where connection wasn’t guaranteed, where structures evolved quickly, where data distribution was a necessity.