I have a java REST service which is very CPU intensive. The service serves a website.
I would like to host the service on my local machine which has 8 core 16GB RAM, SSD as the main storage and high speed internet connection with static IP.
But, I also like to have amazon EC2 as backup, in case my local machine is down for some reason. This is for redundancy sake.
Following is my plan:
The service will be by default serve from my local machine.
In case the local machine instance is down, a high performance amazon EC2 instance will spin up and start serving the rest URL. And, when the local machine is back online, the ec2 could be stopped automatically or manually.
How to automatically start amazon ec2 instance only when my local instance is down.
How to automatically route the service request from the website to the healthy instance (my local machine or amazon ec2).
How to securely host the service locally which could serve the website. I understand, my ISP doesn't block inbound 8080 port. Should I try oracle VM image or something similar.
Any other suggestions to my plan are welcome. I want to reduce the cost.