gpt4 book ai didi

mongodb - 为什么 MongoLab 不推荐使用他们的 REST API?

转载 作者:可可西里 更新时间:2023-11-01 09:31:35 24 4
gpt4 key购买 nike

来自MongoLab's documentation ,他们建议:

MongoLab databases can be accessed by your application code in two ways.

The first method - the one we strongly recommend - is to connect using one of the MongoDB drivers (as described above). You do not need to use our API if you use the driver.

The second method, which you should use only if you cannot connect via one of the MongoDB drivers, is via MongoLab’s RESTful data API.

为什么他们推荐使用驱动程序而不是他们的 REST API?我能想到的原因之一是跨不同 MongoDB 提供商的可移植性。还有其他原因吗? MongoLab 用他们的 API “供应商锁定”客户不是更有利吗?

最佳答案

@WiredPrairie 和@Stennie 提出的有关安全的观点是正确的。 *当您使用我们的 REST API 时,您会向客户端公开您的 API key 。目前,任何拥有 API key 的人都可以修改您的数据库。因此,我们只建议将 REST API 与公共(public)数据一起使用,例如该国所有炸 Jade 米饼卡车的位置。

通过编写自己的应用程序层,您可以防止数据库的凭据暴露给客户端。

如果您有任何问题,请发送电子邮件至 support@mongolab.com。乐于助人!

-Chris@MongoLab

附注感谢@WiredPrairie 和@Stennie

关于mongodb - 为什么 MongoLab 不推荐使用他们的 REST API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20908286/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com