{"id":18052876,"url":"https://github.com/minooo/plan","last_synced_at":"2026-01-19T15:01:51.588Z","repository":{"id":87399200,"uuid":"336954175","full_name":"minooo/plan","owner":"minooo","description":"Pi plan website Pi 计划网站","archived":false,"fork":false,"pushed_at":"2021-02-07T13:04:55.000Z","size":829,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-05T07:27:26.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://plan.3.1415926.me/","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minooo.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}},"created_at":"2021-02-08T03:56:27.000Z","updated_at":"2021-02-08T03:56:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"de27be80-7f60-4114-a131-0be512fdb226","html_url":"https://github.com/minooo/plan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/minooo/plan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fplan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fplan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fplan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fplan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minooo","download_url":"https://codeload.github.com/minooo/plan/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fplan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28572573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T14:39:55.009Z","status":"ssl_error","status_checked_at":"2026-01-19T14:39:01.217Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-30T23:13:25.813Z","updated_at":"2026-01-19T15:01:51.557Z","avatar_url":"https://github.com/minooo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pi 计划\nPi 计划的愿景是：让开发这件事变的简单、高效，让应用程序变得可靠、稳定。她是一个持续性计划，会产出、更新维护的一系列相关组件、库、服务、文章、思想等。因为开发并不仅仅是代码的编写、执行、项目管理、进度管理、团队协作、跨部门沟通等等。\n- [Github](https://github.com/pi-plan/plan)\n\n## 第一阶段\nPi计划第一阶段计划实现：  \n\n\u003e 0. A2PC 一个安全的、高性能的分布式事务协议。\n\u003e 1. PiDAL 一个支持分库、分表、读写分离、支持 A2PC 分布式事务的数据库中间。\n\u003e 2. PiLCS 一个基于 Raft 算法的高可用的高性能的逻辑时间服务。\n\u003e 3. PRaft 一个异步、高性能的 Raft 算法库。\n\u003e 4. PiDTS 一个支持全量同步、实时同步、数据同步幂、多主模式下数据防止回环的数据同步服务。\n\u003e 5. PiMMS 一个高可用的元数据管理中心，负责同步和管理各种元数据和协调各个组件之间的规则。\n\u003e 6. 以上各个组件可以独立在各自的场景中使用，结合在一起可以实现业务抽象的[异地多活架构](/multi-site-high-availability/introduction)。\n\n\n### PiDAL\nPiDAL(Pi Data Access Layer) 是一个纯异步、高性能、兼用 MySQL 通讯协议的数据库中间件。不仅提供了常规的分库、分表、读写分离等功能，还基于 [A2PC 协议](/a2pc/introduction) 实现了分布式事务处理能力，无入侵、对客户端完全透明，无需额外兼容即可保证分库分表后数据的正确性。\n\n另外，根据对分布式数据库中常见的问题，PiDAL 提供了 [双 Sharding 表](/pidal/introduction?id=双-sharding-表) 解决方案，在开发过程中减少因为分库对开发过程的影响。在 PiDTS 组件的协同下，不仅支持数据库在线扩容也支持数据库 Sharding 规则的重新调整。  \n\nPiDAL 不仅支持以 DB Proxy 模式部署，在容器化实施的比较完善的场景下，PiDAL 也能以 Sidecar 的模式提供支持，可以降低不必要的性能消耗。DB Proxy 和 Sidecar 模式之间的区别和优缺点对比详情可以 [点击这里查看](/pidal/introduction?id=driver、sidecar、dbproxy)。\n- [了解更多](/pidal/introduction)\n- [Github](https://github.com/pi-plan/pidal)\n\n### A2PC\n**A2PC** （Asynchronous Two-Phase Commit）是一个安全、高性能、开源的分布式事务解决方案。原理上是基于 2PC 算法与 MVCC 结合的演变。相比较 [XA 协议](https://zh.wikipedia.org/wiki/X/Open_XA)（MySQL 等数据库原生支持的 2PC 分布式事务规范）中锁资源周期长，单点，多次网络请求等问题，A2PC 的异步提交和回滚能大大减少锁定周期、网络请求次数减少 30%，在 PiDAL 中优化网络请求，网络请求等待周期减少 50%。\n\nPiDAL 实现了 A2PC ，但是为了让更多不能使用 PiDAL 的开发者企业是低成本的使用到 A2PC 方案，这里把 A2PC 的关键操作、步骤、RPC 协议、redo log、undo log、TM 等各种信息角色做出规范，便于在各种语言、数据库、资源、通讯方式的场景下复用。\n- [原理介绍](/pidal/introduction)\n- [协议规范](https://github.com/pi-plan/pidal)\n- [A2PC 实现列表](https://github.com/pi-plan/pidal)\n\n\n### PiDTS\nPiDTS(Pi Data transmission server) 数据传输服务。支持不同数据库之间的数据传输服务。例如 MySQL -\u003e PostgreSQL、MySQL -\u003e Hive 等。支持全量同步、时时同步、数据同步幂、多主模式下数据防止回环等。\n- [了解更多](/pidts/introduction)\n- [Github](https://github.com/pi-plan/pidts)\n\n\n### PiLCS\nPiLCS(Pi Logical clock Server) 是一个高可用、高性能的「逻辑时间」服务，可以生成唯一 ID、消息递增版本号、分布式事务 ID 的单调递增序列服务。单调递增序列不仅在单机事务中，在分布式事务和分布式系统中都有着重要的作用，甚至是必要条件。PiLCS 以 Raft 为基础，为分布式架构提供了高性能、高可用的单调序列服务。\n- [了解更多](/pilcs/introduction)\n- [Github](https://github.com/pi-plan/pilcs)\n\n### PiMMS\nPiMMS(Pi Meta Data Manager Server) 是一个高可用的元数据管理中心，负责同步和管理各种元数据和协调各个组件之间的规则。\n- [Github](https://github.com/pi-plan/pimms)\n\n\n### PRaft\nPRaft 是一个 Python 实现的异步、高性能 [Raft](https://raft.github.io/) [共识算法](https://en.wikipedia.org/wiki/Consensus_(computer_science))库。不仅实现了 Leader 选举、日志复制这些基本逻辑，也实现了是线上环境中实用的 PreVote 逻辑、状态机快照与日志清理、Raft 集群成员动态变更、Leader 节点转移、无投票权成员 Leaner 的特性。\n- [了解更多](/praft/introduction)\n- [Github](https://github.com/pi-plan/praft)\n\n\n## 各个组件之间协作关系\n![各组件之间的系统全景图](/static/pi-plan-system-landscapediagram.png)\n\n## 参与\n\n欢迎每个想参与 Pi 计划的同学，有 Bug 、建议、反馈等可以在 [GitHub](https://github.com/pi-plan) 上对应的代码库里创建 Issue。我们会及时跟进反馈。如果您愿意参与代码的开发，可以直接 Pull requests。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminooo%2Fplan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminooo%2Fplan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminooo%2Fplan/lists"}