n tier client/server concepts norman white stern school of business csntier.ppt

80
N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Upload: theresa-howard

Post on 19-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

N Tier Client/Server Concepts

Norman White

Stern School of Business

Csntier.ppt

Page 2: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Agenda

• Background

• Hardware concepts

• Data communications

• TCP/IP

• Physical networks

• Database management systems

Page 3: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

But First, Some Background

• Computer Fundamentals (hardware, software)

• Data Communications

• Networking …

Page 4: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Hardware Components

Page 5: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Primary Hardware Components

• Processor

• Primary Storage (RAM)

• Secondary Storage– Disk, tape etc.

• Data Channel(s)

• I/O Controllers

• Other Peripheral devices

Page 6: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Processor

Memory (RAM)

diskcontrollervideo

R

registers

Data Channel

Components

Page 7: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Processor

• Executes and decodes instructions• Different Processors understand different sets of

instructions• Instructions are stored in primary storage and

brought into the processor to execute• Processor also has local storage called registers,

this is where arithmetic is done

Page 8: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Registers

• How many– More registers are better– Means more info is in the processor so it can be

processed faster

• Sizes (bits/bytes etc..)– Larger registers mean you can manipulate more

information at a time– Less need to retrieve information from memory

Page 9: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Instruction Set

• Types of instructions – Instruction set is the complete set of machine

language instructions that the computer understands

– RISC computers (Reduced Instruction Set Computers) have very simple instructions that can be executed very quickly. Simple design means less cost, power. More software.

Page 10: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Data Channel

• Used to transfer information between different system components

• Most PCs have one main channel ( “the system bus”)

• Mainframes have many data channels, allowing them to transfer large amounts of information between components

Page 11: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

I/O Controllers

• Controllers are used to manage a class of devices, like disk drives

• Each type of device has its own controller (E.G. VGA card, serial card etc.)

• Controllers send information to memory across the data channel

• Controllers handle the idiosyncracies of different devices

Page 12: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Secondary Storage

• Peripheral devices that can hold information for later retrieval

• Disk, Tape, CDROM, diskettes

Page 13: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Software Concepts

• Software is the program that you run on the computer

• Two major types– Application Software – Accomplishes a business

purpose• Examples Word, Access, Excel

– Systems Software – Aids in running/developing applications

• Operating Systems – Windows, NT, Unix, Linux• Languages – C, C++ Java, Cobol, Visual Basic etc.• Utilities

Page 14: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

DATA COMMUNICATIONS

Some Basics

Page 15: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Communication Components

• SOURCE

• SINK

• MEDIUM

SOURCE MEDIUMSINK

telephonecable satellite

Page 16: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Communications Media

• Telephone

• Satellite

• Cellular

• Cable

• Fiber Optic

• Infrared

• etc.

Page 17: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Analog / Digital

• Analog– Represent information as a waveform

• Music, video,voice

• Digital– Represent Information as a string of bits

• Digitization– Convert from analog to digital by sampling the

waveform at fixed intervals– ISDN phone line 64000 bits per second

• 8000 samples per second (each sample an 8 bit (0-255)) Number

Page 18: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Modems modulator/demodulator

• Converts Digital signal to analog so it can be sent over phone lines

• Reconverts analog to digital on other end

01110000

0

1 1 1

00 0

0

Page 19: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Digital Communications

• ISDN - Integrated Services Digital Network– New communications will allow full digital

communications, higher bandwidth, fewer errors ($30/mnth in NJ)

• Cable et al. – Very high digital bandwidths to your home

• Fiber Optic– Country backbone network already digital

• ADSL– Asymmetric Digital Subscriber Line – uses existing copper

Page 20: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Communications Protocols

• Need rules to communicate between systems• Communications protocols are the rules for a

particular method of communication– Who says what, when

– How are errors handled

– How much information in a message

– How is message routed from sender to receiver

Page 21: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Asynchronous vs. Synchronous Protocols

• Asynchronous - A single character is a message– Errors sometimes detected, but no recovery

– Horizontal parity used to detect single character errors

• Synchronous - A group of characters constitute a message– Synchronous protocols usually recover from errors

Page 22: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Types of Synchronous protocols

