{"id":15348175,"url":"https://github.com/ironcore864/mydumpergo","last_synced_at":"2026-06-15T21:32:11.008Z","repository":{"id":73865947,"uuid":"350374247","full_name":"IronCore864/mydumpergo","owner":"IronCore864","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-22T14:30:32.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-04T07:29:08.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IronCore864.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-22T14:29:49.000Z","updated_at":"2021-03-22T14:30:35.000Z","dependencies_parsed_at":"2023-09-21T10:03:47.736Z","dependency_job_id":null,"html_url":"https://github.com/IronCore864/mydumpergo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IronCore864/mydumpergo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCore864%2Fmydumpergo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCore864%2Fmydumpergo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCore864%2Fmydumpergo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCore864%2Fmydumpergo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IronCore864","download_url":"https://codeload.github.com/IronCore864/mydumpergo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCore864%2Fmydumpergo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34381759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T11:45:14.201Z","updated_at":"2026-06-15T21:32:10.983Z","avatar_url":"https://github.com/IronCore864.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mydumper in Go\n\nA wrapper for [mydumper](https://github.com/maxbube/mydumper) written in Golang with limited available storage in mind.\n\n## Usage\n\nExample:\n\n```bash\ngo get ./...\ngo build\nBUCKET=mybucket-123123123 ./mydumpergo\n```\n\n## Configuration\n\nUsing ENV variables. For more details, see file [config/config.go](config/config.go).\n\nExplanation:\n\n- AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY: used to access AWS.\n- REGION: the S3 bucket region, defaults to \"eu-central-1\".\n- BUCKET: the name of the S3 bucket for uploading. Mandatory.\n- CHUNK_FILE_SIZE_MB: Split tables into chunks of this output file size. This value is in MB. Defaults to 1 for local testing purpose.\n- MAX_FILE_COUNT: maximum files allowed before pausing and uploading to S3. Defaults to 10 for local testing purpose.\n- HOST: mysql host, defaults to \"localhost\".\n- PORT: mysql port, defaults to 3306.\n- USERNAME: mysql username, defaults to \"root\" for local testing purpose.\n- PASSWORD: mysql password, defaults to empty string \"\" for local testing purpose.\n- OUTPUTDIR: defaults to \"output\", used as the `-o` parameter for mydumper.\n\n**NOTE:**\n\n`CHUNK_FILE_SIZE_MB` * `MAX_FILE_COUNT` decides maximum storage usage. For example, if `CHUNK_FILE_SIZE_MB=50` and `MAX_FILE_COUNT=20`, total max disk usage is 1GB. This is an MVP implementation, so counting file number is used (which is simpler) rather than calculating output dir size.\n\n## Main Logic\n\n- start the mydumper process\n- start a goroutine that checks disk usage, which loops:\n    - if disk usage is higher than pre-configured threshold, send SIGTSTP to the mydumper process to pause it, then:\n        - for each existing file in the output folder, upload the file (using the s3manager package's Uploader, which provides concurrent upload by taking advantage of S3's Multipart API)\n        - after all existing files are uploaded, delete them to release disk usage\n    - send SIGCONT to the mydumper process to continue\n- after the mydumper process ends, clean up the output folder.\n\n## TODOs\n\nTo make it production-ready, there are a few improvements to be done:\n\n- Change counting files to counting disk usage. Counting file is only meant as a simple implementation for local testing purpose where you don't have large tables and output files.\n- Add robust error handling, like retry for S3 upload, only delete successfully uploaded files, etc.\n- Add unit test and functional test.\n- Running in K8s: docker [multistage build](https://docs.docker.com/develop/develop-images/multistage-build/), adding mydumper into the same image; run as a K8s [job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) wth persistent volume, using the mountPath as the output dir.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironcore864%2Fmydumpergo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fironcore864%2Fmydumpergo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironcore864%2Fmydumpergo/lists"}