Applications are usually broken into logical chunks called "tiers", where every tier is assigned a role. Though many variations are possible, the most common structure is the three-tiered application. A web browser is the first tier. The application logic is the middle tier and a database is the third tier. The web browser sends requests to the middle tier, which returns queries or updates the database and may generate a new page.
Single Page Applications
A single-page application interacts with the user by dynamically rewriting the current page rather than loading an entirely different page. This approach avoids interruption of the user experience between successive pages making the application behave more like a desktop application. They either load all the necessary code with a single page load, or dynamically load as necessary. Interaction with the single page application often involves dynamic communication with the web server. HTML5 introduced support for applications that can store data locally and continue to function while offline.
Single-page applications aren’t compatible with search engine optimization, they are not the best choice for comsumer sites. In the cases where these applications are consumer products, often a classic model is used for a landing page or marketing site, which provides meta data for the search engine query. Analytics tools such as Google Analytics rely heavily upon entirely new pages loading in the browser. Single Page Applications have a slower first page load than server-based applications. A server-based application just has to push out the required HTML to the browser, reducing the latency and download time. Single-page applications are best used for nonpublic access sites hidden behind authentication.
Responsive web design can be used to make a web application. A conventional website or a single-page application can be made viewable on small screens and work well with touchscreens.