Systems Architecture: Client/Server Systems Naim R. El-Far, PhD Candidate TA for SEG3202 Software Design and Architecture with N. El-Kadri (Summer 2005)

Slides:



Advertisements
Similar presentations
Network Programming Chapter 11 Lecture 6. Networks.
Advertisements

Technical Architectures
Socket Programming.
1 Java Networking – Part I CS , Spring 2008/9.
1. Introducing Java Computing  What is Java Computing?  Why Java Computing?  Enterprise Java Computing  Java and Internet Web Server.
Asper School of Business University of Manitoba Systems Analysis & Design Instructor: Bob Travica System architectures Updated: November 2014.
Chapter 9: The Client/Server Database Environment
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
Client/Server Architecture
Lecture The Client/Server Database Environment
The Client/Server Database Environment
CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer.
CEG3185 Tutorial 4 Prepared by Zhenxia Zhang Revised by Jiying Zhao (2015w)
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Chapter 2 Database System Concepts and Architecture
A global, public network of computer networks. The largest computer network in the world. Computer Network A collection of computing devices connected.
Socket Programming in Java -First Step of Network Programming-
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Babak Esfandiari (based on slides by Qusay Mahmoud)
TCP/IP protocols Communication over Internet is mostly TCP/IP (Transmission Control Protocol over Internet Protocol) TCP/IP "stack" is software which allows.
Hands-On Microsoft Windows Server 2003 Networking Chapter Three TCP/IP Architecture.
Chapter Two Application Layer Prepared by: Dr. Bahjat Qazzaz CS Dept. Sept
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 3: TCP/IP Architecture.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Unit – I CLIENT / SERVER ARCHITECTURE. Unit Structure  Evolution of Client/Server Architecture  Client/Server Model  Characteristics of Client/Server.
Sockets process sends/receives messages to/from its socket
RGEC MEERUT(IWT CS703) 1 Java Networking RGEC Meerut.
Copyright © Curt Hill, Client – Server Computing An important paradigm.
1 Introduction to Middleware. 2 Outline What is middleware? Purpose and origin Why use it? What Middleware does? Technical details Middleware services.
14 - Client/ServerCSC4071 Systems Architecture Client-Server Systems.
Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.
1. I NTRODUCTION TO N ETWORKS Network programming is surprisingly easy in Java ◦ Most of the classes relevant to network programming are in the java.net.
1 Welcome to CSC 301 Web Programming Charles Frank.
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
1 Chapter 28 Networking. 2 Objectives F To comprehend socket-based communication in Java (§28.2). F To understand client/server computing (§28.2). F To.
4061 Session 25 (4/17). Today Briefly: Select and Poll Layered Protocols and the Internets Intro to Network Programming.
9 Systems Analysis and Design in a Changing World, Fourth Edition.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 2-1 Data Models Data Model: A set.
ECE450 Winter 2003 Systems Architecture: Client-Server Systems “A human being should be able to change a diaper, plan an invasion, butcher a hog, conn.
14 - Client/ServerCSC4071 Systems Architecture Client-Server Systems.
TCP/IP Protocol Stack IP Device Drivers TCPUDP Application Sockets (Gate to network) TCP: –Establish connection –Maintain connection during the communication.
Prepared by Dr. Jiying Zhao University of Ottawa Canada.
UNIT-6. Basics of Networking TCP/IP Sockets Simple Client Server program Multiple clients Sending file from Server to Client Parallel search server.
BMTS 242: Computer and Systems Lecture 1: Introduction to Computer System Yousef Alharbi Website
Socket Programming in Java -First Step of Network Programming-
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
CLIENT SERVER COMPUTING. We have 2 types of n/w architectures – client server and peer to peer. In P2P, each system has equal capabilities and responsibilities.
SOCKET PROGRAMMING WITH JAVA By Collin Donaldson.
1 Network Communications A Brief Introduction. 2 Network Communications.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
Networking Mehdi Einali Advanced Programming in Java 1.
Network Programming. These days almost all devices.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Lecture 9: The Client/Server Database Environment Modern Database Management 9 th Edition.
IST 201 Chapter 11 Lecture 2. Ports Used by TCP & UDP Keep track of different types of transmissions crossing the network simultaneously. Combination.
Socket Programming Ameera Almasoud
Chapter 2 Database System Concepts and Architecture
The Client/Server Database Environment
Chapter 9: The Client/Server Database Environment
#01 Client/Server Computing
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Data, Databases, and DBMSs
Lecture 1: Multi-tier Architecture Overview
Internet Protocols IP: Internet Protocol
Database System Architectures
Client-Server Systems
Exceptions and networking
#01 Client/Server Computing
Network programming Lecture 1 Prepared by: Dr. Osama Mokhtar.
Presentation transcript:

Systems Architecture: Client/Server Systems Naim R. El-Far, PhD Candidate TA for SEG3202 Software Design and Architecture with N. El-Kadri (Summer 2005) Tutorial 1 of 4 – 27/5/2005

Friday 27/5/2005Naim R. El-Far 2 About Me Naim R. El-Far PhD Candidate DISCOVER SITE Please always start your subject line with the course code (SEG3202) Office: SITE (DISCOVER Lab). Office Hours: None scheduled. By appointment only.

Friday 27/5/2005Naim R. El-Far 3 About Today’s Material Slides based on presentations by N. El-Kadri of the University of Ottawa ( and Dr. D. Penny of the University of Toronto ( Material also from the Carnegie Mellon Software Engineering Institute web site (

Friday 27/5/2005Naim R. El-Far 4 Tutorial Outline 1. A Re-introduction to Software Engineering 2. The Software Engineering Process: Architecture vs. Design 3. Classification of Software Architectures 1. Monolithic 2. Client/Server 3. N-tiered 4. Introduction to Client/Server Architectures 5. Examples of Client/Server Architectures 6. Division of Work in Client/Server Architectures 7. Inter-Process Communications 8. Quantifying Communication Performance 9. A Quick Survey of Socket Programming in Java 10. A Quick Survey of SQL Programming in Java

Friday 27/5/2005Naim R. El-Far 5 Introduction: Software Engineering In the context of engineering a sizable software project: Plan your work, and work your plan. Modifications along the way are inevitable, but the more work you put in planning out the project up front, the more likely the project would go smoothly.

Friday 27/5/2005Naim R. El-Far 6 Introduction: Software Engineering (cont.) This is what software engineers do! More formally, IEEE defines software engineering as: “The application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software”. To be systematic, disciplined, and able to quantify our work, we need to … classify, categorize, and divide into modules!

Friday 27/5/2005Naim R. El-Far 7 Introduction: Software Engineering Process The Software Engineering process, is twofold: 1. Make decisions regarding the systems-level architecture. 2. Implement and perform programming-level design.

Friday 27/5/2005Naim R. El-Far 8 Introduction: Software Engineering Process (cont.) The concept of Architecture vs The concept of Design 1. Strategic 2. High-level decisions about the system structure and components 3. System-scope 1. Tactical 2. Programming-level decisions about how to implement the architecture 3. Component(s)- scope

Friday 27/5/2005Naim R. El-Far 9 Introduction: Software Engineering Process (cont.) Architecture and design in the development process:

Friday 27/5/2005Naim R. El-Far 10 Introduction: Software Architecture Definition How do we formally define Software Architecture? (SEI) Structure or structures of the system, which consists of software components, the externally visible properties of those components, and the relationships among them.

Friday 27/5/2005Naim R. El-Far 11 Introduction: Software Architecture Design What do software architecture decisions involve? Specifying at the highest level the construction of the system: Technology choices Platforms, language, database, middleware, etc System construction How can we best construct the system logically and physically Hardware interfaces (if any) Division into programs E.g. a program for data entry, another for data analysis, a Web-oriented interface, etc. Division of programs into major subsystems Reuse strategy (shared subsystems) Calls constraints Major strategies (e.g., for persistence, IPC, etc.)

Friday 27/5/2005Naim R. El-Far 12 Introduction: Software Architecture Classification How do we classify different software architectures? Convention is to classify based on number of conceptual/physical layers running the software components. In other words, a tier-based system: 1.1-tier software architectures: Aka Monolithic systems (from the Greek mono-lithos, or single rock), e.g. word processors, PowerPoint, and stand-alone applications. 2.2-tier software architectures: Aka Client/Server systems, e.g. Internet browsers, large database systems, etc. 3.N-tier software architectures: Systems that have 3 or more layers as described above, e.g. complex business and banking databases.

Friday 27/5/2005Naim R. El-Far 13 Introduction: Software Architecture Classification (cont.) Monolithic architecture example: Payroll for a small business Scenario: Small business with 1 location 5 Employees Single computer (computer A) with local database containing each employee’s hourly rate and number of hours worked. John’s pay (calculated on A) = John’s hourly rate (stored on A) x the number of hours John worked (stored on A) But what if the business grows and now has several locations and tens of employees?

Friday 27/5/2005Naim R. El-Far 14 Introduction: Software Architecture Classification (cont.) Monolithic architecture

Friday 27/5/2005Naim R. El-Far 15 Introduction: Software Architecture Classification (cont.) Server/Client architecture example: Payroll for a large business Scenario: Large business with 6 locations and 80 employees. 4 locations share a single employee database (stored on server A) while the other 2 share another database (stored on another geographically distant server B) Payroll report generated at business headquarters at a third location on computer C. John’s Pay (calculated on C) = John’s hourly rate (stored on A) x the number of hours John worked (stored on A) Computer C is a client computer that requests information from server A. A “client” requests, and a “server” serves, hence client/server architecture. But what if the business goes multinational and calculating payroll becomes different from one employee to another?

Friday 27/5/2005Naim R. El-Far 16 Introduction: Software Architecture Classification (cont.) Client/Server architecture

Friday 27/5/2005Naim R. El-Far 17 Introduction: Software Architecture Classification (cont.) N-tier (N=3) architecture example: Payroll for a large multinational business Scenario: Large business with 400 employees in 2 different countries: Canada and France. Full work week in Canada is 40 hours, but in France is 35 hours. Overtime in Canada is calculated at 1.5 times the hourly rate, but in France it is 1.3 times the hourly rate. Different deductions in Canada than those in France. More “business rules”. To calculate payroll in a client/server architecture, we will need to modify the rules at the client level for each client. If we introduce a middle-tier to host all “business rules” then all client requests can be standardized, and all database schemas can remain independent (in that they are not affected by changes in the client or middle- ware software). The middle-tier will take care of everything else.

Friday 27/5/2005Naim R. El-Far 18 Introduction: Software Architecture Classification (cont.) 3-tier architecture

Friday 27/5/2005Naim R. El-Far 19 Introduction: Software Architecture Classification (cont.) Today’s emphasis is on the Client/Server Architecture

Friday 27/5/2005Naim R. El-Far 20 Client/Server Architecture: Introduction How do we formally define the client/server software architecture? (SEI) The client/server software architecture is a versatile, message- based and modular infrastructure that is intended to improve usability, flexibility, interoperability, and scalability.

Friday 27/5/2005Naim R. El-Far 21 Client/Server Architecture: Introduction In general, any application where multiple clients connect to a single server. client1client2client3 server

Friday 27/5/2005Naim R. El-Far 22 Client/Server Architecture: Introduction Worth noting, client/server systems were not the first response to the inadequacy of monolithic systems. Before, there was: 1. The Mainframe (dumb terminal/ smart mainframe) architecture, and 2. The File-Sharing (smart desktop/dumb storage) architecture.

Friday 27/5/2005Naim R. El-Far 23 Client/Server Architecture: Examples Relational Database Management System (RDBMS) Most common client/server program is where the server is a relational database server. Warning: some use the term client/server to refer to this usage exclusively. RDBMS client1client2client3

Friday 27/5/2005Naim R. El-Far 24 Client/Server Architecture: Examples (cont.) RDBMS Implementation disks client1client2client3 RDBMS Server

Friday 27/5/2005Naim R. El-Far 25 Client/Server Architecture: Division of Work Mainframe architecture: dumb client (terminal), overworked smart server (mainframe). File-sharing architecture: smart but irresponsible client (terminal), dumb server (networked storage device). Client/Server architecture: smart client, smart server.

Friday 27/5/2005Naim R. El-Far 26 Client/Server Architecture: Division of Work (cont.) Client machine’s typical responsibilities: Manage the user interface (typically a GUI) Manage the interface with the operating system (and by extension, system resources) Validate data before communicating with server Communicate with server (send/receive) Some logic (depending on the application)

Friday 27/5/2005Naim R. El-Far 27 Client/Server Architecture: Division of Work (cont.) Server’s typical responsibilities: Listen for and receive requests from clients Process the request enforcing all relevant logic Respond to client

Friday 27/5/2005Naim R. El-Far 28 Client/Server Architecture: Inter Process Communications Q) How do the clients/servers and clients/servers communicate (Inter- Process Communication – IPC)? Remember, client/server architectures must respect the heterogeneity of their components and the need for their interoperability. A1) How about memory sharing? Makes no demands on heterogeneity and interoperability Very fast! Not ideal for networks

Friday 27/5/2005Naim R. El-Far 29 Client/Server Architecture: Inter Process Communications (cont.) A2) How about message passing? Preserves heterogeneity and interoperability (if standardized) Not as fast as shared memory but if standardized correctly, fast enough Ideal for networks Common protocols for IPC in Client/Server architectures: 1.Socket (Transmission Control Protocol - TCP, User Datagram Protocol - UDP) 2.Remote Procedure Calls – RPC 3.Distributed Objects - DO

