简体   繁体   English

如何在Google App Engine上连接到远程RDBMS

[英]How to connect to a remote RDBMS on Google App Engine

I understand that GAE uses its own NoSQL Big Table Datastore for persistence. 我了解GAE使用自己的NoSQL Big Table数据存储区来保持持久性。 But I'm wondering if it's possible to connect to an external/remote/non-GAE DB. 但是我想知道是否可以连接到外部/远程/非GAE DB。

I see JDBC is not supported , at least as of August 2012. But I'm wondering if there's any other way to hit a remote DB and pull in data. 我看到至少在2012年8月之前不支持JDBC 。但是我想知道是否还有其他方法可以访问远程数据库并提取数据。

I'm weak on JDO, but I believe it supports RDBMS connections. 我在JDO方面不强,但我相信它支持RDBMS连接。 So, one potential avenue might be to find a "JDO driver" for the RDBMS (MySQL) and bundle it up with my WAR. 因此,一种潜在的途径可能是为RDBMS(MySQL)找到一个“ JDO驱动程序”,并将其与我的WAR捆绑在一起。 Other than that, I'm out of ideas. 除此之外,我没有主意。 Any thoughts? 有什么想法吗?

GAE不允许传出连接IIRC(任何人都可以自行纠正),因此,不管JDO(或更好的JDO实现)功能如何,它都不会到达GAE之外。

For any future readers, here's what I've decided. 对于任何将来的读者,这就是我的决定。 I'm going to host a secure (HTTPS) RESTful web service on a non-GAE server, perhaps Amazon EC2 or Beanstalk, perhaps just a simple GoDaddy server. 我将在非GAE服务器上托管安全 (HTTPS)RESTful Web服务,该服务器可能是Amazon EC2或Beanstalk,可能只是一个简单的GoDaddy服务器。 It doesn't really matter because this part of my app doesn't need to be scaleable. 没关系,因为我的应用程序的这一部分不需要扩展。

This web service will wait for a RESTful API call from my GAE app. 该Web服务将等待来自我的GAE应用的RESTful API调用。 This call will contain the necessary connection info for the RDBMS it needs to connect to. 该调用将包含它需要连接到的RDBMS的必要连接信息。 The web service will contains all the necessary JDBC drivers for the capabilities it needs. Web服务将包含其所需功能的所有必需的JDBC驱动程序。

Upon receiving the call, it will connect to the appropriate (remote) RDBMS, pull the data it needs (provided by the instructions inside the call), and then use GoogleSQL's web service to insert the data into my GoogleSQL datastore. 收到呼叫后,它将连接到适当的(远程)RDBMS,提取所需的数据(由呼叫中的说明提供),然后使用GoogleSQL的网络服务将数据插入我的GoogleSQL数据存储区。 Once its in there, my GAE app will have free reign on it. 进入该目录后,我的GAE应用将可以免费使用它。

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

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