Hacker News new | ask | show | jobs
by rubyn00bie 4188 days ago
As the other commenter said, you definitely want the db on a different server. Hosting the database on your application servers is generally a terrible idea as the DB will starve for resources.

I'm not in anyway sure why would want a VPN in this case as it's "Virtual Private Network." Are you trying to anonymize it or protect it from some sort of local authority? I don't care either way, I just can't figure out the VPN deal.

Maybe you're talking about setting an "upstream" connection to proxy requests to? That is to say, you want to set up a load balancer so you can distribute requests amongst many app servers?

If you can give us more details on the environment (web server, app server, or your end goal) I'm sure someone here will be happy to fill in the blanks.

1 comments

So my goal was to take this code I created in Python, and turn it into a REST engine [Probably via Flask]. The Database Server is running PostgreSQL.

I would like to create an application server that simply takes user input, call the REST engine and, returns the results in a "pretty" manor.

I am trying to figure out how to deploy this all in the best way, in a hosted envionment. I suppose i can rephrase: what is the best [and simplest] way to host a 3 tiered app?

Probably you want to expose REST API to the web application. Everything you need is just set up domain for your RESTful service and setup CORS settings to access REST API from application server, no matter where web application server would be. The database should have no public IP and should be in the same network as your REST server is. If I were you, I set up for the first time everything on the same server on EC2 instance for example. Then using Docker I 'd set up accurate deployment system. Then "scale" it to three separate servers. You should keep DB on dedicated instance because of performance and because you probably will need (if so) to use master/slave replication or kind of scaling.

Don't do it on early stage. Just make it somehow working for the first time, until existing infrastructure become unstable/laggy.

*I mentioned CORS assuming you want to access the REST via browser.