Friday 27/5/2005Naim R. El-Far 30 Client/Server Architecture: Quantifying Communication Performance Remember, Software Engineering is ““The application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software”. We’ve so far been systematic and disciplined in our approach. We’ve have nothing to quantify really, until now.

Friday 27/5/2005Naim R. El-Far 31 Client/Server Architecture: Quantifying Communication Performance (cont.) How fast you get information (communication speed) is two-fold (disregarding monetary cost for the moment): 1. How much information you can get at a time (bandwidth), and 2. How long it will take to get more information (latency).

Friday 27/5/2005Naim R. El-Far 32 Client/Server Architecture: Quantifying Communication Performance (cont.) Concorde: 100 passengers (low bandwidth), 3 hour London to New York flight time (low latency). Boeing 747: 500 passengers (high bandwidth), 8 hour London to New York flight time (high latency)

Friday 27/5/2005Naim R. El-Far 33 Client/Server Architecture: Quantifying Communication Performance (cont.) Q) How do we formally define bandwidth (in the context of quantifying communication performance)? A) The amount of data that can be transferred through a digital connection in a given time period (i.e., the connection's bit rate). In such cases, bandwidth is usually measured in bits or bytes per second.

Friday 27/5/2005Naim R. El-Far 34 Client/Server Architecture: Quantifying Communication Performance (cont.) List of common connection bandwidths: DeviceBandwidth 56k Modem53.3 kb/sec 128k ISDN128 kb/sec USB Full-Speed12 Mb/sec Bluetooth 23 Mb/sec T11.54 Mb/sec Ethernet10 Mb/sec Gigabit Ethernet1 Gb/sec

Friday 27/5/2005Naim R. El-Far 35 Client/Server Architecture: Quantifying Communication Performance (cont.) How accurate are these bandwidth numbers? If we send a large file on a round-trip through a connection medium, then chances are, it’ll come back later than the theoretic values in the table predict.

Friday 27/5/2005Naim R. El-Far 36 Client/Server Architecture: Quantifying Communication Performance (cont.) Q) How do we formally define latency (in the context of quantifying communication performance)? A) The time it takes for a given message to make a “round-trip” to a given destination in a network. Throughput: the observed bit rate as opposed to bandwidth, which is the theoretic bit rate. Throughput < Bandwidth because of overhead.

