Hacker News new | ask | show | jobs
by taurenk 4177 days ago
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?

2 comments

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.