←Back to Work

Infrastructure

Mongo Drive Backup

Production-ready Go service that periodically backs up MongoDB databases and uploads them to Google Drive with scheduled backups, compression, and a web dashboard.

GoMongoDBGoogle Drive APIDockerCoolify

Mongo Drive Backup

Production-ready Go service that periodically backs up MongoDB databases and uploads them to Google Drive with scheduled backups, compression, and a web dashboard.

Overview

Mongo Drive Backup is a production-ready Go service that periodically backs up MongoDB databases and uploads them to Google Drive. It includes scheduled backups with cron, compression, retention cleanup, and upload verification.

Key Features

  • Scheduled MongoDB backups with cron
  • Automatic compression of backup files
  • Retention cleanup for old backups
  • Upload verification to Google Drive
  • Built-in web dashboard with real-time WebSocket updates
  • OAuth 2.0 support for personal Gmail and service accounts
  • Configurable via environment variables
  • Docker-ready with healthchecks
  • Coolify deployment support

Tech Stack

Language: Go
Database: MongoDB
Storage: Google Drive API
Infrastructure: Docker, Coolify
Real-time: WebSocket updates

Architecture

The service follows a robust production architecture:

  • Backup Engine: Go service with cron scheduling
  • Compression: Efficient backup file compression
  • Upload: Google Drive API integration with OAuth 2.0
  • Dashboard: Web UI with real-time status updates
  • Monitoring: WebSocket-based live logs and backup history
  • Deployment: Docker container with health checks

Production Features

  • Cron-based scheduled backups
  • Automatic retention cleanup
  • Upload verification and retry logic
  • Real-time WebSocket dashboard
  • OAuth 2.0 for Google Drive access
  • Environment-based configuration
  • Health checks for container orchestration

Links