Friday 27/5/2005Naim R. El-Far 37 Client/Server Architecture: Quantifying Communication Performance (cont.) Balancing Bandwidth and Latency: What does you application need more? A “Concorde” or a “747 Jumbo jet”? Satellite communication (16 Mbits/sec for Internet) but 1 – 2 sec latency: Bad for online gaming, great for TV broadcast.

Friday 27/5/2005Naim R. El-Far 38 Client/Server Architecture: Quantifying Communication Performance (cont.) Given that typically local communication has bandwidth several orders of magnitude greater than network communication, and has latency several orders of magnitude less than network communication: 1. Limit network communication as much as possible (i.e. do as few calls as possible remotely) 2. Preference given to asynchronous protocols 3. Larger transactions 4. Communication should maximize data while minimizing frequency of communication.

Friday 27/5/2005Naim R. El-Far 39 Client/Server Architecture: A Quick Survey of Socket Programming in Java Good introductory tutorial available at w /jw-12-sockets.html w /jw-12-sockets.html Again, a socket is an IPC channel identified uniquely by a port number and an IP address Programming paradigm: Traditional stream open  read/write  close, just like file I/O

Friday 27/5/2005Naim R. El-Far 40 Client/Server Architecture: A Quick Survey of Socket Programming in Java (cont.) Socket programming can use two communication protocols: 1. UDP/IP: User Datagram Protocol over Internet Protocol. Connectionless and does not guarantee delivery. 2. TCP/IP: Transmission Control Protocol over Internet Protocol. Establishes a connection, then streams data guaranteeing sequential delivery.

Friday 27/5/2005Naim R. El-Far 41 Client/Server Architecture: A Quick Survey of Socket Programming in Java (cont.) Client side: Opening a socket: Socket MyClient; try { MyClient = new Socket("Machine name", PortNumber); } catch (IOException e) { System.out.println(e); } Port number should be greater than (20 for FTP data, 21 for FTP control, 53 for DNS, 80 for HTTP, 110 for POP3, 443 for HTTPS, 569 for MSN)

