Ask HN: How do you build your webapp on top of your API

1 points by blcArmadillo ↗ HN
A week or so back there was a discussion regarding whether flask was better than django. Some people were arguing that flask had better REST support; making it superior since it's "best" to have your backend basically be an API that you then build your web app, mobile app, etc on. I've seen this structure advised before and have always wondered how does this work efficiently. I agree that this seems like a good way to structure an app since it gives you one point with which to interact with your data. But, unless you have a nice javascript frontend that just makes AJAX calls to the backend won't all requests require two HTTP requests: one HTTP request from the user to your server to get the page and then another HTTP request from your server to your API to get data? Wouldn't this add extra latency or can it be assumed to be almost negligible since the servers are likely located physically close to one another?

NOTE: I'm only curious to know the answer to this question. I don't really care whether flask is better than django or vice versa, that was simply included for background so please no flame wars :)

0 comments

[ 4.5 ms ] story [ 10.2 ms ] thread

No comments yet.