简体   繁体   English

如何使用 aws ec2 作为 Android 应用程序的后端

[英]how to use aws ec2 as back end to android app

I was using godaddy web hosting services where i used to put my php rest api.我使用的是godaddy 网络托管服务,我曾经在其中放置我的 php rest api。 And use mysql database through it.并通过它使用mysql数据库。 also i used to store images and videos on file storage.我也曾经将图像和视频存储在文件存储中。

In AWS lot of things were there I'm not even understanding the proper way to start through it.在 AWS 中有很多事情,我什至不明白开始的正确方法。

  • if i want Mysql database shall i go for EC2 or RDS.如果我想要 Mysql 数据库,我应该选择 EC2 还是 RDS。 and how to start with this以及如何开始
  • if i want to put my rest api where i need to save that如果我想把我的休息 api 放在我需要保存的地方
  • if i want to store images and videos how to store it in ec2 or some other thing if I'm wrong.如果我想存储图像和视频,如果我错了,如何将其存储在 ec2 或其他一些东西中。

Kindly give some detail answer and please don't link me again to the same official document page as if i understood their itself why i need to ask on stackoverflow.请给出一些详细的答案,请不要再将我链接到同一个官方文档页面,就好像我理解他们本身为什么我需要在 stackoverflow 上提问一样。

  1. MySQL is available to RDS users, so you can do that. MySQL 可供 RDS 用户使用,因此您可以这样做。 So from your back-end you can easily connect to that.因此,您可以从后端轻松连接到它。
  2. Your back-end( rest api ) can be on EC2.您的后端(rest api)可以在 EC2 上。 From the code you can always connect to you RDS database just like any other database.从代码中,您始终可以像任何其他数据库一样连接到 RDS 数据库。 you will get host , username and password for RDS.您将获得 RDS 的主机、用户名和密码。
  3. Use S3 bucket to save images/videos.使用 S3 存储桶保存图像/视频。 You can then you simple S3 api to save and retrieve your images.然后,您可以使用简单的 S3 api 来保存和检索您的图像。 Files are stored with a unique Id to S3 bucket which makes them easy to access.文件使用唯一的 Id 存储到 S3 存储桶,这使它们易于访问。

Every thing from above is available in aws free tier account上面的所有内容都可以在 aws 免费层帐户中使用

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

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