Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. mgo

mgo

NOASSERTIONGor2018.06.15

A high-performance, maintained fork of the mgo MongoDB driver for the Go programming language.

GitHubGitHub
2.0k stars223 forks0 contributors

What is mgo?

globalsign/mgo is a maintained fork of the popular mgo library, which is a MongoDB driver for the Go programming language. It enables Go applications to connect to, query, and manage MongoDB databases with a focus on performance, reliability, and support for modern MongoDB features. The project addresses various bugs and limitations from the original driver while adding enhancements like better connection handling and extended BSON support.

Target Audience

Go developers building applications that require persistent data storage with MongoDB, particularly those needing improved performance, stability, or access to newer MongoDB features not supported in the original mgo driver.

Value Proposition

Developers choose this fork for its active maintenance, performance optimizations, and the inclusion of critical fixes and features from community pull requests that may be stalled in the upstream repository. It offers a more reliable and feature-complete driver for production Go applications using MongoDB.

Overview

The MongoDB driver for Go

Use Cases

Best For

  • Building high-performance Go services that use MongoDB as a backend database
  • Migrating existing mgo-based applications to newer MongoDB versions (3.4+)
  • Applications requiring efficient connection pooling and low memory footprint
  • Implementing real-time features using MongoDB change streams in Go
  • Projects needing robust BSON marshalling/unmarshalling with streaming support
  • Teams looking for a well-maintained, community-improved fork of the original mgo driver

Not Ideal For

  • Projects requiring official, vendor-supported MongoDB drivers for enterprise compliance or guaranteed long-term updates
  • Applications targeting MongoDB 4.0+ in production, as support is experimental and may lack full feature compatibility
  • Teams needing high-level abstractions or built-in ORM features, as it focuses on low-level driver improvements

Pros & Cons

Pros

Memory Efficiency

Implements buffer reuse and improved connection handling to reduce memory footprint and garbage collection pressure, as detailed in performance optimization changes.

Enhanced BSON Package

Includes a standalone BSON package with streaming encoders and better type handling, improving encoding/decoding performance and supporting features like integer map keys.

Reliable Connection Pooling

Features configurable timeouts, graceful recovery from server unavailability, and maxIdleTimeout for pooled connections, enhancing stability in production environments.

Modern MongoDB Features

Supports MongoDB versions 3.0 to 3.6 with added features like change streams, collations, and read-only views, plus community-driven fixes for bugs.

Cons

Experimental Latest Support

MongoDB 4.0 support is experimental, which may pose risks for applications needing cutting-edge features or production stability on newer versions.

Fork Legacy Limitations

As a fork of the original mgo, it inherits architectural constraints and might not align with MongoDB's official driver roadmap, leading to potential compatibility gaps.

Sparse High-Level Tooling

Focuses on low-level improvements without built-in ORM or abstraction layers, requiring more manual work for complex data modeling compared to some alternatives.

Frequently Asked Questions

Quick Stats

Stars1,967
Forks223
Contributors0
Open Issues47
Last commit4 years ago
CreatedSince 2017

Tags

#database#bson#nosql#mongodb#golang#fork#go#performance#mongodb-driver

Built With

G
Go

Included in

Go169.1kMongoDB2.6k
Auto-fetched 1 day ago

Related Projects

redisredis

Redis Go client

Stars22,128
Forks2,556
Last commit1 day ago
redigoredigo

Go client for Redis

Stars9,861
Forks1,239
Last commit7 months ago
mongo-go-drivermongo-go-driver

The Official Golang driver for MongoDB

Stars8,521
Forks928
Last commit3 days ago
rueidisrueidis

A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, RDMA, etc.

Stars2,949
Forks245
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub