3-tier application architecture A technical view

Slides:



Advertisements
Similar presentations
Objectives In this session, you will learn to:
Advertisements

Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
1 CS 502: Computing Methods for Digital Libraries Lecture 22 Web browsers.
MSc IT UFIE8K-10-M Data Management Prakash Chatterjee Room 3P16
BICS546 Client/Server Database Application Development.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Introduction to ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Static vs. Dynamic Web Pages.NET Framework Installing ASP.NET First.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
Introduction to Web Database Processing
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
Lecture 2 Web application architecture. Themes Architecture : The large scale structure of a system, especially a computer system Design choice: The need.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Introduction to Web Interface Technology (CSE2030)
Multiple Tiers in Action
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
Apache Tomcat Server Typical html Request/Response cycle
Introduction to Web Interface Technology (CSE2030)
Information Systems Development 3 Lecture 2 3-tier application architecture A technical view.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
1 Web Servers (IIS and Apache) Outline 9.1 Introduction 9.2 HTTP Request Types 9.3 System Architecture 9.4 Client-Side Scripting versus Server-Side Scripting.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 13 Slide 1 Application architectures.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
INTRODUCTION TO WEB DATABASE PROGRAMMING
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
NETWORK CENTRIC COMPUTING (With included EMBEDDED SYSTEMS)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Web Application Architecture and Communication. Displaying a Web page in a Browser
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Databases and the Internet. Lecture Objectives Databases and the Internet Characteristics and Benefits of Internet Server-Side vs. Client-Side Special.
Week 7 Lecture Web Database Development Samuel Conn, Asst. Professor
Chapter 1: Introduction to Web
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
Lecture 7 Interaction. Topics Implementing data flows An internet solution Transactions in MySQL 4-tier systems – business rule/presentation separation.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Implementation - Part 2 CPS 181s March 18, Pieces of the Site-building Puzzle Page 180, figure 4.1.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
1 Welcome to CSC 301 Web Programming Charles Frank.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
Web Architecture Introduction
Web Technologies Lecture 8 Server side web. Client Side vs. Server Side Web Client-side code executes on the end-user's computer, usually within a web.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Introduction and Principles Web Server Scripting.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Submitted by: Moran Mishan. Instructed by: Osnat (Ossi) Mokryn, Dr.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Section 6.3 Server-side Scripting
Web Development Web Servers.
PHP / MySQL Introduction
Database Driven Websites
Lecture 1: Multi-tier Architecture Overview
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Web Application Development Using PHP
Presentation transcript:

3-tier application architecture A technical view Database Management 3-tier application architecture A technical view

Themes Architecture : The large scale structure of a system, especially a computer system Communications : The interaction between components Database: enabling applications with database driven applications

Displaying a Web page in a Browser Click on a link on a page <a href= http://www.cems.uwe.ac.uk/~cjwallac/UFIE8K/workplan.html>Workplan</a> URL is decoded: protocol:://host/file Host is decoded using DNS to get the host IP address 164.11…. Page requested from HTTP server on the host (apache) Page is returned HTML codes determine how text is rendered If page contains links e.g. <img src=red.gif>, browser must repeat the same process on each

Dynamic Web page needed when: consistent look and feel on each page of a large site data is derived from a database depends on real time pages depend on user choice business transactions e.g. e-commerce…

3-tier architecture A Presentation layer using Browser technology An Application layer using a web application server platform + application programs A Persistence layer using a relational database or other data store technology

Bus timetable BUS (Level 1 Diagram) users a information need presentation layer 1 application 2 HTTP requests persistance 3 SQL requests tables HTML files information service providers b timetables Browser such as IE6, FoxFire Apache or MS IIS server + PHP MySQL RDBMS Bus timetable

Presentation layer arch Issue request to remote server accept the returned HTML (or JPEG..) file render (i.e. create a 2-d image ) the HTML allow plug-ins to handle new file types execute client-side scripts in JavaScript support interaction between client-side scripts and the web page accept user input via a variety of controls on a form

Persistence layer arch support application interaction with the database using standard languages e.g SQL queries and table returns define and modify the data structures (e.g. tables) themselves ( the Database Schema) insert, update and delete data maintain data persistently, with backup and recovery handle transactions to support concurrent access to the database via locking et optimise access by compilation of queries, indexing, replication of tables etc.

