{"id":43543355,"url":"https://github.com/devsapp/ots-table-backup","last_synced_at":"2026-02-03T18:38:05.806Z","repository":{"id":37423063,"uuid":"505404186","full_name":"devsapp/ots-table-backup","owner":"devsapp","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-09T11:15:37.000Z","size":55,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-05-09T12:33:01.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/devsapp.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":"2022-06-20T11:00:57.000Z","updated_at":"2024-05-09T11:15:40.000Z","dependencies_parsed_at":"2024-04-08T08:42:50.467Z","dependency_job_id":"c7c0b34d-c71b-442d-be3c-2f6c628d40f7","html_url":"https://github.com/devsapp/ots-table-backup","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/devsapp/ots-table-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fots-table-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fots-table-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fots-table-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fots-table-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devsapp","download_url":"https://codeload.github.com/devsapp/ots-table-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsapp%2Fots-table-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29052644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"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":"2026-02-03T18:38:01.090Z","updated_at":"2026-02-03T18:38:05.797Z","avatar_url":"https://github.com/devsapp.png","language":"Java","readme":"# ots-table-backup 帮助文档\n\n\u003cp align=\"center\" class=\"flex justify-center\"\u003e\n    \u003ca href=\"https://www.serverless-devs.com\" class=\"ml-1\"\u003e\n    \u003cimg src=\"http://editor.devsapp.cn/icon?package=ots-table-backup\u0026type=packageType\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://www.devsapp.cn/details.html?name=ots-table-backup\" class=\"ml-1\"\u003e\n    \u003cimg src=\"http://editor.devsapp.cn/icon?package=ots-table-backup\u0026type=packageVersion\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://www.devsapp.cn/details.html?name=ots-table-backup\" class=\"ml-1\"\u003e\n    \u003cimg src=\"http://editor.devsapp.cn/icon?package=ots-table-backup\u0026type=packageDownload\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdescription\u003e\n\n通过[函数计算](https://www.aliyun.com/product/fc?spm=5176.19720258.J_3207526240.111.28b52c4aqlAUqO)来实现定时备份[表格存储](https://www.aliyun.com/product/ots?spm=5176.137990.J_3207526240.34.2e9b1608VLksvP)中的表任务\n\n\u003c/description\u003e\n\n\u003ctable\u003e\n\n## 前期准备\n| 服务/业务 | 函数计算           |\n| --------- | ------------------ |\n| 权限/策略 | AliyunFCFullAccess |\n\n\u003c/table\u003e\n\n\u003ccodepre id=\"codepre\"\u003e\n\n\u003c/codepre\u003e\n\n\u003cdeploy\u003e\n\n## 部署 \u0026 体验\n\n\u003cappcenter\u003e\n\n- :fire: 通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=ots-table-backup) ，\n[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=ots-table-backup)  该应用。 \n\n\u003c/appcenter\u003e\n\n- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署：\n    - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ，并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ；\n    - 初始化项目：`s init ots-table-backup -d ots-table-backup`   \n    - 进入项目，并进行项目部署：`cd ots-table-backup \u0026\u0026 s deploy -y`\n\n\u003c/deploy\u003e\n\n\u003cappdetail id=\"flushContent\"\u003e\n\n# 应用详情\n\n使用表格存储后，比较常见的运维场景是主备表间进行同步。通过该项目，可以利用函数计算完成将表格存储的源表定时备份到目标表的功能，实现按量付费，免去购买及运维服务器的烦恼。\n\n\u003e通过本应用，还可以完整地体验从 SpringBoot 单体应用平滑迁移函数计算的流程\n\n## 初始化参数\n| 参数名称       | 参数类型 | 是否必填 | 例子                                                      | 参数含义                                                                                               |\n| -------------- | -------- | -------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |\n| serviceName    | String   | 选填     | ots-table-backup                                          | 函数服务名称名                                                                                         |\n| functionName   | String   | 选填     | ots-table-backup                                          | 函数名称                                                                                               |\n| roleArn        | String   | 必填     | acs:*ram*::\\\u003caccountId\u003e:role/aliyuncdnserverlessdevsrole  | 函数执行角色                                                                                           |\n| sourceEndpoint | String   | 必填     | https://\\\u003cinstanceId\u003e.\u003cregion\u003e.ots-internal.aliyuncs.com  | 源表所在实例endpoint                                                                                   |\n| targetEndpoint | String   | 必填     | https://\\\u003cinstanceId\u003e.\\\u003cregion\u003e.ots-internal.aliyuncs.com | 目标表所在实例endpoint                                                                                 |\n| sourceTable    | String   | 必填     | source-table                                              | 源表名名                                                                                               |\n| targetTable    | String   | 必填     | target-table                                              | 目标表名名                                                                                             |\n| tunnelType     | String   | 选填     | BaseData                                                  | [通道类型](https://help.aliyun.com/document_detail/102489.html)                                        |\n| backupEndTime  | String   | 选填     | 2022-07-01 01:01:01                                       | 使用增量备份时，备份的截止时间，`yyyy-MM-dd HH:mm:ss`                                                  |\n| dropIfExist    | Boolean  | 选填     | False                                                     | 目标表存在时是否先删除目标表，保证目标表和源表的完全一致                                               |\n| cronExpression | String   | 选填     | '@every 60m'                                              | 定时触发时间，参考 [函数计算](https://help.aliyun.com/document_detail/171746.html#section-gbz-k3r-vum) |\n\n## 工作原理\n* 利用表格存储的[通道服务](https://help.aliyun.com/document_detail/102489.html)，将其改造成Serverless形态，完成从源表到目标的复制功能\n* 使用函数计算的 [Custom Runtime](https://help.aliyun.com/document_detail/191342.html) 将单体SpringBoot项目进行函数化，完全贴合传统开发体验，实现零代码改造\n* 使用函数计算的 [生命周期回调](https://help.aliyun.com/document_detail/425056.html)，将表初始化的逻辑封装到 Initializer 中，将通道消费的逻辑封装到 Invoke 中，将连接池释放的逻辑封装到 PreStop 中\n\n![alt](https://img.alicdn.com/imgextra/i4/O1CN0156mNCE1Ii9WJk11BD_!!6000000000926-2-tps-981-1071.png)\n\n\n部署完成后，会创建两个函数:\n1. ots-table-mock：用于测试，当指定的源表不存在时，会使用mock数据自动构造一张\n2. ots-table-backup：用于表的备份\n\n\n## 执行效果\n1. 执行 ots-table-mock 函数，自动构造一张源表\n   ![alt](https://img.alicdn.com/imgextra/i4/O1CN01FKrVEI1XcrB9TAgO3_!!6000000002945-2-tps-3742-1146.png)\n2. 查看源表已经完成创建\n   ![alt](https://img.alicdn.com/imgextra/i1/O1CN01PIsaEW1Kv5wdCc5eH_!!6000000001225-0-tps-3366-1462.jpg)\n3. 执行 ots-table-backup 函数，进行表备份\n   ![alt](https://img.alicdn.com/imgextra/i1/O1CN017PxSZt1DN1AJ25i0Y_!!6000000000203-2-tps-2514-1436.png)\n   ![alt](https://img.alicdn.com/imgextra/i2/O1CN01AtsRg11Yd92dYAs9C_!!6000000003081-0-tps-2548-1308.jpg)\n   ![alt](https://img.alicdn.com/imgextra/i3/O1CN01HAbyKW1c1MpsQVk2X_!!6000000003540-2-tps-2490-980.png)\n4. 查看备份结果\n   ![alt](https://img.alicdn.com/imgextra/i1/O1CN01gonw031w0iacmHKN6_!!6000000006246-0-tps-3406-1546.jpg)\n5. 开启定时备份\n   ![alt](https://img.alicdn.com/imgextra/i1/O1CN0126uyAJ1x9hyuchxc9_!!6000000006401-0-tps-3794-1000.jpg)\n\n\u003c/appdetail\u003e\n\n\u003cdevgroup\u003e\n\n## 开发者社区\n\n您如果有关于错误的反馈或者未来的期待，您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态，您可以通过以下渠道进行：\n\n\u003cp align=\"center\"\u003e\n\n| \u003cimg src=\"https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407298906_20211028074819117230.png\" width=\"130px\" \u003e | \u003cimg src=\"https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407044136_20211028074404326599.png\" width=\"130px\" \u003e | \u003cimg src=\"https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407252200_20211028074732517533.png\" width=\"130px\" \u003e |\n| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| \u003ccenter\u003e微信公众号：`serverless`\u003c/center\u003e                                                                                         | \u003ccenter\u003e微信小助手：`xiaojiangwh`\u003c/center\u003e                                                                                        | \u003ccenter\u003e钉钉交流群：`33947367`\u003c/center\u003e                                                                                           |\n\n\u003c/p\u003e\n\n\u003c/devgroup\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsapp%2Fots-table-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevsapp%2Fots-table-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsapp%2Fots-table-backup/lists"}