{"id":31853400,"url":"https://github.com/hamidrezaniazi/dummy-mlocks","last_synced_at":"2026-05-15T22:03:35.916Z","repository":{"id":241953725,"uuid":"808285264","full_name":"hamidrezaniazi/dummy-mlocks","owner":"hamidrezaniazi","description":"This project is created to simulate MySQL locks using a Docker environment to help understand the behavior of online DDL operations and their impact on database locks","archived":false,"fork":false,"pushed_at":"2024-08-28T21:23:26.000Z","size":424,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-28T22:44:18.048Z","etag":null,"topics":["concurrency","database","ddl","lock","migration","mysql","online-ddl"],"latest_commit_sha":null,"homepage":"https://medium.com/@hamidrezaniazi/behind-the-scenes-of-mysql-online-ddl-locks-638804b777b3","language":"Makefile","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/hamidrezaniazi.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":"2024-05-30T18:47:23.000Z","updated_at":"2024-08-28T21:23:29.000Z","dependencies_parsed_at":"2024-05-30T22:23:24.694Z","dependency_job_id":"6892d283-3980-497a-b454-365f3ba416b5","html_url":"https://github.com/hamidrezaniazi/dummy-mlocks","commit_stats":null,"previous_names":["hamidrezaniazi/dummy-mlocks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hamidrezaniazi/dummy-mlocks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidrezaniazi%2Fdummy-mlocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidrezaniazi%2Fdummy-mlocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidrezaniazi%2Fdummy-mlocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidrezaniazi%2Fdummy-mlocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamidrezaniazi","download_url":"https://codeload.github.com/hamidrezaniazi/dummy-mlocks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidrezaniazi%2Fdummy-mlocks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011454,"owners_count":26084947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":["concurrency","database","ddl","lock","migration","mysql","online-ddl"],"created_at":"2025-10-12T13:27:37.996Z","updated_at":"2025-10-12T13:27:41.176Z","avatar_url":"https://github.com/hamidrezaniazi.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dummy MySQL Locks Simulation\nThis project is created to simulate MySQL locks using a Docker environment to help understand the behavior of online DDL operations and their impact on database locks, as discussed in [this article](https://medium.com/@hamidrezaniazi/behind-the-scenes-of-mysql-online-ddl-locks-638804b777b3).\n\n![Demo](./img/demo.gif)\n## Requirements\n- Docker\n- Docker Compose\n\n## Setup\nClone the repository:\n\n```sh\ngit clone git@github.com:hamidrezaniazi/dummy-mlocks.git\ncd dummy-mlocks\n```\n\nCopy the example environment file:\n\n```sh\ncp .env.example .env\n```\n\nUpdate the `.env` file with your configurations if needed.\n- `DB_CONTAINER` : The name of the Docker container running the MySQL database. Possible values are `mlocks-v8` for MySQL 8.3 or `mlocks-v5` for MySQL 5.7.\n- `EXEC_DELAY` : The delay in seconds used for simulating long-running operations.\n- `ALGORITHM_LOCK` : The algorithm used for online DDL operations. Possible values are `INSTANT`, `INPLACE`, or `COPY`.\n\n\nBuild and start the Docker containers:\n\n```sh\nmake start\n```\n\n## Makefile Functions\nThe Makefile includes several convenient functions for managing the Docker environment:\n\n- `make migrate` : Re-runs database migrations using the migrations.sql file.\n- `make show` : Displays the tables in the database.\n- `make dql` : Runs a long-running SELECT query on the bar table.\n- `make dml` : Runs a long-running UPDATE query.\n- `make ddl-index` : Adds an index to the foo table.\n- `make ddl-fk` : Adds a foreign key to the bar table.\n- `make ddl-column` : Adds a new column to the foo table.\n- `make select [table]` : Runs a simple SELECT query against the specified table (limits to 10 rows).\n- `make update [table] [column] [value]` : Updates the first record in the specified table.\n- `make locks` : Displays the current MySQL locks.\n- `make wlocks` : Watches the current MySQL locks in real-time.\n- `make connect` : Connects to the MySQL CLI.\n- `make bash` : Connects to the Docker container's bash shell.\n- `make logs` : Displays Docker logs.\n\nClean Up\nTo stop and remove all running containers and networks created by Docker Compose, run:\n\n```sh\nmake stop\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidrezaniazi%2Fdummy-mlocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamidrezaniazi%2Fdummy-mlocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidrezaniazi%2Fdummy-mlocks/lists"}