• Bisynchronous– Point to point conversation

– Not used much any more

– Each message is acknowledged as received

• Multilateral protocols– Messages routed from one machine to another

– Message includes address of destination

– Needs to be routed by intermediate nodes

Page 23: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

TCP/IP Model

• Application Layer – Applications and processes that use network

• Host-host Transport Level – end to end data delivery

• Internet layer – defines the datagram and handles data routing

• Network Access layer – routines for accessing physical networks

Page 24: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

TCP/IP

Protocol of the Internet

Page 25: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

History

• Originally developed as a protocol that would withstand wide network outages (Arpanet)

• Now it has become the standard protocol for almost all data communications

• Consists of two parts, IP ad TCP

Page 26: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

TCPTransmission Control Protocol

• Handles communications between 2 processes anywhere on internet

• Guarantees correct data is received by receiver

• Uses IP for delivery and routing of packets

Page 27: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Packets/Datagrams

• Fixed size blocks of information that are sent using TCP

• Packet includes information like– Address of host to send this to– Address of host it is coming from– Destination Port Number– Sending Port Number– MAC address of sender/receiver (hardware address)– Sequence info– Data

Page 28: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

IP - Internet Protocol

• Handle datagrams

• Defines Internet addressing scheme

• Routes datagrams to remote hosts

• Performs fragmentation and reassembly of datagrams

Page 29: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

IP Addressing

• Every host has an address in the form of www.zzz.yyy.zzz (the “IP” address)

• Each subcomponent refers to a particular breakdown of all of the machines on the internet.

• 128.122.197.133 = sales.stern.nyu.edu– 128 = edu domain– 122 = nyu network– 197 = subnet at stern– 133 = address of sales computer

Page 30: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Name Resolution

• The TCP/IP protocols include the concept of “name lookup”, where names like sales.stern.nyu.edu are translated into their numeric addresses

• (128.122.197.133)

• Hence one has to specify the locations of the “name servers” you wish to use.

Page 31: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Gateways

• Gateways (also called IP routers) are the computers used to connect your network to the internet

Page 32: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Sockets and ports

• TCP/IP uses “ports” to connect services between machines

• The destination machine has particular ports offering different types of service– 23 = telnet , 80 = WWW etc.

• Client machine uses random port• Combination of destination port and originating

port = socket (i.e a destination port that is in use)

Page 33: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Standard TCP/IP Services

• telnet - 23• rlogin• ftp - 21• NFS - Network File Service - 2049• Talk - 517• Ping - • Finger - 79• Sendmail - 25

Page 34: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Other TCP/IP Services

• World Wide Web (usually port 80)– Hyper media interface to internet– Connects clients and servers using HTTP

• Hyper Text Transfer Protocol

– Subset of the internet– Hottest area right now

• Cuseeme, Netmeeting – Interactive video

Page 35: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

TCP/IP Problems

• Current standard has several major problems– Address space limitations

• xxx.yyy.www.zzz limits number of nodes

• Out of space in another year or so

– No Quality of Service guarantees• Difficult to stream audio/video etc

• Need client and server to be able to negotiate quality of service, especially for streamed multimedia

Page 36: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Summary

• TCP/IP is the “language” of the internet• Many other services are based on the basic

TCP/IP support• All of these services are “client/server”

– Like the WWW– WWW uses HTTP (Hyper Text Transfer

Protocol)

• New Version of TC/IP IPv6 coming

Page 37: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Physical Networks

Page 38: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Types of Physical Networks• Star

– All nodes connected to a central point which routs information

– Inexpensive– Prone to failure

• Bus – All nodes connected to a single cable – All message seen by all station simultaneously– Cheap, throughput limited at high volumes

• Ring– Messages passed from on machine to the next

Page 39: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Packet Switched Networks

• Problem – How do we fully connect thousands of computers together? (How many wires?)

– 2 computers – 1

– 3 computers – 3

– 4 computers - 6

– 5 computers – 10

– N computers – (N*(N-1)/2)

– 1000 computers – about .5 million connections

• Solution

– Don’t connect every computer to every other computer, instead “route” information from one computer to another

Page 40: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Packet Switched Network

Page 41: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Network Communication Protocols

