I have developed a service that is REST based, which makes calls to a separate database server. Both of these are currently hosted on digital ocean, as separate servers - probably not best practice.
I would like to create a simple website that can show off what I have just created (eventually users will be able to make calls directly or use the site to access data). From what I understand, It seems it would be best practice to put the RESTful engine and the Database behind a VPN - where a user could send calls to the engine and get some results back. I am not sure whether i should put the app server behind the VPN as well.
Does anyone have any advice on how to set this up/best practices - or if this is even the proper way to do this? I am lagging a bit behind in my web tech skills, so please bare with me if any of this sounds strange. Any help is greatly appreciated!
The database should not be on a public network or have a public IP address, so that only the REST app can reach it. (In fact if it were all on a single box, you'd want the db to bind only to 127.0.0.1.)
Assuming the web pages will contact the REST app via Ajax, the REST app will need a public IP and should accept connections from anywhere. But if it's the web server that hits the REST service, then as you say the REST service can be private like the database.
I think maybe you are saying "VPN" to mean what DO calls "Shared Private Networking" and AWS calls "VPC". Is that right? To most people "VPN" means an encrypted tunnel that lets you pretend to be on a LAN even if you are remote, so that is maybe why some other replies are asking questions about that.
It sounds like you are doing great so far. Good luck with the rest! :-)