ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS eCommerce Technology Lecture 4: Web Architecture
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Client-Server Model INTERNET CLIENT (Often a Web browser) SERVER Client makes requests Server responds
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Two-Tier Architecture SOURCE: FOURNIER TIER 1: CLIENT TIER 2: SERVER Server performs all processing Web Server Application Server Database Server This architecture is obsolete. Server does too much work.
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Three-Tier Architecture TIER 1: CLIENT TIER 2: SERVER TIER 3: BACKEND Application server offloads processing to tier 3 SOURCE: FOURNIER Web Server + Application Server Note: Using 2 computers instead of 1 can result in a huge increase in simultaneous clients. Depends on % of CPU time spent on database access.
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS N-Tier Architecture SOURCE: FOURNIER Achieves full separation of function and administration Huge number of simultaneous clients Managed and tuned by DBA Optimized for web page delivery Coded for specific application
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS InterShop Architecture SOURCE: INTERSHOP
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Connecting to Legacy Systems by “Wrapping” Web App Web Server Legacy App MAINFRAME “WRAPPER” Wrapper Middleware
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Connecting to Legacy Systems The “screen scraper” Client Web server Legacy database Terminal screen data Screen scraper Existing application HTML data Legacy system (mainframe) SOURCE: WIM GEVERS
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Screen Scraping Some systems produce as their only output commands to 80 x 24 display terminals Sequences of characters telling the terminal to move its cursor and display data, e.g. ^M0238Jan. ^M024416, ^M displays “Jan. 16, 2000” in row 2, starting at col. 38 Screen scraping involves virtual simulation of the display terminal to retrieve the data Vendors –Intelligent EnvironmentsIntelligent Environments
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Document Repository Office Tool Internet & Web Web Browser Data Warehouse Query Tool Enterprise System ERP Client Information System CRM Client Groupware Database Groupware Client E N T E R P R I S E P O R T A L Content Directory TextMetadata Embedded Services Web ToolsApplications Portal Architecture PartnersEmployees Customers SOURCE: PLUMTREE
Portal Architecture SOURCE: MIKE CRANDALL, GATES FOUNDATIONMIKE CRANDALL, GATES FOUNDATION LOB = “LINE OF BUSINESS”
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Server Farms Web Servers App Servers DB Servers Router Intranet Firewall Network Switch Router Internet Firewall Network Switch SOURCE: ATESTO To serve many clients, one server is not enough How do multiple servers cooperate?
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Communication Request Routing Server Cluster (Server Farm) Internet Clients Server farm HTTP request System Management Router SOURCE: CHU-SING YANGCHU-SING YANG
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Server Selection Problem Which network site? Which server? “Contact the weather service.” Server Farm A Server Farm B Avoid scalability problems of central servers by distributing load SOURCE: JEFF CHASE
Load Balancing Switch ‧ ‧‧‧‧ ‧ ‧‧‧ ‧‧‧ Internet Web Switch Router Server Farm subnet SVR.1 SVR.2 SVR.n client Internet subnet Virtual IP address SOURCE: CHU-SING YANGCHU-SING YANG
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Domain Names IP addresses are inconvenient to remember v. euro.ecom.cmu.edu (fully qualified) Domain names are alphanumeric aliases for IP addresses. They form a tree structure of FQDNs: ROOT.GOV.COM.MIL.NET.EDU.ORG.IT CMU PITT MIT AMAZON MCKINSEY YAHOO GSIA CS ECOM HEINZ WWW YEN EURO DOLLAR PESO
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Domain Name System What is the IP address of abc.foo.com? SOURCE: CISCO SYSTEMS client Local DNS Resolver Try.com Root DNS.com DNS Try foo.com foo.com DNS abc.foo.com is Cache Large, distributed, worldwide database Maps domain names to IP addresses
URL-Based Load Balancing Substring matching for: “images” “.gif” “.jpg” GET/ GET / GET / Load distributed within group via any standard metric or URL hashing Substring matching for: “.cgi” “.bin” “.exe” Substring matching for: “.html” Servers optimized for specific content-types Substring match on URL directs HTTP requests to designated server farm –Load balancing using configured algorithm or, –URL Hashing forwards requests for each unique URL to same server to take advantage of server memory caching SOURCE: SUN
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS DNS Round Robin Balancing “lookup a DNS server for nhc.noaa.gov bcd client network DNS server “ is IP address a” (or {b,c,d}) Idea: When an IP address is requested for nhc.noaa.gov, return a different IP address each time SOURCE: JEFF CHASE SERVER CLIENT
Web Data Center SOURCE: SUN
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Global WAN Architecture BIG-IP Server Array Webmaster Site I newyork.domain.com Site III tokyo.domain.com Site II losangeles.domain.com User london.domain.com Local DNS DNS GLOBAL-SITE Router BIG-IP Internet SOURCE: EDWARD CHOWEDWARD CHOW
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Client- and Server Side Programming Client Internet Server HTML Dynamic HTML Applets ActiveX Controls JavaScript CGI/Perl, C XML ASP Servlet JSP SOURCE: IITIIT
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Tiers and URLs Web Server DB Web app http: // / catalog / display.asp ? pg = 1 & product = 7 SOURCE: NTOBJECTIVES.COMNTOBJECTIVES.COM URLs can be used for application routing
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS PHP Process Flow Web Server PHP Pre- processor.php source file Browser Internet Request for.php file Raw.php source HTML is substituted for PHP code HTML SOURCE: M. HAMILLM. HAMILL PHP originally mean “Personal Home Page”
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Website Components Web Server DB Web app Web Client Web app HTTP request (cleartext or SSL) HTTP reply (HTML, Javascript, VBscript, etc) Plugins: Perl C/C++ JSP, etc Database connection: ADO, ODBC, etc. SQL Database Apache IIS Netscape etc… Firewall SOURCE: NTOBJECTIVES.COMNTOBJECTIVES.COM
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Major Ideas Client-server model Three-tiered (n-tiered) architecture Legacy connections Portals Server Farms Web development tools Client- and server-side tools
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Q A &