且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

结合使用Amazon RDS和android应用程序

更新时间:2023-01-23 14:25:37

RDS不是数据库引擎。这是一项服务,可为您管理基础架构,以维护高可用性和容错数据库。它支持许多不同的引擎,例如您提到的MySQL。请阅读文档以了解更多信息。

RDS is not a database engine. It's a service that manages the infrastructure for you that's required to maintain a highly available and fault tolerant database. It supports a number of different engines such as MySQL as you mentioned. Please read the docs for more information.

您需要以与连接任何MySQL数据库相同的方式连接到RDS MySQL实例。使用支持MySQL的库,并使用数据库的主机名,用户名和密码。

You need to connect to your RDS MySQL instance the same way you would connect to any MySQL database. Using a library that supports MySQL, and using the hostname, username and password for your database.

但是,将电话客户端连接到数据库可能不是***的设计远程地。***的办法是在与数据库接口的AWS上放置一个REST API。

However, it's probably not the best design to have phone clients connecting to your database remotely. The best thing to do would be to put a REST API on AWS that interfaces with your database.

让n个用户使用您的应用程序从每部手机连接到您的数据库可能不是一个好主意。这意味着您需要在数据库中拥有更多功能,极大地阻碍了您的可伸缩性,并且由于数据库暴露在互联网中而使事情变得不那么安全。有了它前面的API,您可以构建更具容错能力,可扩展性和解决方案的服务器。

Having n users connected to your database from each handset using your app is probably a bad idea. It means you need to have more power in your database, greatly hinders your scalability and makes things less secure as the database is exposed to the internet. With an API in front of it, you can build a much more fault tolerant, scalable and solution.

构建移动应用的云方式是(在一定程度上) )在云上构建您的应用程序逻辑,只需将您的客户端代码连接到您的API。这样,您无需为每个平台管理单独的应用程序级代码,就可以轻松地扩展到更多平台(例如IOS,Web)。您只需要管理与现有API集成的代码即可。

The "cloud way" to build mobile apps is to (within reason) build your application logic on the cloud and simply have your client code connect to your API. This way you can spread to more platforms (eg. IOS, Web) much more easily as you won't have to manage separate application level code for each platform. You'll just need to manage code that integrates with your already existing API.

看看此白皮书 。忽略Web服务器层,而专注于App Server和数据库层。这可能是***的设计。

Take a look at this whitepaper. Ignore the web server tier and focus on the App Server and Database tiers. This is probably the best design to go by.