CouchDB is an open-source, NoSQL database management system designed to store and manage large amounts of data efficiently. Developed by the Apache Software Foundation, CouchDB is built upon a document-oriented data model, making it a part of the family of document databases. It stores data in JSON-like documents, making it highly flexible and schema-free, allowing easy adaptability to changing data requirements. One of CouchDB's distinguishing features is its robust replication and synchronization capabilities, enabling seamless data synchronization across multiple nodes and devices. This makes it ideal for distributed and decentralized applications, enabling offline data access and real-time collaboration. With its RESTful API and support for MapReduce views, CouchDB provides powerful querying capabilities. It is an excellent choice for applications requiring scalability, fault tolerance, and reliable data synchronization in a distributed environment.
This repository contains all the necessary materials and instructions to easily deploy a CouchDB service using Docker in a single-node configuration for development purposes. It includes a built-in administration user interface called Fauxton (formerly Futon) accessible via HTTP.
-
Clone the present Git repository.
-
Navigate to the source directory.
-
Configure the variables in the .env file and save changes.
-
Build the Docker image and start a container simultaneously by typing:
docker-compose -f couchdb-single-node.yml -p couchdb up -d
-
Test by accessing via your browser the address:
http://<hostname>:<http_port>/
Default configuration:
http://localhost:5984/
-
Access the Fauxton user interface at:
http://<hostname>:<http_port>/_utils/
Default configuration:
http://localhost:5984/_utils/
-
Login using the credentials you configured in the .env file.
-
Run the following command to stop the container:
docker-compose -f couchdb-single-node.yml -p couchdb down
-
To clean unused images, networks and volumes you may execute (at your own risk):
docker system prune -a
- Unless configured otherwise, the data of the database will be placed in the data directory of the present repository.
- Do not leave the .env file unattended on a cloud server as it contains hardcoded passwords.
- The default HTTP port of CouchDB v3.0 is 5984, while the HTTPS one is 6984. (Ports 4369 and 9100-10 are used in cluster configurations.)
- CouchDB has nothing to do with Couchbase even though their names are similar.
- Spring Framework and Spring Boot do not have built-in support for CouchDB out of the box via Spring Data, for instance. Therefore, Java developers have two options:
- To just perform HTTP calls on the database by leveraging its REST API.
- To use Ektorp, a Java library that provides support for integrating CouchDB with Spring Framework applications.