• Protocol– Rules to follow telling each computer what to

send where, when – Packet switched protocols include routing of

packets from source to destination– Protocols also define rules to follow if there are

errors, I.e. how to recover, retransmit etc.

Page 42: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Higher level protocols

• Low level protocols route packets (of bits) around the network. Packets include address

• High level protocols know what the packets contain – TCP/IP client server protocols

– Client sends requests over network to a “server” program running on another computer

– WWW C/S application

Page 43: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Client Server Concepts

• A program on one computer (the Client) can request services from a program on another computer (the Server)

• Client issues requests to a server someplace on the network

• Requests are specially formatted messages which can be understood by almost any type of computer

• Requests are sent using a “standard” telecommunications protocol

Page 44: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

CS Concepts

• Server responds with a message in the “standard” format

• Client receives message and processes it

Page 45: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Example – WEB Requests

• In the WWW model, the client is the browser (Netscape, I.E.) running on your computer

• The server is the web server running somewhere on the internet

• Both the client and server must be connected through a TCP/IP communications network

Page 46: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

N Tier Client Server

• The situation gets more complex, if the initial (Tier 1) server in turn becomes a client and requests services from another server in order to process the web request. There are now 3 programs running on 3 different computers involved in the processing of the web request.

Page 47: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

User

Web Browser

Web Server

Data Base Server

Client Server

Page 48: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Issues in Client/Server

• Fast developing standards

• Isolates users from mainframe architecture

• Enables application specific machines

• Heterogeneous software and hardware

• Subtle performance issues

Page 49: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Advantages

• Application code is “closer” to the user

• Application/server independence

• Portability

• Scalability

• Performance ?

Page 50: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Performance Issues

• Client App needs to be optimized for C/S• Client only goes to server when necessary• Not well suited for high-update

environment• Good for applications with relatively static

data

Page 51: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

C/S Architectures

• Two tier– Clients connect directly to servers

– Example PC clients, LAN DB server, Web server

• Three … N tier– Clients connect to intermediate servers which in turn

issue requests to other servers

– Examples• PC to UNIX to IBM Mainframe

Page 52: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Common Terms

• Gateway servers – A server which translates requests from one protocol to another (like an interpreter)

• Application Service Providers (ASPs)– New web based services which allow a

company to outsource certain types of processing (email, calendar systems etc.)

– As bandwidth increases ASPs should grow rapidly

Page 53: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

N Tier CS

User

Web Browser

Web Server

Data Base Server

Application

Server

Page 54: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

More Terms

• JAVA – Sun developed language that runs code on the user’s machine (i.e. built in to the web browser)– Off loads processing from server– Basis for new JINI language for appliances

• FAT Client– Term used to refer to putting all of application code on

the user’s machine (on the hard drive)• THIN Client –

– Distribute applications directly over the internet using JAVA. App is downloaded everytime your run it.

• CACHE– Keep recently used html pages, images, applets etcs on

user hard drive. Only download when they change

Page 55: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Even More Terms

• TCO– Total Cost of Ownership – includes support

• HTTP– Hyper Text Transfer Protocol – Protocol of the WWW

• Applet– A compiled Java program ready for distribution over

WWW

• Digital Signature– Numeric identifier indicating that a document hasn’t

been compromised or that authenticates the creator.

Page 56: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Common Server Examples

• Data Base Servers• Application Servers• Ad Servers (Double Click)• Multimedia (audio/video servers)• Calendar Servers• Authentication (LDAP) servers• Mail servers• Proxy Servers

Page 57: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Management Takeaway

• CS computing isolates each layer from the other layers.• Computers can be added as necessary to scale

performance• Processing can happen anywhere, so that bottlenecks

can be eliminated• Machines can be dedicated/optimized for different

kinds of processing• Can start with everything on one machine, but add

machines as load grows• Needs TCP/IP network protocol

Page 58: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Thin Client vs. Fat Client

• Thin Client – User only needs a machine capable of running a web

browser and fast enough to run JAVA– Applications distributed/managed centrally– Updates to users done automatically

• FAT Client– Most application logic resident on users computer– Significant compatibility problems– Users could easily mess up machines by loading new

