简体   繁体   English

使用 MongoLab 数据库服务与在 AWS 上运行 MongoDB 的自定义 web 服务

[英]Using MongoLab Database service vs Custom web service with MongoDB running on AWS

I am looking for feasible solutions for my Application to be backed with MongoDB.我正在为我的应用程序寻找可行的解决方案,以支持 MongoDB。 I am looking to host the MongoDB on the cloud with a python based server to interact with the DB and my app (either mobile/web).我希望使用基于 python 的服务器在云上托管 MongoDB,以与数据库和我的应用程序(移动/网络)进行交互。 I am trying to understand how the architecture should look like.我试图了解架构应该是什么样子。

  1. Either i can host a mongoDB on the AWS cloud and have the server running there only.我可以在 AWS 云上托管 mongoDB 并且只让服务器在那里运行。

  2. I also tried using MongoLab and seemed to be simple accessing it using HTTP requests.我也尝试过使用 MongoLab,使用 HTTP 请求似乎很简单。 but i am not sure if it exposes all the essential features of MongoDB (what ever i can do using a pymongo driver)?但我不确定它是否公开了 MongoDB 的所有基本功能(我可以使用 pymongo 驱动程序做什么)? Also, should i go for accessing the MongoLab service directly from my application or still i should build a server in-between?另外,我应该 go 直接从我的应用程序访问 MongoLab 服务,还是我应该在两者之间构建一个服务器?

I would prefer to building an server in either case as i want to do some processing before sending the data back to application.在任何一种情况下,我都希望构建一个服务器,因为我想在将数据发送回应用程序之前进行一些处理。 but i am not sure in that case how my DB-server-app interaction design should be但我不确定在这种情况下我的 DB-server-app 交互设计应该如何

Any suggestions?有什么建议么?

One thing to consider is that you don't need to use MongoLab's REST API.要考虑的一件事是您不需要使用 MongoLab 的 REST API。 You can connect directly via a driver as well.您也可以通过驱动程序直接连接。

So, if you need to implement business logic (which it sounds like you do), it makes sense to have a three tier architecture with an app server connecting to your MongoLab database via one of the drivers.因此,如果您需要实现业务逻辑(听起来就像您所做的那样),那么拥有一个三层架构以及一个应用服务器通过其中一个驱动程序连接到您的 MongoLab 数据库是有意义的。 In your case it sounds like this would be pymongo.在您的情况下,这听起来像是 pymongo。

-will -将要

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

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