如何在iOS中连接亚马逊RDS [英] How to connect amazon RDS in iOS

查看:34
本文介绍了如何在iOS中连接亚马逊RDS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个应用程序,我在其中使用 Amazon Simple db,但现在我已将 simple db 更改为 amazon rds mysql.简单的 db 有自己的 api 和框架作品来访问 iOS 中的数据库和表,但如何在 iOS 中访问 amazon rds mysql 知道如何完成这项工作.如果还有其他方式 libaray 可以在 iOS 应用程序中使用 amazon rds,他们让亚马逊拥有用于简单数据库的库,谢谢

I am making an app in which i was using Amazon Simple db but now i have changed the simple db to amazon rds mysql. Simple db had own api and frame works to access the data base and tables in iOS but how to access amazon rds mysql in iOS any idea how to get this done. They have Amazon have libraries for simple db if there is any other way libaray to use amazon rds in iOS app thanks

推荐答案

Amazon RDS 实例是常规的 MySQL/Oracle/... 数据库.您可以从任何设备或平台连接到它,前提是您有驱动程序.

Amazon RDS instances are regular MySQL / Oracle / ... databases. You can connect to it from any device or platform, provided you have a driver for it.

Mysql 有一个 C 驱动程序(见这个问题 如何在 Mac OS X 上安装 MySQL Connector/C?)适用于 Mac OS X 和 iOS.

There is a C driver for Mysql (see this question How to install MySQL Connector/C on Mac OS X?) that works on Mac OS X and iOS.

如果您想从 iOS 应用程序访问 RDS MySQL,您必须将此驱动程序包含在您的二进制分发版中,并使用驱动程序从您的代码中公开的函数.

If you want to access RDS MySQL from an iOS application, you must include this driver in your binary distribution and use the functions exposed by the driver from your code.

然而,从架构的角度来看,我质疑这种方法.通过 API 层(位于 iOS 应用程序和数据库之间的 Web 应用程序)访问数据库有很多好处.

On an architectural point of view, I however question this approach. There are many benefits to access your database through an API layer (a web application sitting in between your iOS App and the database).

好处是:- 解耦:不向客户端应用程序公开数据结构- 可扩展性:API 可以在使用只读副本或分片时跨数据库进行负载平衡- 安全性:一个 API 可让您强制执行身份验证和授权

Benefits are : - decoupling : do not expose data structure to client app - scalability : the API can load balance accross DB when using read replica or sharding - security : an API let you enforce authentication and authorisation

这篇关于如何在iOS中连接亚马逊RDS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