Bromo Programmer
Bromo Programmer

Reputation: 670

How to refactor Java web application for Amazon Web Service?

I just migrated my Spring applications from a VPS provider to Amazon Web Service. So what I did were:

  1. Redeploy my app inside EC2,
  2. Change the DB connection from localhost:3306 to RDS MariaDB,
  3. Implementing S3 for all of the file upload operations
  4. And etc.

And I managed to make my app steadily running under AWS now.

Now I need to make some enhancement on my app, then I realized that I couldn't simply replicate those RDS and S3 features in my laptop. So I turned to Eclipse's AWS Toolkit because it provides a nice development and testing experience. But I found out that most of AWS Toolkit tutorial in making a java web app is by using AWS Elastic Beanstalk resource. Which my current app is not using.

My question now: Do I have to refactor my app to use Elastic Beanstalk? (this approach surely not in my favor)... or is there anyway (must be) I can develop java web app in AWS without using Elastic Beanstalk and still using the privileges of AWS Toolkit?

Please anybody who has done this before care to show me a link or tutorial?

Regards, Bromo

Upvotes: 0

Views: 145

Answers (1)

Mark B
Mark B

Reputation: 201048

You do not have to, or even need to use Elastic Beanstalk. What you have done so far is perfectly reasonable. Also, Elastic Beanstalk really won't help you with the issue of running things locally. It would help you to spin up a test environment on AWS, but you would still have the same issues if you wanted to run it entirely locally.

Regarding running things from your local laptop, you should be able to run a database server locally. Is there a specific reason you can't seem to get your application to connect to a local database when running on your local computer, instead of trying to connect to an RDS database?

For S3 you could maintain a separate set of code that uses the local file system when running locally, although that would prevent you from testing your S3 code. Alternatively you could setup a "test" S3 bucket and have your code connect to that S3 bucket when running locally. Another alternative would be to run some sort of S3 emulator service locally, like this, but I've never used one of those so I can't say how well that would work.

Upvotes: 1

Related Questions