A feature-rich Erlang driver for MongoDB supporting modern protocols, connection pooling, and automatic topology discovery.
mongodb-erlang is an official Erlang driver for MongoDB that provides a complete interface for interacting with MongoDB databases from Erlang applications. It handles connection management, CRUD operations, and supports modern MongoDB protocols like OP_MSG and OP_COMPRESSED. The driver solves the problem of seamless integration between Erlang's concurrent programming model and MongoDB's document-oriented database system.
Erlang developers building applications that require MongoDB database integration, particularly those working on distributed systems or real-time applications where Erlang's concurrency model is advantageous.
Developers choose mongodb-erlang because it's a mature, feature-complete driver maintained by the MongoDB community, offering protocol auto-detection, connection pooling, and automatic topology discovery for replica sets and sharded clusters. Its dual API design provides flexibility for both simple connections and complex distributed deployments.
MongoDB driver for Erlang
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically detects and uses MongoDB's OP_MSG and OP_COMPRESSED opcodes for efficient communication, as described in the README's protocol auto-detection section for versions 3.6 and above.
Offers both mc_worker_api for direct connections and mongo_api for pooled connections with automatic topology discovery, catering to different deployment needs, as highlighted in the dual API documentation.
Includes support for connection pooling using Poolboy, optimizing resource management for concurrent Erlang applications, with configurable options like pool_size and max_overflow.
Provides safe/unsafe write modes and master/slave read modes, allowing precise control over data consistency and performance trade-offs, as detailed in the connecting and reading sections.
The mongoc API for automatic topology discovery in sharded clusters is explicitly stated as not stable in the README, limiting reliability for complex deployments and recommending mongos instead.
Does not provide helper functions for commands, forcing developers to use raw MongoDB commands via mc_worker_api:command without built-in utilities, increasing development overhead.
The separation into mc_worker_api and mongo_api can add complexity, requiring developers to choose and manage different connection strategies, which might lead to confusion in larger projects.