title: N-tier architectural patterns for web apps
body: <p>I'm looking for architectural patterns of server-side software, particularly web apps, that have been used for good reason in the real world. Here are some I can think of:</p>
  
  <ul>
  <li><strong>single-server</strong>: all parts of the app run on the same server (database, app, web server listening to port 80 etc.)</li>
  <li><strong>simple 2-tier</strong>: database runs on single server "DB", all other parts in an "appserver" tier, which may contain any number of servers. The tiers communicate via ODBC or such.</li>
  <li>of this, variations (how many? can we enumerate them?) include single-master/multiple-slave DBs servers, and multi-master DB servers</li>
  <li><strong>3-tier</strong>: database runs on one tier, business objects and logic run on a second tier, presentation on a third tier, where 1 and 2 communicate via ODBC and 2 and 3 via some form of remote calls (e.g. RMI)</li>
  <li>I seem to recall from some presentation that at one point, eBay had an architecture that had an app tier generate XML, which then was transformed into HTML in a separate tier. Is that common or an oddity?</li>
  <li>a bunch of web apps use memcachedb or such to speed things up. A set of caching servers are arguably another tier perhaps?</li>
  </ul>
  
  <p>Could you help me enumerate some of these patterns, or point to places where some have been described?</p>