Tallaght Campus

Department of Computing

Web Application Architecture
  1. Web Applications

    Web Applications

    More often than not, the overall entity that responds to client requests on the WWW is functionally more than a web server in the strictest sense of the word. Apart from 'talking' HTTP and locating resources for response content, a server entity may implement complex business (or other) logic and handle (possibly vast amounts of) data.

    Functions of a Server on the WWW

    • An application on the WWW is no different from any other application, which essentially perform three functions:
      • presentation
      • carrying out of business or other logic and actions
      • data handling
    • The way that applications are designed at the logical level takes these functions into account. The most commonly used logical architectural pattern is model-view-controller (MVC).
    • The way applications are deployed also takes functionality into account. Depending on the size and subject domain of the application, the functions may be co-located or physically separated. The physically separate entities that constitute an application are called tiers.
  2. Web Application Design Considerations

    Web Application Design Considerations

    A number of factors are considered when designing a web application. These affect the architecture of the system, both at the logical design and deployment phase.

    • Construction and testing process - technologies, division of labour
    • Re-use - will some components be re-useable or are they specific to this application?
    • Scalability
    • Data views - user types, data protection
    • Multiple UIs - will more than one UI be used with the application?
    • Target client devices - PC, mobile etc.
  3. Model-View-Controller (MVC)

    Model-View-Controller (MVC)

    • MVC is an architectural design pattern for applications. It is not a design but a logical principle that can be applied in the design of a system.
    • MVC originates from Smalltalk (1979)
    • The idea of MVC is that the user interface and data-handling are separate, both communicating with an intermediate component, the controller. This means that:
      • data (the model) can be changed without this affecting the user interface (the view)
      • changes to the user interface (the view) do not automatically affect the data (the model)
      • application logic (the controller) is contained in a third part of the application, which also dictates how the data (the model) and user interface (the view) are handled
    • Advantages of MVC (a modular architecture) over monolithic applications:
      • replaceability of components e.g. support for different user types with the same application
      • easier to develop
      • testability
      • maintainability
    • Different deployment models (the way the application is placed on physical resources) can be used for MVC application, for example:
      • 3-tier (see N-Tiered Architectureb )
      • single-tier (these notes are on a simple server with a single tier)
  4. N-Tiered Architecture

    N-Tiered Architecture

    • The word 'architecture' in 'N-Tiered Architecture' refers to the physical architecture of a (deployed) application.
    • The user agent (e.g. browser), which is the application used by the person on the client side, is not part of any of these tiers. The tiers pertain to the architecture on the server side.
    • The number of tiers in an application refers to how the three functional types are physically grouped.
      • One tier means that they are all grouped together.
          This sort of architecture is used when:
        • the server is purely a web server (the business logic and data functions are trivial or non-existent)
        • the server-side functionality is limited, even if it includes business logic and data functions
        • the server serves a small community (hobby)
        • for testing
      • Two tiers means that one of the functions is separate while two are grouped together.
        Figure: Two-tiered architecture (picture by E. Lee)
      • Three tiers means that each of the functional types is deployed separately.
        Figure: Three-tiered architecture (picture by E. Lee)
        • exchanges never take place directly between the presentation and data tier, but the business logic tier communicates with both
      • Sometimes more than three tiers are used, with the splitting of a functionality type (most often 'business logic') into sub-functions.
    • An N-tiered architecture does not imply that the web application is deployed on exactly N machines. The number of actual machines used is typically many more than N, as each tier is deployed on multiple machines for scalability and redundancy.
    • Advantages of deploying an application in more than one tier:
      • easier to maintain
      • allows re-use of components
      • faster and easier-to-organise development through division of work:
        • web designer works on the presentation functionality
        • software developer builds the logic part
        • business modeller designs and database administrator implements the data model