software, even if they never use it.– TCO 50% higher than Thin Client– Microsoft has attempted to address this in Windows 2000

Page 59: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Thin Client Where is it appropriate?

• Thin client (sometimes called Network Computer) model is best for smaller applications that are used by a large number of users. I.E. Data entry and simple business applications

• Not that many JAVA Applets (YET!) but growing fast

• Most likely scenario is a mixture, with Thin client used for enterprise wide apps and fat client used for more personal applications.

Page 60: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Database Mgt Systems

An Overview

Page 61: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Problems w/ FILE oriented systems

Redundant data Different names for the same fields File redesign means app redesign No central data control Hard to change structure No end-user interface to data No common directory

Page 62: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Primary DMS Concepts

Data independence» Data Independence of programs

Data definition language» High level language to define items

Data mgt. language» Language to query and manipulate data

Data dictionary» Common repository of data definitions

Page 63: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Advantages

Central mgt. of data Standardized data names

» less confusion» eases coding

Data redundancy reduced Programs independent of data

structures

Page 64: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Advantages...

Different user views (sub schemas) Security provisions Record lockout/concurrency automatic Recovery built-in Non-programmer interface (i.e. SQL) Can retrieve data from remote systems

(I.e. Client Server Access)

Page 65: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Disadvantages

More training required Technical staff more expensive More complex environment $$$ Software costs Performance problems

Page 66: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Types of DBMS systems

Hierarchical Network Relational Object-oriented

Page 67: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Relational Concepts

A.Tables– All data in tables– All meta data in tables– Tables have rows (tuples)– Tables have columns (attributes)– All data in a column has same domain– No repeating groups (First normal form)– Cells are single valued– Column order doesn’t matter– Row order doesn’t matter

Page 68: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Relational Concepts...

B. Relational Operators– Union– Difference– Intersection– Product– Projection (new table)– Selection (query)– Join

Page 69: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Relational Concepts...

C. Normalization» Functional dependencies

– Relationship between or among attributes– Keys (group of attributes)

» Eliminate update anomalies

Page 70: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Relational Concepts

D. Normal “forms”» 1st Normal

– No repeating groups

» 2nd Normal– All non-key attributes dependent on all of the key

N.B.: all single key relations 2nf...

» 3rd Normal– No transitive dependencies– BCNF--- Every determinant is a candidate key

Page 71: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Relational Concepts

D. Normal Forms cont..» 4th Normal

– No multivalued dependencies

» 5th Normal– Too obscure to describe

» DKNF Normal– All constraints logical consequence of keys and

domains

Page 72: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Entity Relationship Models

View a system as entities and relationships

Name the entities and relationships Depict the type of relationship

» one-to-one» one-to-many» many-to-many

Page 73: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Entity-Relationship Models

We can now diagram the system (E/R) Provides a standard method of

diagramming systems Close relationship to relational model Allows us to manipulate diagram Can turn diagram into table design

» Standard syntax for querying/modifying RDBs

Page 74: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

SQL(Structured Query Language)

Standard syntax for querying/modifying RDBs

Page 75: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Examples of SQLRetrieval

Select sid, sname from student Select sid, sname from student

where..... Select x.att1,y.att2 from x rell, y rel2

where Select statement

» Select sid, sname, major from student

Page 76: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Update

• UPDATE tablename SET attribute = value

WHERE whereclause

Ex.

UPDATE studenttab SET grade = “A” WHERE sid=“12345” AND class=“B20.3322.30” AND term = “fall2001”

Page 77: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

DELETE

• DELETE FROM classes WHERE status=“cancelled”

Page 78: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

INSERT

• INSERT INTO students (lastname, firstname, major, class) VALUES (“White”, “Norman”, “IS”, “B20.3322.30”);

Page 79: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Other Operations

• Create Table

• Drop Table

• Index Table

• Alter Table

• …

Page 80: N Tier Client/Server Concepts Norman White Stern School of Business Csntier.ppt

Power of RDBMS and CS

• SQL has standard syntax (almost)• Same Queries will work on multiple data bases• All RDBMS’s support Client Server access• Application development can be done with little

knowledge of actual database system• Can scale database performance independently of

application since different applications may run on different servers