{"id":19789261,"url":"https://github.com/coder2z/shopping","last_synced_at":"2025-05-01T01:31:25.423Z","repository":{"id":108285264,"uuid":"278248962","full_name":"coder2z/shopping","owner":"coder2z","description":"go简单实现高并发秒杀系统","archived":false,"fork":false,"pushed_at":"2021-04-11T08:00:22.000Z","size":121,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T06:34:50.690Z","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/coder2z.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":"2020-07-09T03:04:57.000Z","updated_at":"2025-02-11T12:39:38.000Z","dependencies_parsed_at":"2023-05-03T05:03:51.955Z","dependency_job_id":null,"html_url":"https://github.com/coder2z/shopping","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder2z%2Fshopping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder2z%2Fshopping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder2z%2Fshopping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder2z%2Fshopping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coder2z","download_url":"https://codeload.github.com/coder2z/shopping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251808484,"owners_count":21647297,"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","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-11-12T06:30:49.504Z","updated_at":"2025-05-01T01:31:25.417Z","avatar_url":"https://github.com/coder2z.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go开发电商网站高并发秒杀系统\n\n这个系统的主要目的在于秒杀，所有其他地方都做的很简单。功能不多！\n\n## 技术栈：\n\u003e web框架：gin\n\n\u003e 消息队列：RabbitMQ\n\n\u003e 分布式方案：hash环\n\n\u003e orm: gorm\n\n\u003e 限流器：tollbooth\n\n\u003e 登录验证：jwt\n\n## 架构\n\n![](https://oss.codery.cn/images/2020/07/12/20200712131203.png)\n\n## 启动\ncd /cmd\n\ngo run main.go //启动后台管理接口\n\ngo run client.go //启动RabbitMQ写入数据库客户端\n\ngo run spike.go //启动秒杀系统，支持横行扩展\n\n\n## 测试\n\n### 测试没有使用集群，只是一个服务器\n\n### 这里我使用测试工具是jmeter\n\n设置：\n\n![](https://oss.codery.cn/images/2020/07/12/20200712090309.png)\n\n\n测试结果：\n\n![](https://oss.codery.cn/images/2020/07/12/20200712085943.png)\n\n\nRabbitMQ：\n\n![](https://oss.codery.cn/images/2020/07/12/20200712090446.png)\n\nmysql:\n并没有超卖，测试添加了1000个库存\n\n![](https://oss.codery.cn/images/2020/07/12/20200712090604.png)\n\n![](https://oss.codery.cn/images/2020/07/12/20200712090629.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder2z%2Fshopping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoder2z%2Fshopping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder2z%2Fshopping/lists"}