apache/couchdb
48.8
Weak · 5 August 2026
131.5k
lines of production code
Erlang
with JavaScript
4
measurements over time
What this system is
Apache CouchDB is a distributed, schema-free document-oriented database that manages data as JSON documents. It provides a robust HTTP/JSON API for data access, supporting multiple JavaScript engines (SpiderMonkey, QuickJS) for server-side logic and Map/Reduce views. The system features a pluggable architecture with an extensible plugin interface, enabling modular components for search (Dreyfus, Mango, Nouveau), replication, and monitoring. It includes comprehensive tooling for CI/CD, testing, and cluster management.
How it got here
2008–2014 — Modular architecture and cluster support
29 changes.
This period focused on restructuring CouchDB into a modular, cluster-aware architecture, introducing dedicated applications for replication, indexing, and HTTP handling. The work established foundational components for shard management, remote procedure calls, and configuration hot-reloading, while also integrating modern tooling for code formatting and testing.
2015–2019 — Modernization and extensibility
42 changes.
This period focused on modernizing CouchDB's architecture by introducing the extensible EPI plugin system and the new 'nouveau' query engine for improved performance. Significant effort was also dedicated to enhancing test coverage, particularly by porting the test suite to Elixir and expanding EUnit tests across core components like logging, storage, and replication.
2020–2024 — Search, security, and observability enhancements
33 changes.
This period focused on expanding CouchDB's capabilities with the introduction of the Nouveau full-text search engine, the Ken indexing server, and the QuickJS JavaScript engine. It also added critical security features like the jwtf JWT library and TLS-secured node communication, alongside new diagnostic and monitoring tools such as the weatherreport utility and Prometheus metrics integration.
2025 — Nouveau search engine integration
6 changes.
This period focused on the introduction of the Nouveau search engine as an experimental feature, including its core API, Lucene-based implementation, and associated unit tests. Concurrently, the project improved file I/O performance with a native C module and expanded test coverage for the Mango database module in Elixir.
Features
Add CouchDB diagnostic tool: weatherreport
The \weatherreport\ utility is added as an escript for diagnosing common problems in a CouchDB node or cluster. It provides a set of diagnostic checks (e.g., memory usage, cluster connectivity, IO queues) that can be run individually or all at once. The tool includes a new \rebar.config\ for building the escript, a \.gitignore\ for build artifacts, and documentation on how to add new checks.
src/weatherreport · high confidence
Add HAProxy configuration and Nouveau runtime config to the release
The release now includes a new HAProxy configuration file (rel/haproxy.cfg) that enables HTTP health checks and stats monitoring, and a new Nouveau configuration file (rel/nouveau.yaml) that configures the Nouveau HTTP/2 server. These additions are reflected in the reltool.build script and reltool.config, ensuring these configuration files are included in the final release artifact.
rel · high confidence
Add Mango documentation and build configuration
The Mango module now includes a comprehensive README.md detailing the HTTP API, supported actions (insert, find, update, delete, create\_index, list\_index, delete\_index, describe\_selector), and selector syntax. Additionally, rebar.config.script and unittest.cfg have been added to support building and testing the module.
src/mango · high confidence
Add Prometheus metrics endpoint for monitoring
Introduces a new \couch\_prometheus\ application that exposes a HTTP endpoint for scraping Prometheus-compatible metrics. The implementation includes a new HTTP handler (\couch\_prometheus\_http\) that serves metrics from various subsystems, including Erlang runtime stats (memory, GC, processes), database state (open databases, file descriptors), replication status, Clouseau search status, and internal replication job counts. The module \couch\_prometheus\_util\ handles the conversion of internal CouchDB stats into Prometheus format, supporting counters, gauges, and histograms with appropriate labels and descriptions.
_src/couch\prometheus/src · high confidence
Add QuickJS as a JavaScript engine option
The system now supports QuickJS as an alternative JavaScript engine, alongside the existing SpiderMonkey engine. This change introduces a new C-based implementation (couchjs.c) that integrates QuickJS into the query server protocol, enabling users to potentially benefit from faster context creation and memory limit alignment with SpiderMonkey.
_src/couch\_quickjs/c\src · medium confidence
Add b64url NIF for high-performance Base64 URL encoding and decoding
The b64url module, a C-based NIF for fast Base64 URL-safe encoding and decoding, has been integrated into the main repository. This addition provides a performance-optimized alternative to the standard Erlang base64 module, particularly for larger data sets, as detailed in the included README and benchmarking scripts.
src/b64url · high confidence
Add custom Erlang distribution protocol with TLS support
Introduces the \couch\_dist\ module, a custom Erlang network protocol that enables TLS-secured inter-node communication. This change adds the core Erlang implementation (\couch\_dist.erl\), an application source file, and a suite of EUnit tests (\couch\_dist\_tests.erl\) to verify the \no\_tls\ configuration logic. Additionally, the \src/couch\_dist\ directory is populated with supporting assets: a license file, a README detailing the setup, a \.gitignore\, and scripts (\gen\_certs\, \certs\, \parse\_cert.escript\) to generate and parse X.509 certificates for the TLS configuration. This provides the foundational infrastructure for secure node-to-node connections in CouchDB.
_src/couch\dist · high confidence
Add erlang-version utility script
A new executable script, bin/erlang-version.escript, has been added to the project. This utility, when executed, prints the current Erlang/OTP release version to the console, providing a convenient way to check the runtime environment's version.
bin · high confidence
Add jwtf library with Apache 2.0 license
The jwtf library, providing JSON Web Token parsing and validation functions, has been added to the project. This includes the source code, a rebar configuration, and an Apache 2.0 license file, enabling users to verify and validate JWTs using various algorithms (RS256, RS386, RS512, HS256, HS386, HS512, ES256, ES386, ES512).
src/jwtf · high confidence
Add xxHash 128-bit hash implementation for Apache CouchDB
Introduces the exxhash module, a new NIF-based wrapper around the xxHash algorithm, to provide a fast, non-cryptographic 128-bit hash function. This implementation is intended to replace MD5 throughout the Apache CouchDB codebase. The change includes the C source files for xxHash, an Erlang interface that dispatches small inputs to a plain NIF and larger inputs (over 1MB) to a dirty CPU-bound NIF, and associated build configuration.
src/exxhash · high confidence
Added CoffeeScript compiler support to the JavaScript query server
Users can now write map, reduce, and show functions in CoffeeScript, which is compiled to JavaScript at runtime. This adds a new syntax option for writing server-side JavaScript logic in the share/server module, allowing developers to use CoffeeScript's concise syntax for CouchDB design documents.
share/server · high confidence
Added SpiderMonkey 1.8.5 JavaScript engine implementation
CouchDB now includes a new JavaScript engine implementation based on SpiderMonkey 1.8.5. This adds the core C/C++ source files (including main.c, help.h, utf8.c/h, and util.c/h) that provide the runtime environment for executing JavaScript code within CouchDB. This change enables the use of JavaScript for map and reduce functions in CouchDB views, providing a specific version of the SpiderMonkey engine for this purpose.
_src/couch/priv/couch\js/1.8.5 · high confidence
Added SpiderMonkey 60-based CouchJS implementation
The \src/couch/priv/couch\_js/60\ directory now contains the source code for the JavaScript engine used by CouchDB, upgraded to support SpiderMonkey 60. This includes new C++ files (\help.h\, \main.cpp\, \util.cpp\, \util.h\) that implement the CouchJS interface, enabling the platform to run JavaScript code using the newer SpiderMonkey runtime.
_src/couch/priv/couch\js/60 · high confidence
Added editor configuration for Ken module
A new rebar.config.script file was added to the Ken module, providing Erlang compiler options that include the project's root directory as an include path. This change improves the development experience by allowing code editors to resolve includes and navigate the codebase more effectively.
src/ken · high confidence
Added escodegen.js to support Spidermonkey 60
A new file, share/server/60/escodegen.js, has been added to the project. This file contains the escodegen library (version 1.8.1), which is a JavaScript code generator. This addition supports the Spidermonkey 60 environment, likely by providing the necessary dependencies or functionality required for that specific version of the JavaScript engine.
share/server/60 · high confidence
Added support for SpiderMonkey 86
The Couch.js JavaScript engine has been updated to support SpiderMonkey 86. This update includes new source files (help.h, main.cpp, util.cpp, util.h) in the 86 directory, enabling the use of the newer SpiderMonkey runtime version for query execution.
_src/couch/priv/couch\js/86 · medium confidence
Complete rewrite of the logging subsystem
The logging system has been completely rewritten to support multiple output backends, including standard error, files, syslog, and systemd-journald. This change introduces a new \couch\_log\ application with a modular architecture, allowing operators to configure log levels, message size limits, and field filtering via configuration. The \couch\_log\ module now exposes a \report/2\ function for structured reporting, and the \couch\_log\_server\ handles log entry queuing and writing. The \couch\_log\_error\_logger\_h\ module bridges Erlang's error\_logger to the new system, ensuring that all standard Erlang and application logs are captured. Additionally, the \couch\_log\_config\ module enables dynamic reconfiguration of logging parameters without restarting the application.
_src/couch\log/src · high confidence
Default configuration files for CouchDB are introduced
The release now provides default configuration files (default.ini, local.ini, and vm.args) in the rel/overlay/etc directory. These files establish baseline settings for the database, HTTP server, SSL, and Erlang VM, including defaults for security (admin-only database access), performance (btree cache, cfile parallel reads), and cluster behavior. Users can override these defaults in local.ini, which is preserved across upgrades.
rel/overlay/etc · high confidence
Diagnostic tooling for Apache CouchDB
The weatherreport diagnostic tool has been ported from Riak to Apache CouchDB, providing a suite of automated checks for cluster health, node connectivity, memory usage, and shard safety. The tool now supports running checks across the entire cluster via RPC, allows configuring the timeout for RPC calls, and includes new diagnostics for IO queues, TCP queues, and internal replication jobs.
src/weatherreport/src · high confidence
Introduce CouchDB scanner plugin framework for background analysis
Adds a new \couch\_scanner\ application that provides a framework for running background analysis plugins against CouchDB data. The core \couch\_scanner\_server\ manages plugin lifecycle, scheduling, and checkpointing, while \couch\_scanner\_plugin\ defines the behavior for individual plugins. Included plugins detect design document features (e.g., deprecated JS functions), find document conflicts, and search for content matching regular expressions. The system supports rate limiting, jittered scheduling, and checkpointing to ensure stable, non-disruptive scanning of databases and documents.
_src/couch\scanner/src · high confidence
Introduce Custodian for CouchDB shard and replication monitoring
Added a new 'Custodian' component that monitors CouchDB databases by scanning the shards database to detect under-replicated shards and track data in transit. The implementation is configurable via the 'custodian\_monitor' setting in CouchDB's configuration, allowing for pluggable monitoring modules.
src/custodian · high confidence
Introduce Dreyfus search subsystem
Adds the Dreyfus search engine integration, including the \clouseau\_rpc\ module for remote procedure calls to the Clouseau search service, and the \dreyfus\ module for availability checks. The change introduces new modules for handling search, info, and cleanup requests via the HTTP API (\dreyfus\_httpd\), and implements the fabric layer (\dreyfus\_fabric\, \dreyfus\_fabric\_search\, etc.) to coordinate distributed search operations across shards. This enables users to perform full-text search and faceting on indexed data.
src/dreyfus/src · high confidence
Introduce ETS-based LRU cache implementation
Added a new \ets\_lru\ module providing an ETS-backed Least Recently Used (LRU) cache. This component exposes a \gen\_server\-based API for managing cache entries, including \insert\, \lookup\, \update\_counter\, and \match\ operations. The implementation tracks access and creation times to support eviction policies, offering a structured way to manage in-memory caches with automatic expiration capabilities.
_src/ets\lru/src · high confidence
Introduce IOQ for prioritized and queued I/O operations
A new ioq module and its supervisor have been added to manage I/O requests with priority-based queuing. Interactive and background operations are now routed through this queue, allowing configuration of concurrency and ratios. The implementation includes functions to set and retrieve IO priority, bypass logic for specific operation types, and metrics for monitoring queue lengths and system state.
src/ioq · high confidence
Introduce Nouveau full-text search engine
Adds the Nouveau full-text search engine, a new backend for search functionality. This includes the core Erlang modules for index management, updates, and search operations, along with HTTP handlers for analyze, search, and info endpoints. The implementation supports Lucene version 10, enables HTTP/2 and TLS client certificate authentication for external search server connections, and provides metrics for search latency and active searches.
src/nouveau · high confidence
Introduce Nouveau search engine as an experimental feature
The Nouveau search engine is now available as an experimental feature. It provides a new API for indexing and searching documents, with support for multiple Lucene versions and a configurable index manager. The feature includes health checks for both the analyze and index components, and registers resources for handling document updates, searches, and index management. The implementation includes core classes for managing indexes, handling updates and deletes, and performing searches. The feature is currently marked as experimental and may undergo changes.
extra/nouveau/src/main · high confidence
Introduce QuickJS scanner plugin for JavaScript validation
Added a new scanner plugin implementation (couch\_quickjs\_scanner\_plugin) that enables CouchDB to use QuickJS as a JavaScript engine option for scanning and validating documents. The plugin implements the standard scanner plugin interface, handling document and design document processing, while also including configuration helpers (couch\_quickjs.erl) to manage QuickJS binary paths and memory limits.
_src/couch\quickjs/src · high confidence
Introduce comprehensive test infrastructure and utilities for CouchDB
Added the \couch\_tests\ application to provide a robust testing framework for CouchDB. This includes a core test harness (\couch\_tests\) that manages application lifecycles and state, a combinatorics module (\couch\_tests\_combinatorics\) offering helper functions like powerset and permutations for generating test cases, and specific test suites (\couch\_tests\_app\_tests\) that validate the test framework's behavior using mocking. The addition of \rebar.config\ and \couch\_epi\_dispatch\ enables structured, isolated testing of EPI (Erlang Process Interface) components.
_src/couch\tests · high confidence
Introduce extensible plugin interface (EPI) for CouchDB
Adds the \couch\_epi\ application, providing an extensible plugin interface that allows CouchDB to load and manage plugins at runtime. This includes modules for code generation, data providers, function dispatch, and module keeping, enabling dynamic service registration and configuration management.
_src/couch\epi/src · high confidence
Introduce global changes feed for tracking database-wide changes
Adds a new \global\_changes\ application that provides a centralized feed of all database changes across the cluster. This feature allows clients to subscribe to a single endpoint to receive change events for any database, rather than querying each database individually. The implementation includes HTTP handlers for normal, continuous, longpoll, and eventsource feeds, a listener to capture database events, and a server to batch and flush updates to a central \\_global\_changes\ database.
_src/global\changes/src · high confidence
Introduce jwtf, a new Erlang-based JWT library
The jwtf application is added to the codebase, providing core modules for JSON Web Token encoding, decoding, and validation. This includes the main jwtf module for token operations, a jwtf\_keystore for managing cryptographic keys, and standard application/supervisor boilerplate. The library supports RSA (RS256, RS384, RS512), EC (ES256, ES384, ES512), and HMAC (HS256, HS384, HS512) algorithms.
src/jwtf/src · high confidence
Introduce new couch\_stats application for metrics collection
A new \couch\_stats\ application has been added to provide a simple statistics collection mechanism for Erlang applications. This replaces the previous Folsom-based implementation, offering counters, gauges, and histograms with configurable intervals. Users can now define metrics via description files and access them through the \couch\_stats\ API or HTTP endpoints, with the stats collector automatically managing histogram data retention and cleanup.
_src/couch\stats · high confidence
Introduce pluggable custodian monitoring and alerting
The custodian module now supports a pluggable monitoring interface, allowing external systems to receive alerts about database and shard status. This is achieved by defining the \custodian\_monitor\ callback behavior and providing a default no-op implementation (\custodian\_noop\_monitor\). The \custodian\_db\_checker\ and \custodian\_server\ modules have been updated to send events and alerts through this new interface, enabling integration with external monitoring tools.
src/custodian/src · high confidence
Introduce smoosh queue persistence
The smoosh compaction daemon now supports optional persistence of its internal state. A new \smoosh\_persist\ module handles reading and writing the queue state to disk, allowing the system to recover its pending compaction jobs after a restart. This feature is controlled by the \smoosh.persist\ configuration option. Additionally, the \smoosh\_priority\_queue\ module was introduced to manage the priority-ordered queue of compaction jobs, and the \smoosh\_server\ was updated to integrate with this new persistence layer.
src/smoosh/src · high confidence
Introduce the 'nouveau' Mango query engine
The Mango search subsystem now includes a new query execution engine called 'nouveau'. This change introduces a new application module (\mango.app.src\) and a suite of new Erlang modules (including \mango\_cursor\_nouveau\, \mango\_cursor\, \mango\_cursor\_view\, \mango\_cursor\_text\, and \mango\_crud\) that implement this new execution path. The \mango\_cursor\ module acts as a dispatcher, routing queries to the appropriate cursor handler (view, text, or nouveau). This provides a modernized, potentially more efficient path for executing Mango selectors, distinct from the legacy view/text cursors.
src/mango/src · high confidence
Introduce the new couch\_index module to manage view indexing
The diff introduces the \couch\_index\ application, a new component for managing view indexing. This includes the main \couch\_index\ gen\_server, a \couch\_index\_server\ for sharding and routing, and supporting modules for updates (\couch\_index\_updater\), compaction (\couch\_index\_compactor\), and cleanup (\couch\_index\_cleanup\). The module also provides an EPI (Erlang Plugin Interface) plugin (\couch\_index\_epi\) and a debug interface (\couch\_index\_debug\) for monitoring and restarting busy index processes.
_src/couch\index/src · high confidence
Introduced rexi RPC server with streaming and buffering capabilities
Added the rexi module, a lightweight RPC server for executing remote procedures in a cluster, featuring a new stream2 interface for streaming results back to the coordinator, a message buffer (rexi\_buffer) to handle disconnected nodes, and aggregate metrics for monitoring server queues and buffer depths.
src/rexi · high confidence
Introduction of couch\_epi extensible plugin interface
Added the \couch\_epi\ library, an extensible plugin interface for CouchDB that allows applications to register and manage service providers and data sources. The implementation supports release upgrades, automatic discovery, and multiple data provider types including \static\_module\ and \callback\_module\. The addition includes the core source files, a comprehensive README explaining the architecture, and a \rebar.config\ for building the application.
_src/couch\epi · high confidence
Introduction of the Ken indexing server
The Ken indexing server (ken\_server) and its associated event handler (ken\_event\_handler) are introduced to automatically build and manage search and view indexes. The server manages a queue of database shards, spawns worker processes to update indexes via dreyfus or couch\_index, and handles database events to trigger indexing. The application definition (ken.app.src.script) registers dependencies on kernel, stdlib, couch\_log, couch\_event, couch, config, and dreyfus.
src/ken/src · high confidence
Introduction of the new couch\_replicator application
The replicator logic has been restructured into a new \couch\_replicator\ application, introducing dedicated modules for the replication scheduler, document processing, connection pooling, and pluggable authentication (including session-based auth). This change separates the replicator's internal components from the main CouchDB application, providing a more modular architecture for managing replication jobs, handling HTTP connections, and processing document changes.
_src/couch\replicator/src · high confidence
Migration to the new chttpd HTTP server
The HTTP interface for CouchDB has been replaced with a new, cluster-aware HTTP server named chttpd. This change introduces a new application module (chttpd) and a suite of new Erlang modules (including chttpd, chttpd\_auth, chttpd\_handlers, and others) that handle all incoming HTTP requests, authentication, and routing. This new server supports advanced features such as cluster auto-assembly, configurable TLS, and a pluggable authentication handler system, while maintaining compatibility with existing API endpoints.
src/chttpd/src · high confidence
New Jenkinsfile and build-aux scripts for CI and release automation
The CI infrastructure is overhauled with a new Jenkinsfile that defines a multibranch pipeline for pull requests and full platform builds across multiple operating systems (CentOS 8/9/10, Ubuntu 22.04/24.04/26.04, Debian, and base images) with configurable Erlang versions. This change introduces several new build-aux scripts: a release build script (couchdb-build-release.sh) that packages sources, updates version strings, and generates the CONTRIBUTORS file; a logfile uploader (logfile-uploader.py) for sending CI logs to a CouchDB database; a committer list printer (print-committerlist.sh); a test result parser (show-test-results.py) for EUnit, EXUnit, Mango, and JavaScript tests; and an xref helper (xref-helper.sh) to validate Erlang cross-reference checks. The README.md documents the Jenkins configuration and CI workflow.
build-aux · high confidence
New developer tooling for formatting and remote shell access
Added new scripts to the \dev/\ directory to improve the developer experience. \format\_all.py\ and \format\_check.py\ provide automated Erlang code formatting and validation using \erlfmt\, ensuring consistent code style across the repository. Additionally, \remsh\ and \remsh-tls\ scripts were introduced to simplify connecting to individual nodes via remote shell, with TLS support for secure connections. A \make\_boot\_script\ helper was also added to generate release scripts for development nodes.
dev · high confidence
New mem3 module for cluster membership and shard management
The mem3 application has been introduced to handle CouchDB cluster membership, shard mapping, and replication logic. This includes new modules for managing node lists, tracking cluster stability, handling HTTP endpoints for shard and membership information, and supporting shard splitting and resharding operations. The module also provides a plugin interface for integration with the CouchDB EPI system.
src/mem3/src · high confidence
New search index API and Lucene implementation in Nouveau
The Nouveau module introduces a new search index API and Lucene-based implementation, adding request and response models for search, analyze, and index management. Users can now create, update, and delete search indexes, perform full-text and faceted search, and manage index metadata through the new API classes.
. · high confidence
New setup module for cluster and single-node configuration
A new \setup\ application has been introduced to manage cluster setup and single-node configuration. This includes HTTP handlers for cluster operations, a supervisor for initialization, and an EPI plugin for integration. The module exposes endpoints for enabling clusters, finishing cluster setup, enabling single-node mode, and adding or removing nodes, while also validating bind addresses and ensuring admin credentials are properly hashed.
src/setup/src · high confidence
Project governance and developer workflow configuration
The repository now includes configuration files that define how the project is managed on GitHub and how developers should contribute. A new \.asf.yaml\ file configures GitHub settings, including branch protection rules for \main\ and various release branches, enabling discussions, and setting required status checks. Additionally, a \.credo.exs\ file introduces code quality and style checking for Elixir components, while \.formatter.exs\ standardizes code formatting. The \CONTRIBUTING.md\ file provides updated guidelines for submitting bug reports, feature requests, and pull requests, and \.mailmap\ ensures consistent author identity in the commit history.
(repo-wide) · high confidence
Restructured PSE test suite into a standalone application
The Pluggable Storage Engine (PSE) tests have been moved into their own dedicated application, \couch\_pse\_tests\, complete with its own \.app.src\ manifest. This change isolates the test suite from the main CouchDB codebase, allowing the tests to be built and run as a separate entity. The test modules, such as \cpse\_gather\, \cpse\_test\_attachments\, and others, are now part of this new app structure, facilitating independent testing of storage engine implementations.
_src/couch\_pse\tests · high confidence
Architecture
CouchDB per-user database manager restructured as a proper Erlang application
The \couch\_peruser\ module has been refactored into a proper Erlang application, introducing a dedicated application module (\couch\_peruser\_app\), a supervision tree (\couch\_peruser\_sup\), and an application resource file (\couch\_peruser.app.src\). This change improves the module's integration with the Erlang runtime and ensures correct lifecycle management, while preserving the existing per-user database maintenance functionality.
_src/couch\peruser/src · high confidence
Refactored CouchDB source tree and introduced new core modules
The \src/couch/src\ directory has been refactored, introducing new modules such as \couch.app.src\, \couch.erl\, \couch\_app.erl\, \couch\_att.erl\, \couch\_auth\_cache.erl\, \couch\_auth\_lockout.erl\, \couch\_auto\_purge\_plugin.erl\, \couch\_base32.erl\, \couch\_bt\_engine.erl\, \couch\_bt\_engine.hrl\, and \couch\_bt\_engine\_cache.erl\. This change reorganizes the internal structure of the CouchDB application, separating concerns for authentication caching, lockout mechanisms, auto-purge plugins, and B-tree engine implementations.
src/couch/src · high confidence
Refactored fabric module into dedicated sub-modules
The monolithic \fabric\ module has been split into specialized sub-modules (e.g., \fabric\_db\_create\, \fabric\_db\_delete\, \fabric\_db\_info\) to improve code organization and maintainability. This refactoring isolates specific database operations into their own modules, making the codebase easier to navigate and test.
src/fabric/src · high confidence
Behavioural changes
Add Couch Scanner plugin header with logging macros
A new header file, couch\_scanner\_plugin.hrl, was added to the Couch Scanner module. This file defines logging macros (INFO, WARN, ERR, DEBUG) that wrap the couch\_scanner\_util:log function, providing a consistent way to log messages with metadata in the scanner plugin.
_src/couch\scanner/include · medium confidence
Add SpiderMonkey 68 JavaScript engine support
Added a new version of the embedded JavaScript engine (SpiderMonkey 68) to the CouchDB codebase. This introduces a new directory (src/couch/priv/couch\_js/68) containing updated C++ source files (main.cpp, util.cpp, help.h, util.h) that implement the JS interpreter interface for this specific engine version. Users running CouchDB with this version will have access to the features and behavior of the SpiderMonkey 68 engine.
_src/couch/priv/couch\_js/102, src/couch/priv/couch\js/68 · high confidence
Added documentation and build configuration for mem3 resharding
Added README files for the mem3 application, including a general overview of node membership and shard mapping, and a detailed technical description of the resharding logic, job lifecycle, data definitions, and state transitions. Also added a rebar configuration script that enables the 'WITH\_PROPER' compile-time flag when the PropEr library is available, supporting the testing of the new resharding supervisor and job manager.
src/mem3 · medium confidence
Added environment-specific configuration files for Elixir 13 compatibility
The application now includes dedicated configuration files for different environments (dev, test, integration, prod) to support Elixir 13. Specifically, the test and integration environments are configured to suppress Elixir 13 compatibility warnings and adjust logger and SASL error logging settings, ensuring stable test execution and reduced noise in logs.
config · medium confidence
Added mem3 header file with shard and type definitions
A new header file, mem3.hrl, was added to the include directory. This file defines the \#shard and \#ordered\_shard records, along with associated type specifications such as join\_type, options, and clock. These definitions are required for the mem3 module to function correctly, particularly for handling shard properties and avoiding dialyzer warnings related to record construction.
src/mem3/include · high confidence
Automated EUnit test environment setup and cleanup
The build system now automatically configures and cleans up directories for EUnit tests. A new \eunit\_plugin\ module handles the \setup\_eunit\ rebar command, which generates a test configuration with specific data, state, and log directories, and ensures these temporary directories are removed before each test run to prevent interference between test runs.
rel/plugins · high confidence
Config system refactored to use persistent terms and support hot-reloading
The configuration module has been rewritten to store settings as persistent terms for improved performance and to enable hot-reloading of configuration files without restarting the application. This change introduces a new \config\ application that manages the loading, caching, and reloading of INI-style configuration files. Users can now trigger a configuration reload via the \config:reload/0\ function or an HTTP trigger, allowing runtime updates to take effect immediately. The system also supports subscribing to configuration changes and handles literal dots and equals signs in section and key names.
src/config/src · high confidence
Configurable JavaScript engine and SpiderMonkey version support
The build system now supports multiple versions of the SpiderMonkey JavaScript engine, including 60, 68, 78, 86, 91, 102, 115, and 128, with version 128 set as the default. Users can also configure the build to use QuickJS or disable SpiderMonkey entirely. The build process now detects the installed SpiderMonkey version and applies the appropriate compiler flags and library paths for that version, ensuring compatibility across different system architectures and package managers like Homebrew and dpkg.
src/couch · high confidence
Configure sensitive values for redaction and EPI plugins
A new configuration file at rel/apps/config.config defines sensitive data (admin credentials and replicator passwords) for redaction. Additionally, rel/apps/couch\_epi.config is introduced to specify the Erlang plugins used by Couch EPI, including the newly added Dreyfus and nouveau plugins.
rel/apps · medium confidence
Enhanced remsh script with TLS support and improved cookie handling
The remsh script has been updated to support TLS-encrypted remote shell connections via a new -t option, allowing users to specify a TLS configuration file for secure distribution. Additionally, the script now automatically extracts the Erlang node name and cookie from ERL\_FLAGS or the vm.args file, reducing the need for manual specification of these parameters. The script also includes a canonical\_readlink function to properly resolve symlinks, ensuring correct path resolution.
rel/overlay/bin · high confidence
Improved JSON and string comparison performance and correctness
The C module for JSON comparison has been refactored to use libicu NIFs directly, removing the previous Erlang driver layer. This change speeds up view sorting by generating ICU sort keys more efficiently and fixes a use-after-free bug in the previous collator handling. Additionally, the module now exposes functions to retrieve the libicu and UCA versions, ensuring compatibility with libicu 59+ and preventing silent mis-collation issues with older library versions.
_src/couch/priv/couch\_ejson\compare · medium confidence
Moved nouveau to extra/ to resolve parallel build conflicts
The nouveau project has been relocated to the extra/ directory. This change, which includes adding the Apache 2.0 license, README, TODO list, and Gradle wrapper files, is intended to prevent parallel make targets from clobbering each other during the build process.
extra · high confidence
Native C-based file I/O for CouchDB
The Erlang NIF module for file operations has been replaced with a new C implementation (couch\_cfile.c) that utilizes preadv/writev for parallel read and write operations. This native implementation is only supported on 64-bit non-Windows systems; on Windows or 32-bit architectures, the system falls back to the standard file API, ensuring cross-platform compatibility while offering performance improvements where supported.
_src/couch/priv/couch\cfile · high confidence
QuickJS integration build and build-system updates
The QuickJS integration now includes updated build scripts and configuration to support compilation on Windows, Linux, macOS, and FreeBSD. A new build\_js.escript script bundles JavaScript and CoffeeScript sources into bytecode arrays, while rebar.config.script defines platform-specific compilation flags and port specifications. The update.sh and update\_patches.sh scripts manage upstream QuickJS updates and applied patches. Additionally, a .gitignore file is added to exclude generated and temporary files from version control.
_src/couch\quickjs · medium confidence
Redesigned ddoc\_cache with improved performance and structure
The ddoc\_cache module has been rewritten to improve performance, utilizing a new build system and replacing the khash implementation with maps in ddoc\_cache\_lru. The cache now supports being fully disabled, and the internal structure has been cleaned up by removing obsolete components like ddoc\_cache\_opener and unused includes. Additionally, the codebase has been formatted with erlfmt and modernized by removing Erlang \< 23 ifdefs and explicit erlang: prefixes.
_src/ddoc\cache/src · medium confidence
Refactored Map/Reduce view implementation
The map/reduce view subsystem has been refactored, introducing new internal record definitions for view state and arguments, and reorganizing the module structure with dedicated files for cleanup, compaction, debugging, HTTP handling, indexing, show/update functions, and update notification. This change restructures how the system manages view indexes, compaction processes, and HTTP request handling for views and design documents.
_src/couch\mrview/src · medium confidence
Rewrite of the CouchDB event notification system
The event notification subsystem has been completely rewritten to improve reliability and maintainability. The central server (couch\_event\_server) now uses Erlang maps instead of the khash library for tracking listeners, and off-heap message queues for better memory management. Listeners are now managed via a dedicated callback behavior (couch\_event\_listener) that supports MFA (Module, Function, Argument) style handlers, allowing for more flexible and robust event processing. The implementation also includes improved error handling, logging of original stack traces on failures, and removal of obsolete features like global state and the update\_notification feature.
_src/couch\event/src · medium confidence
Update QuickJS engine to 2026-06-04 release
The embedded QuickJS JavaScript engine has been updated to the 2026-06-04 release, bringing in a range of new features, performance optimizations, and bug fixes. Notable additions include support for resizable array buffers, \ArrayBuffer.prototype.transfer\, the \Iterator\ object and methods, \Atomics.pause\, \Math.sumPrecise()\, and duplicate named groups in regular expressions. The update also introduces base64 and hexadecimal encodings for \Uint8Array\, improves JSON module and import attribute support, and adds \JS\_PrintValue()\ and \JS\_FreePropertyEnum()\ to the C API. Performance has been enhanced through micro-optimizations, faster global variable access, and optimized string operations. Several memory leaks, use-after-free errors, and regex-related issues have been resolved.
_src/couch\quickjs/quickjs · high confidence
Updated JavaScript build script to support newer SpiderMonkey versions
The build script for server-side JavaScript has been updated to handle multiple SpiderMonkey versions, including 60, 78, and 86. This change ensures that the correct JavaScript files and dependencies (such as esprima and escodegen for AST manipulation) are included in the build process, allowing CouchDB to function correctly across different embedded JavaScript engine versions.
support · high confidence
Updated release startup scripts and configuration templates
The rel/files directory now includes updated shell scripts (couchdb.in, couchdb.cmd.in) that support environment variable overrides for Fauxton's document root (COUCHDB\_FAUXTON\_DOCROOT) and JavaScript query server configuration. Additionally, new configuration files (eunit.config, eunit.ini, sys.config, vm.args) have been added to control logging levels, disable error logging for tests, and set default security settings for the eunit test environment.
rel/files · high confidence
Updated user document validation and test infrastructure
The \couch\_db.hrl\ header was introduced to centralize record definitions and macros, while \couch\_js\_functions.hrl\ was added to contain the JavaScript validation function for user documents. This validation now enforces the \password\_scheme\ field, explicitly allowing the \simple+pbkdf2\ scheme alongside \simple\ and \pbkdf2\. Additionally, the test suite was restructured to use PropEr for property-based testing, with new headers (\couch\_eunit\_proper.hrl\) and utilities (\couch\_eunit.hrl\) supporting the new testing approach.
src/couch/include · high confidence
Test coverage
Add Elixir test helpers and test runner infrastructure; Add server configuration tests; Add test setup steps for CouchDB integration; Added EUnit tests for Dreyfus blacklist and purge client verification; Added EUnit tests for MapReduce views; Added EUnit tests for couch\_epi plugin and supervisor child replacement; Added EUnit tests for the CouchDB logging subsystem; Added EUnit tests for the CouchDB scanner; Added EUnit tests for the ETS LRU cache implementation; Added Elixir configuration files for testing; Added Elixir test suite infrastructure and configuration; Added and expanded EUnit tests for CouchDB index crash handling and compaction; Added automated setup tests for cluster and single-node configurations; Added automated tests for the view server; Added benchmarking script for bulk operations; Added build system tests for configure and make clean; Added common test setup pipelines; Added comprehensive EUnit test suites for the Fabric module; Added comprehensive EUnit tests for the ddoc\_cache module; Added comprehensive eunit tests for mem3 shard splitting and replication; Added comprehensive test suite for the Smoosh module; Added end-to-end and unit tests for Prometheus metrics; Added eunit tests for couch\_peruser; Added eunit tests for global\_changes\_hooks; Added test helper module for CouchDB Elixir tests; Added tests for JWT validation and keystore integration; Added tests for the QuickJS scanner plugin and engine configuration; Added tests for the config module; Added unit tests for the Nouveau search engine components; Elixir test suite configuration and test lists for search, nouveau, and core features; Expanded Mango test coverage for text search, sorting, and index selection; Expanded test coverage for chttpd authentication, CORS, and document handling; Expanded test coverage for core components; Port JavaScript integration tests to Elixir; Port Mango database tests to Elixir; Port test fixtures and helpers to Elixir; Replicator eunit tests reorganized and expanded.
Dependencies
Updated build dependencies for Nouveau, Elixir, and Python test environments
The build configuration for the new 'nouveau' component has been established with specific dependencies, including upgrading to Dropwizard 4.0.17 and Lucene 10.4.0. The Elixir test environment has been updated to require Elixir 1.17 and integrated with Excoveralls for test coverage. Additionally, Python test dependencies for 'mango' and 'docs' have been updated, pinning 'requests' to 2.32.4 and 'nose2' to 0.13.0.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 49.
Lenses
- Code Health 49
- Architecture 100
- Maturity 77
- Readiness 38
- Security 56
- Event-Driven 60
- Event Sourcing 100
Changes since last survey
- 300 commits — 254 feature/other, 46 fixes
By area
- (repo) — 65 commits
- (root) — 36 commits
- build-aux/Jenkinsfile — 27 commits
- src/couch — 26 commits
- test/elixir — 21 commits
- extra/nouveau — 18 commits
- src/docs — 15 commits
- src/fabric — 15 commits
- src/mango — 11 commits
- src/couch_replicator — 9 commits
- src/couch_mrview — 8 commits
- rel/overlay — 7 commits
- src/couch_quickjs — 7 commits
- dev/run — 4 commits
- src/dreyfus — 4 commits
- src/mem3 — 4 commits
- src/chttpd — 3 commits
- src/couch_scanner — 3 commits
- src/nouveau — 3 commits
- src/smoosh — 3 commits
Notable commits
- fix: Fix Jenkins badge link in README (#5973)
- fix: Fix ReferenceError in QuickJS dispatch
- fix: Fix a type spec discrepancy in couch_replicator_doc_processor
- fix: Fix append_update_replies case clause in fabric_doc_update
- fix: Fix bulk_get not_found response handling when revs=all
- fix: Fix cluster index and process cleanup
- fix: Fix config:get_integer_or_infinity/3
- fix: Fix error accumulation in bulk_get
- fix: Fix function clause on auto_purge ttl = infinity
- fix: Fix handling shards dbs purge checkpoints in mem3_rep
- fix: Fix intermittent _scheduler/docs 500 error
- fix: Fix invalid revisions function_clause
- fix: Fix javascript for loop in index function
- fix: Fix leaked opened db handle in smoosh
- fix: Fix maintenance mode function_clause for _time_seq
- fix: Fix race condition during purge checkpoint creation
- fix: Fix replication job rewinds
- fix: Fix signatures in mrview purge checkpoints
- fix: Fix time_seq since function clause
- fix: Improve/fix jenkins workspace cleanup
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
apache/couchdb was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 5 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 2eed4886d1853b97459ffd4f0c827e0cdd816a91 — the exact code this score is about.
- Scored under rubric-2026.08.19 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer latest.