doulin6448 2018-01-17 23:02
浏览 52
已采纳

CodeIgniter Rest Server与Amazon AWS

I have to create an API (JSON REST) for a project that has recently moved onto AWS, with a PHP CodeIgniter code-base, and an RDS database.

I have a bit of a dilemma, because I'm unsure what route to take to create the API. My two options seem to be:

  • Create an API with CodeIgniter Rest Server
  • Use AWS, using a combination of Lambda and the API Gateway to GET and POST to my RDS database.

The paramount priority is security, so that points towards using AWS, as far as I understand, but after failing in my attempt to make a small scale mock-up on AWS, I'm left a bit confused.

I wondered if anybody had any input as this is somewhat of a niche question, and I've had no interaction with AWS or CodeIgniter Rest Server.

Thank you for your time!

  • 写回答

1条回答 默认 最新

  • duan0531 2018-01-18 08:59
    关注

    I can help you in a bit since I've experience with deploying Codeigniter base web system onto AWS.

    First of all, the security in questions... AWS wont help much. Yes, it is by default have more security layer. But it is no use if your application itself is not secured.

    So here goes:

    1. If you want to deploy fast, I'd suggest go through EC2, install one of the image that have LAMP configured (from market, should've free image that you can use)
    2. Upload to the server, configure the right config
    3. Then it should work as per what it is intended.

    But if you want to utilized auto scaling features

    1. Setup the Elastic Beanstalk (EB) for PHP environment
    2. ZIP up the codeigniter source code with all setting configured as below
    3. Database setting point to RDS
    4. Session to use database driver and create the needed table in the RDS
    5. Upload and deploy to the EB
    6. Then hopefully everything is working fine

    Then, if to use API Gateway & Lambda, you will actually need to learn a bit more things.

    1. How to configure API Gateway, to get familiar with how to use it
    2. How to "link" it to lambda
    3. How Lambda need to read request & response back etc
    4. Also on Lambda no PHP support yet, so need to learn nodejs/python etc in order to use it

    Basically if want to use API Gateway & Lambda you might need to start the development from scratch.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化