Skip to content

scaledb-io/scaledb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scaledb

MySQL analysis and monitoring CLI. Run one-time checks or continuous collection — all read-only, never writes to your database.

Install

# Homebrew (macOS / Linux)
brew install scaledb-io/tap/scaledb

# Go
go install github.com/scaledb-io/scaledb/cmd/scaledb@latest

# Binary
# Download from https://github.com/scaledb-io/scaledb/releases

Continuous collection

Collect performance data from MySQL/Aurora to Parquet files — queryable with DuckDB, Athena, pandas, or any Parquet-compatible tool.

cat > scaledb.yaml <<EOF
cluster: my-cluster.abc123.us-east-1.rds.amazonaws.com
user: scout
password_from: env:MYSQL_PASSWORD
output:
  type: local
  path: ./scaledb-data/
collect:
  interval: 60s
  schemas: true
EOF

export MYSQL_PASSWORD=<password>
scaledb collect --config scaledb.yaml

Query collected data with DuckDB:

duckdb -c "SELECT digest_text[:80], exec_count, sum_timer_wait/1e12 as wait_sec
            FROM 'scaledb-data/query-digests/**/*.parquet'
            ORDER BY sum_timer_wait DESC LIMIT 10"

See docs/collect.md for full configuration, query examples, and schema reference.

One-time checks

# Check MySQL variables against 72 best-practice rules
scaledb check variables --host 127.0.0.1 --user root --password secret

# Find duplicate and redundant indexes
scaledb check indexes --host 127.0.0.1 --user root --password secret

# Instance summary (version, buffer pool, InnoDB stats, replication)
scaledb check summary --host 127.0.0.1 --user root --password secret

# JSON output
scaledb check variables --host 127.0.0.1 --user root --password secret --format json

# Filter by category
scaledb check variables --host 127.0.0.1 --user root --password secret --category innodb

Variable categories

innodb, replication, connections, memory, security, performance_schema, general

Using a my.cnf file

# Reads host, port, user, password from the [client] section
scaledb check variables --defaults-file ~/.my.cnf

# Explicit flags override defaults file values
scaledb check variables --defaults-file ~/.my.cnf --category innodb

Password from environment

export MYSQL_PWD=secret
scaledb check variables --host 127.0.0.1 --user root --password-env MYSQL_PWD

What it checks

Tool What it does
Variable Advisor 72 rules across 7 categories (InnoDB, replication, connections, memory, security, performance_schema, general). Auto-detects Aurora and skips inapplicable rules.
Duplicate Key Checker Finds indexes that are left-prefixes of other indexes. Generates DROP INDEX statements.
MySQL Summary Version, uptime, QPS, buffer pool hit ratio, InnoDB row ops, connections, schema sizes, replication lag.

See docs/rules.md for the full rule catalog with descriptions and severity levels.

Documentation

Doc What's in it
docs/collect.md Collect command — config, data layout, DuckDB/Python query examples, Parquet schema reference
docs/rules.md Variable advisor rule catalog (72 rules, 7 categories)

As a library

The analysis package is importable:

import "github.com/scaledb-io/scaledb/pkg/analyze"

result, err := analyze.CheckVariables(ctx, db, analyze.CheckVariablesOptions{})
findings, err := analyze.CheckDuplicateKeys(ctx, db)
summary, err := analyze.CollectSummary(ctx, db)

Requirements

  • MySQL 5.7+ or 8.0+ (including Aurora MySQL)
  • A user with SELECT on information_schema and performance_schema
  • No special configuration needed — works with default MySQL grants

License

Apache 2.0 — see LICENSE.

About

MySQL configuration advisor and analysis toolkit

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages