{"id":50714685,"url":"https://github.com/matrixorigin/git4data-tutorial","last_synced_at":"2026-06-09T18:01:56.868Z","repository":{"id":362652963,"uuid":"1259515486","full_name":"matrixorigin/git4data-tutorial","owner":"matrixorigin","description":"Runnable companion code \u0026 SQL for the MatrixOne Git4Data tutorial series — Git-style version control for data at scale.","archived":false,"fork":false,"pushed_at":"2026-06-05T08:54:30.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T09:12:50.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matrixorigin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-04T15:28:49.000Z","updated_at":"2026-06-05T08:54:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/matrixorigin/git4data-tutorial","commit_stats":null,"previous_names":["matrixorigin/git4data-tutorial"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/matrixorigin/git4data-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fgit4data-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fgit4data-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fgit4data-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fgit4data-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matrixorigin","download_url":"https://codeload.github.com/matrixorigin/git4data-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fgit4data-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34118757,"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-09T02:00:06.510Z","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":"2026-06-09T18:01:55.770Z","updated_at":"2026-06-09T18:01:56.819Z","avatar_url":"https://github.com/matrixorigin.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# MatrixOne Git4Data Tutorial\n\nRunnable companion code for the **MatrixOne Git4Data Deep Dive** article series —\nGit-style version control for data at scale (`commit`, `branch`, `diff`, `merge`,\n`cherry-pick`, time travel), built into [MatrixOne](https://github.com/matrixorigin/matrixone).\n\n\u003e What is Git4Data? If you treat a database as a Git repository and a table as a\n\u003e file in it, MatrixOne lets you run everyday Git operations — snapshot, clone,\n\u003e branch, diff, merge, cherry-pick, restore — over terabytes of data, almost\n\u003e instantly. It's the same workflow software engineers use on code, now on data.\n\n## The series\n\n| Part | Topic | Code here |\n|------|-------|-----------|\n| 1 | The Git moment for data at scale (concept) | — |\n| 2 | **Hands on: from zero, through every Git primitive** | [`02-hands-on/`](02-hands-on/) |\n| … | more coming (implementation principles, ML/agent scenarios) | |\n\nEach later tutorial will add its own folder here.\n\n## Quick start (5 minutes)\n\n```bash\n# 1. Run a local MatrixOne (open source, MySQL-compatible)\ndocker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:4.0.0-rc1\n\n# 2. Run the Part 2 walkthrough — every Git primitive on 1,000,000 rows\nmysql -h 127.0.0.1 -P 6001 -u root -p111 \u003c 02-hands-on/git4data_primitives.sql\n```\n\nDefault credentials: user `root`, password `111`, port `6001`.\n\n## What Part 2 covers\n\n[`02-hands-on/git4data_primitives.sql`](02-hands-on/git4data_primitives.sql) is a\nsingle, copy-paste-runnable script (English comments) that walks through:\n\n- **commit / tag / reset** — `CREATE SNAPSHOT`, time-travel `SELECT … {snapshot=…}`, `RESTORE`\n- **clone** — zero-copy `CREATE TABLE … CLONE`\n- **branch** — lineage-tracked `DATA BRANCH CREATE`\n- **diff** — row-level `DATA BRANCH DIFF … OUTPUT SUMMARY / COUNT / LIMIT / FILE`\n- **merge** — three-way `DATA BRANCH MERGE … WHEN CONFLICT FAIL | SKIP | ACCEPT`\n- **cherry-pick** — `DATA BRANCH PICK … KEYS(…)`\n- **point-in-time recovery** — `CREATE PITR` + `RESTORE … FROM PITR \"…\"`\n- **granularity** — the same semantics at **table / database / account / cluster** levels\n- **scale** — measured numbers showing snapshot/clone/branch cost is independent of table size\n\nIt loads a million rows with a single `generate_series` statement (no external\nfiles needed) and cleans up after itself.\n\n## Measured: cost is independent of data size\n\nSame table, same operations, on a single-node Docker MatrixOne (diff/merge each\ntouch only 1,000 rows):\n\nSteady-state, median of several runs (MatrixOne 4.0.0-rc1):\n\n| table size | load | `CREATE SNAPSHOT` | `CLONE` | `DATA BRANCH CREATE` | `DIFF` (1000) | `MERGE` (1000) |\n|---|---|---|---|---|---|---|\n| 1,000,000 | 0.5 s | 6 ms | 6 ms | 7 ms | 13 ms | 64 ms |\n| 10,000,000 | 5.3 s | 8 ms | 8 ms | 7 ms | 21 ms | 178 ms |\n| 100,000,000 | 41 s | 5 ms | 25 ms | 19 ms | 23 ms | 189 ms |\n\nSnapshot is dead constant (it just names a metadata directory). Clone/branch copy\nthe metadata directory, not the data — 100× the data, clone rises only 6 ms → 25 ms.\nDiff/merge scale with *how many rows changed*, not table size. (The first snapshot\nof a freshly loaded table is ~10–12 ms — a one-time flush of in-memory data — then\ndrops to the steady-state numbers above.)\n\n## Links\n\n- MatrixOne: https://github.com/matrixorigin/matrixone\n- Docs: https://docs.matrixorigin.cn/\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixorigin%2Fgit4data-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrixorigin%2Fgit4data-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixorigin%2Fgit4data-tutorial/lists"}