N-Tier Architecture


Overview
  • The number of tiers is based on the number of layers (presentation, application, data, ...), not the number of physical computers used
  • Multiple layers can exist on the same computer
Program logic
  • UI code: Displaying UI elements and handling UI events
  • Database code: Fetching and storing data in a database
  • Business logic: Processing the fetched data based on UI commands
Single-tier
  • The database and program logic runs on a single machine (standalone, or accessed via a dumb terminal)
Two-tier
(client-server)
  • The database runs on a central server and most or all of the program logic runs on a client computer (a workstation)
  • Pros
  • Puts less of a load on the server
  • Cons
  • Requires more-powerful client computers (fat clients)
  • Difficult to update the business logic over a wide range of client computers
  • All clients are susceptible to lack-of-service if the server is down
Three-tier
(thin client)
  • Database runs on a server (data layer)
  • Business and database logic runs on a middle-tier server (application layer) (i.e. application server, middleware)
  • User interface runs on the client (presentation layer)
  • Thin clients consist almost entirely of the user interface
  • If a web browser is used for the user interface, a wide range of computers can be used as a thin client
  • The system is easy to maintain as long as the interface between the presentation and application layers doesn't change
  • Low bandwidth requirement between clients and middle-tier servers
  • High bandwidth requirement between database and middle-tier servers
  • Pros
  • Lightweight client computers (easy to maintain)
  • Low bandwidth requirements (better scalability)
  • Forced separation of UI and business logic
  • Business logic is confined to a single machine
  • Redundant application and data servers
  • Data replication and synchronization
  • Load balancing

Quick Info