简体   繁体   English

API设计-最好是为客户和我们的Web应用程序运行一个共享api或将其拆分为两个API(私有和公开)?

[英]API Design - Would it be best to run a shared api for customers and our web app or split it into 2 apis, private and public?

只是在设计过程中,但希望获得部署类似解决方案并分享经验的人们的一些建议。

I would suggest splitting it into two separate APIs, one public and one private. 我建议将其分为两个单独的API,一个是公共的,另一个是私有的。 You have a lot more flexibility to make changes when your users are all internal vs. external. 当您的用户都是内部用户还是外部用户时,您具有更大的灵活性来进行更改。 In addition, internal users typically need/expect more change in the system. 另外,内部用户通常需要/期望对系统进行更多更改。 The security considerations are also very different for internal vs. external APIs. 内部和外部API的安全注意事项也非常不同。

You can mitigate DRY issues by having the internal API call the external API where appropriate. 您可以通过让内部API在适当的地方调用外部API来缓解DRY问题。

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

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