Application Layer arch accepting requests from the Presentation layer interpreting the requests according to business rules and past transactions from this client requesting the appropriate data from the Persistence layer using SQL Handling the returned result codes and tables computing derived data creating the HTML (or GIF, MIDI..) for the page providing run-time support for: thousands of concurrent users compilation to machine code multi-threading [ allow multiple processes to run concurrently] caching [holding results in a temporary store to reduce re-calculation]

Web Application Platforms Server side includes - files with a .shtml extension Cgi using Perl or other scripting language PHP like SSI, a scripting language which is embedded in an HTML page. Microsoft’s ASP (Active Server Pages ) J2EE JSP for page scripting Java + class library Multiple runtime vendors Tomcat, BEA .NET is the latest technology from MS. range languages (VB.NET, C#, , C++, Cobol... ) compiled to a common intermediate code (MSIL) Extensive class library ASP.NET scripting page scripting

3-tier Issues Advantages: Challenges: Re-use of appropriate software Software can be located on different machines for convenience and performance Resolves one-many relationships – many clients – one application, many applications – one database Challenges: well-defined, standardised interfaces between layers required. Software must be built to conform to interface standards The designer has to decide where to locate specific functions

Communication The ‘glue’ in this architecture is communication between software in the layers A single request from a user results in a complex flurry of communications and executions The flurry is composed of hundreds of simple interactions Sequence diagrams can be useful to provide a simplified description

Sequence diagram of SMS bus times request

Other layered architectures ANSI/SPARC Database model The external or user level, characterised by Views The Conceptual level, comprising the full corporate data model at a logical level The Physical level, where data is stored in files

Channels between Layers Layered communications model (Tanenbaum) Application Layer Transport Layer Network Layer Data Link Layer Physical Layer Presentation <> Middleware HTTP (The protocol which supports GET and POST messages) carrying a limited number of types of content (MIME types) Middleware <> Data stores ODBC with SQL request and table returns (whole table or row at a time)

SMS straw poll A simple application to tally votes on an issue. A simple database to hold details of candidates and votes. Votes are texted into the server from a mobile phone, and are processed by cast.php At any time, the current status of the poll can be displayed using tally.php

Casting a vote

The simple database

The generated SQL CREATE TABLE tcandidate( candid CHAR(1) NOT NULL, candname VARCHAR(40) NOT NULL, CONSTRAINT pk_tcandidate PRIMARY KEY (candid) ) TYPE=INNODB; CREATE TABLE tvoter( voteid CHAR(10) NOT NULL, CONSTRAINT pk_tvoter PRIMARY KEY (voteid) ALTER TABLE tvoter ADD INDEX (candid), ADD CONSTRAINT fk1_tvoter_to_tcandidate FOREIGN KEY(candid) REFERENCES tcandidate(candid) ON DELETE RESTRICT ON UPDATE RESTRICT;

Initialising the database delete from tcandidate; insert into tcandidate values('B', 'George Bush'); insert into tcandidate values('K', 'John Kenney');

The cast script (simplified) <?php /* input text the vote from the originating mobile number */ // map text to candidate id $query = "select * from tcandidate where '$text' = candid"; $dbresult = mysql_db_query($db,$query,$dblink); $cand = mysql_fetch_object($dbresult); $cid = $cand->candid; // insert the vote for this mobile $query = "insert into tvote values('$from', '$cid')"; print "Reply: you cast your vote for $cand->candname"; ?>

The tally script (simplified) <?php // get the total number of votes cast $query = "select count(*) as total from tvote"; $dbresult = mysql_db_query($db,$query,$dblink); $total_tally = mysql_fetch_object($dbresult); $total = $total_tally->total; // get the total for each candidate $query = "select *, count(*) as tally from tvote natural join tcandidate group by tcandidate.candid"; //generate the results table while($cand = mysql_fetch_object($dbresult)) { $tally = $cand->tally; $tpc= round(( $tally/ $total ) * 100,2); $tpcr = round($tpc,0); print "$cand->candname has $tpc % <br/>"; } print "$total votes cast"; ?>

Exam application Input is a spreadsheet Design a suitable normalised data model