Skip to content

A powerful utility for logically backing up, compressing, encrypting, and uploading MariaDB and MySQL databases to S3-compatible storage (e.g., Backblaze), with full support for granular restoration and migration.

License

Notifications You must be signed in to change notification settings

Spire-Recovery-Solutions/SCREAM

Repository files navigation

😱 SCREAM

Secure Compress Restore Encrypt Archive Migrate

Your friendly neighborhood database superhero for MariaDB and MySQL backups!

πŸ” What's SCREAM?

SCREAM is your all-in-one solution for protecting, compressing, and safely storing your precious database data. Think of it as a Swiss Army knife for database backups that actually cares about your peace of mind!

Instead of creating monolithic backup files that are a pain to work with, SCREAM intelligently breaks down your database into modular components:

  • πŸ“Š Schema - Database structure and definitions
  • πŸ’Ύ Data - The actual table contents
  • βš™οΈ FunctionSp - Functions and stored procedures
  • πŸ” Views - Virtual tables for simplified access
  • ⚑ Triggers - Automated responses to data events
  • πŸ•’ Events - Scheduled tasks and automation

This granular approach gives you incredible flexibility when you need to restore or migrate your data.

🧠 How It Works

Under the hood, SCREAM uses a powerful combination of native MySQL tools and modern cloud technologies:

  1. πŸ” Smart Discovery - SCREAM identifies all database objects that need backing up
  2. πŸš… Parallel Processing - Multiple backup tasks run simultaneously for maximum speed
  3. πŸ“¦ Optimized Compression - The xz utility compresses your data with configurable threads
  4. πŸ” Strong Encryption - AES-256-CBC encryption with 20,000 PBKDF2 iterations
  5. ☁️ Intelligent Uploading - Automatic switching between single and multi-part uploads
  6. πŸ“Š Memory Efficiency - Advanced memory recycling prevents out-of-memory errors

✨ Why SCREAM?

  • 🧩 Modular backups - Restore only what you need (Schema, Data, FunctionSp, Views, Triggers, Events)
  • πŸ” Security first - End-to-end encryption keeps your data safe
  • πŸ’Ύ Space efficient - Advanced compression saves storage costs
  • ☁️ Cloud ready - Direct upload to your favorite S3 storage
  • 🌈 User friendly - Clean web interface makes complex operations simple
  • 🐳 Zero friction - Jump right in with our Docker container

πŸš€ Features

🌟 Core Features

  • πŸ›‘οΈ Rock-solid Logical Backups: Extract database elements by component (Schema, Data, FunctionSp, Views, Triggers, Events)
  • πŸ”’ Bank-grade Encryption: Military-strength protection with openssl enc (AES-256-CBC with PBKDF2)
  • πŸ“¦ Super Compression: Save space with efficient xz compression
  • ☁️ Cloud Archiving: Automatic uploads to Backblaze B2 or any S3 storage
  • πŸ”„ Surgical Restoration: Rebuild specific database components when needed
  • 🚒 Effortless Migration: Move databases between environments without stress
  • πŸ–₯️ Beautiful Interface: Intuitive Blazor WASM UI makes management easy
  • πŸ“± Run Anywhere: Lightweight Docker container works everywhere

πŸ”₯ Advanced Technical Features

  • 🧡 Multi-threaded Operations: Parallel processing for each database component
  • πŸš„ Smart Upload Logic: Automatically switches between single-part and multi-part uploads
  • 🧠 Memory-efficient Processing: Recyclable memory streams prevent out-of-memory errors
  • πŸ“Š Detailed Progress Tracking: Real-time reporting on backup status
  • 🌑️ Performance Metrics: Track backup speed and processing time
  • πŸ”„ Comprehensive Error Handling: Automatic cleanup of failed uploads

🧰 Tech Stack

  • πŸ”· Backend: .NET 8+ (fast, modern, and reliable)
  • 🌐 Frontend: Blazor WebAssembly (smooth UI without JavaScript headaches)
  • πŸ”§ CLI Tools:
    • openssl enc - The gold standard in encryption
    • xz - The compression champion
    • mysql client - Rock-solid database interaction
  • πŸ“š Libraries:
    • AWSSDK.S3 - Reliable cloud storage integration
    • Dapper - Lightning-fast database queries
    • CliWrap - Elegant command-line operations
    • MySqlConnector - Bulletproof database connectivity
  • 🐳 Container: Docker (because who has time for dependency hell?)

πŸ“‹ Before You Start

