简体   繁体   English

第三方 API 集成 - 如何构建数据库

[英]Third party API integration - How to structure the database

In my app I am integrating different third party APIs, like Google Contacts, Google Calendar, Mailchimp, etc... Each third party API has specific settings I can ask to the user to apply during the sync with my app.在我的应用程序中,我正在集成不同的第三方 API,例如 Google 联系人、Google 日历、Mailchimp 等……每个第三方 API 都有特定的设置,我可以要求用户在与我的应用程序同步期间应用。

I have two options:我有两个选择:

  1. I make unique table like "integration" where I store all connections.我制作了独特的表格,例如“集成”,其中存储了所有连接。 Here I am afraid I will need to add many columns to track settings for different APIs (contact privacy, calendar id, Mailchimp audience id...etc...)在这里,恐怕我需要添加许多列来跟踪不同 API 的设置(联系人隐私、日历 ID、Mailchimp 受众 ID ......等等......)
  2. I make a table for each third party API integrated in order to track separately all relevant setting through dedicated columns.我为每个集成的第三方 API 制作了一个表格,以便通过专用列单独跟踪所有相关设置。 Here I may have many tables when I reach many different third party APIs.当我接触到许多不同的第三方 API 时,我可能有很多表。

I would think the second is the best, but I need your help to structure my database as per best practices to be scalable.我认为第二个是最好的,但我需要你的帮助来根据最佳实践来构建我的数据库以实现可扩展性。

Thanks!谢谢!

What you are trying to do is clearly against Google's Terms of Service, specifically Section 5 e.您正在尝试做的事情显然违反了 Google 的服务条款,特别是 第 5 e 节。 Prohibitions on Content : 禁止内容

Unless expressly permitted by the content owner or by applicable law, you will not, and will not permit your end users or others acting on your behalf to, do the following with content returned from the APIs:除非内容所有者或适用法律明确允许,否则您不会也不会允许您的最终用户或代表您行事的其他人对从 API 返回的内容执行以下操作:

  1. Scrape, build databases, or otherwise create permanent copies of such content, or keep cached copies longer than permitted by the cache header;抓取、构建数据库或以其他方式创建此类内容的永久副本,或将缓存副本保留的时间超过缓存 header 允许的时间;
  2. [...] [...]

And there are very good legal and moral reasons for that.这有很好的法律和道德理由。 So the answer is actually not to do it and use the APIs every time.所以答案实际上是不这样做并且每次都使用 API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM