Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
810 views
in Technique[技术] by (71.8m points)

mysql - How to connect amazon RDS in iOS

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.

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.

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).

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...