Friday 27/5/2005Naim R. El-Far 42 Client/Server Architecture: A Quick Survey of Socket Programming in Java (cont.) Server side: Opening a socket: ServerSocket MyService; try { MyServerice = new ServerSocket(PortNumber); } catch (IOException e) { System.out.println(e); } We also need a socket to listen to and accept requests from clients: Socket clientSocket = null; try { serviceSocket = MyService.accept(); } catch (IOException e) { System.out.println(e); }

Friday 27/5/2005Naim R. El-Far 43 Client/Server Architecture: A Quick Survey of Socket Programming in Java (cont.) Client side: Opening an input stream: DataInputStream input; try { input = new DataInputStream (MyClient.getInputStream()); } catch (IOException e) { System.out.println(e); }

Friday 27/5/2005Naim R. El-Far 44 Client/Server Architecture: A Quick Survey of Socket Programming in Java (cont.) Server side: Opening an input stream: DataInputStream input; try { input = new DataInputStream( serviceSocket.getInputStream()); } catch (IOException e) { System.out.println(e); }

Friday 27/5/2005Naim R. El-Far 45 Client/Server Architecture: A Quick Survey of Socket Programming in Java (cont.) Client side: Opening an output stream: PrintStream output; try { output = new PrintStream(MyClient.getOutputStream()); } catch (IOException e) { System.out.println(e); }

Friday 27/5/2005Naim R. El-Far 46 Client/Server Architecture: A Quick Survey of Socket Programming in Java (cont.) Server side: Opening an output stream: PrintStream output; try { output = new PrintStream(serviceSocket.getOutputStream( )); } catch (IOException e) { System.out.println(e); }

Friday 27/5/2005Naim R. El-Far 47 Client/Server Architecture: A Quick Survey of Socket Programming in Java (cont.) Client side: Closing the sockets: try { output.close(); input.close(); MyClient.close(); } catch (IOException e) { System.out.println(e); }

Friday 27/5/2005Naim R. El-Far 48 Client/Server Architecture: A Quick Survey of Socket Programming in Java (cont.) Server side: Closing the sockets: try { output.close(); input.close(); serviceSocket.close(); MyService.close(); } catch (IOException e) { System.out.println(e); }

Friday 27/5/2005Naim R. El-Far 49 Client/Server Architecture: A Quick Survey of SQL Programming in Java SQL: Structured Query Language. A standard language for querying and modifying relational databases Very intuitive (although database relations can become a little convoluted)

Friday 27/5/2005Naim R. El-Far 50 Client/Server Architecture: A Quick Survey of SQL Programming in Java (cont.) SELECT * FROM employees WHERE DeptID=3 INSERT INTO supplier (supplier_id, supplier_name) VALUES (24553, 'IBM') DELETE FROM supplier WHERE supplier_name = 'IBM';

Friday 27/5/2005Naim R. El-Far 51 Client/Server Architecture: A Quick Survey of SQL Programming in Java (cont.) Java programs running on client machines need a way (an API or middleware) to communicate with the SQL engine running on the server machine Enter JDBC: Java Database Connectivity. JDBC is a Java API that enables Java programs to execute SQL statements. This allows Java programs to interact with any SQL-compliant database. Note: Open Database Connectivity (ODBC) and its up and coming successors are the non-Java alternative.

Friday 27/5/2005Naim R. El-Far 52 Client/Server Architecture: A Quick Survey of SQL Programming in Java (cont.) import java.sql.*; public class Main { private static final query = “select itemname,quantity “ + “from orderitems,items “ + “where orderid=1 and orderitems.itemid=items.itemid”; public static void main(String[] args) throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection c = DriverManager.getConnection("jdbc:odbc:grocery"); Statement s = c.createStatement(); if( s.execute(query) ) { ResultSet r = s.getResultSet(); printResults(r); } private static void printResults(ResultSet r) throws Exception { final int nC = printHeadings(r); printRows(nC, r); } … }

Friday 27/5/2005Naim R. El-Far 53 Recap Software engineering is simply applying engineering concepts to the software lifecycle. System-level architecture (1-tier, 2-tier, 3-tier, platforms, languages, hardware, etc) and programming-level design (OO, procedural, logical, data structures, etc) Client/Server architecture in-depth: physical and logical layers, division of work, inter-process communication Communication metrics: speed, latency, bandwidth, and throughput Java socket programming in client/server architecture Java interfacing with SQL-based RDBMS