Web Application Architectures
Traditional Web Applications
- Server accepts request
- Generates HTML response
- Response rendered in browser
- User interacts with page
- Actions result in new request/response cycle
- returns a page with a list of cities and a form to filter the list
- user enters a filter term, clicks 'submit'
- application generates a new page showing only those cities starting with 'Syd'
- returns HTML page to client, browser displays it
Applications are often structured as MVC with a database model, application logic in the controller and a view layer to create suitable output HTML pages. All of these parts run on the server to generate a response to the HTTP request.
Front End Web Applications
Modern applications rely more on the front-end - the browser. They make use of the fact that modern web browsers are very capable platforms for running complex code. Web applications are now true distributed systems with work being done both on the browser and in the back-end server.
- Modern applications push more work to the browser (front-end)
- Used first for form submission, more responsive
The interaction between the browser based application and the server is now much simpler - the browser requests data from the server and then renders it into the HTML page. User interaction may result in new requests being sent for more data or form data being submitted to carry out actions.
The browser is also now much more capable as a data store. The WebStorage API implemented by modern browsers allow pages to store large amounts of data within the browser associated with a particular domain. Using this mechanism, Google Mail can store all of the headers for your email messages within your browser meaning that it can quickly rebuild the main page display without having to make a request to the server.