REST API AWS cloud using java

a 夏天 提交于 2019-12-31 01:23:32

问题


I am new to AWS , want to develop a cloud ready java application REST API.

The application will hit the MySQL database and produce output as JSON after querying the database.

IP:port/application?q=<query> response is JSON.

How to achieve it ? the data in MySQL is mostly static 100MB data but used very frequently.


回答1:


It is very straight forward. if you already have same application running in your local system , then you can just move it to AWS , using below steps :-

  1. spin up new ec2 instance, if you are using a free-tier then you can spin up lots of AWS resources for free , more information on https://aws.amazon.com/free/ .

  2. install all the required s/w like Java, maven , tomcat and mysql and whatever your application is using on Ec2 instance . you can even have a free RDS (Database) instance in free tier which you can use for your application , instead of having the database installed locally on your application server.

  3. while creating the ec2 server , configure instance security group properly for ex 8080 for http and 22 for SSH , 3306 for mysql etc. (This is important and try to be as restrtict as possible to make it safe from hackers).

  4. build and deploy your application and access it using any REST client , by giving instance ip and application port number.

There are several resources online for AWS , you can refer https://www.youtube.com/watch?v=oS7VYX7LXUo which talks about deploying a java application to AWS.

Let me know if you need any other information.



来源:https://stackoverflow.com/questions/41235012/rest-api-aws-cloud-using-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!