You'll need:

  • 🐳 Docker installed on your system
  • πŸ—„οΈ Access to a MariaDB or MySQL database
  • ☁️ S3-compatible storage account credentials
  • πŸ”· .NET 8+ SDK (only if you're developing outside Docker)

πŸ› οΈ System Requirements

SCREAM is designed to be efficient with your resources, but for best performance:

  • 🧠 Memory: 2GB minimum, 4GB+ recommended for large databases
  • πŸ’½ CPU: Multi-core processor (SCREAM scales with available cores!)
  • πŸ”„ Network: Good upload bandwidth for cloud storage transfer

πŸš€ Quick Start (I'm in a hurry!)

# Pull our Docker image
docker pull ghcr.io/username/scream:latest

# Run it (will use demo mode with sample settings)
docker run -p 8080:80 --name scream-quick ghcr.io/username/scream:latest

# Visit http://localhost:8080 and you're in!

πŸ“₯ Full Installation

🐳 The Docker Way (Recommended)

  1. Clone the repo:

    git clone https://github.com/username/scream.git
    cd scream
  2. Build and launch:

    docker build -t scream:latest .
    docker run -p 8080:80 -v $(pwd)/config:/app/config scream:latest
  3. Visit http://localhost:8080 and start SCREAMing! 😱

πŸ”¨ The DIY Way

Want to build from source? We've got you covered:

  1. Install the prerequisites:

    • .NET 8+ SDK
    • openssl, xz, and mysql client tools
  2. Clone and prep:

    git clone https://github.com/username/scream.git
    cd scream
    dotnet restore
  3. Launch:

    dotnet run --project Scream.Web
  4. Visit http://localhost:5000 and enjoy!

βš™οΈ Configuration

Create a config/appsettings.json file with your settings:

{
  "MySqlBackup": {
    "HostName": "your-db-server",
    "UserName": "your-user",
    "Password": "your-password", 
    "EncryptionKey": "your-very-secure-encryption-key",
    "BucketName": "your-backup-bucket",
    "BackupFolder": "my-backups",
    "MaxPacketSize": "1073741824",
    "Threads": "4",
    "BackblazeB2": {
      "ServiceURL": "s3.us-west-000.backblazeb2.com",
      "AccessKey": "your-b2-access-key",
      "SecretKey": "your-b2-secret-key"
    }
  }
}

Pro tip: All settings can be configured through environment variables too!

export MYSQL_BACKUP_HOSTNAME="your-db-server"
export MYSQL_BACKUP_USERNAME="your-user"
export MYSQL_BACKUP_PASSWORD="your-password"
export MYSQL_BACKUP_ENCRYPTION_KEY="your-very-secure-encryption-key"
export MYSQL_BACKUP_BUCKET_NAME="your-backup-bucket"
export MYSQL_BACKUP_FOLDER="my-backups"
export MYSQL_BACKUP_MAX_PACKET_SIZE="1073741824"
export MYSQL_BACKUP_THREADS="4"
export MYSQL_BACKUP_B2_SERVICE_URL="s3.us-west-000.backblazeb2.com"
export MYSQL_BACKUP_B2_ACCESS_KEY="your-b2-access-key" 
export MYSQL_BACKUP_B2_SECRET_KEY="your-b2-secret-key"

πŸ“š Using SCREAM

πŸ’Ύ Backing Up Your Data

  1. Open the web UI and go to the "Backup" tab
  2. Select your database connection (or enter a new one)
  3. Choose what to include (Schema, Data, FunctionSp, Views, Triggers, Events)
  4. Set encryption options (we recommend AES-256-CBC)
  5. Pick your S3 bucket details
  6. Click "Start Backup" and watch the magic happen!

πŸ§™β€β™‚οΈ What Happens Behind the Scenes

When you click that "Start Backup" button:

  1. SCREAM queries your database to discover all objects needing backup
  2. Each component is processed in parallel (using the thread count you configured)
  3. For each component:
    • The appropriate mysqldump command is executed with optimized flags
    • Output is piped directly to xz for compression
    • Compressed data is piped to openssl for encryption
    • Encrypted data is streamed directly to S3 storage
  4. Large backups are automatically split into multi-part uploads
  5. Detailed logs track the progress of each step

πŸ”„ Restoring Your Data

  1. Navigate to the "Restore" tab
  2. Browse your S3 buckets or upload a local backup
  3. Select which components to restore
  4. Choose destination database
  5. Hit "Start Restore" and grab a coffee while SCREAM works

🚚 Migrating Between Environments

  1. Go to the "Migration" tab
  2. Set up your source and destination connections
  3. Select components to migrate
  4. Click "Start Migration" and relax

πŸ”§ Troubleshooting

Common Issues

  • Can't connect to database? Double-check your connection string and ensure network access
  • S3 uploads failing? Verify your credentials and bucket permissions
  • Slow backups? Try adjusting:
    • The number of threads (MYSQL_BACKUP_THREADS)
    • The compression level in the xz command (currently set to -3)
    • The maximum packet size (MYSQL_BACKUP_MAX_PACKET_SIZE)
  • Memory errors? Adjust the RecyclableMemoryStreamManager settings or decrease thread count
  • Timeouts on large tables? Increase the connection timeout in your MySQL settings

πŸ“Š Performance Tuning

  • CPU-bound? Increase the thread count to match your available cores
  • Network-bound? Adjust compression level (higher = smaller files but slower processing)
  • Memory-bound? Adjust the MaximumBufferSize and pool settings

Need more help? Open an issue on GitHub or check our Wiki!

🀝 Contributing

We'd love your help making SCREAM even better! Here's how:

  1. Fork the repository
  2. Create your feature branch (git checkout -b amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin amazing-feature)
  5. Open a Pull Request

Even small improvements are welcome!

πŸ“œ License

SCREAM is licensed under the MIT License Β© 2025 Spire Recovery Solutions.

This project stands on the shoulders of giants with these dependencies:

  • .NET 8+ & Blazor WASM: MIT License
  • AWSSDK.S3: Apache License 2.0
  • Dapper: Apache License 2.0
  • CliWrap: MIT License
  • MySqlConnector: MIT License
  • openssl enc: OpenSSL License
  • xz: Public Domain/LGPL
  • mysql client: GPL v2

Made with ❀️ by database enthusiasts who've lost data one too many times.

Remember: The best backup is the one you actually have when you need it!

About

A powerful utility for logically backing up, compressing, encrypting, and uploading MariaDB and MySQL databases to S3-compatible storage (e.g., Backblaze), with full support for granular restoration and migration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages