introconcepts2

Download Report

Transcript introconcepts2

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
But First, Some Background
• Computer Fundamentals (hardware,
software)
• Data Communications
• Networking …
Hardware Components
Primary Hardware Components
• Processor
• Primary Storage (RAM)
• Secondary Storage
– Disk, tape etc.
• Data Channel(s)
• I/O Controllers
• Other Peripheral devices
Components
registers
Processor
R
Memory (RAM)
Data Channel
video
controller
disk
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
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
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.
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
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
Secondary Storage
• Peripheral devices that can hold information
for later retrieval
• Disk, Tape, CDROM, diskettes
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
DATA COMMUNICATIONS
Some Basics
Communication Components
telephone
cable
satellite
• SOURCE
• SINK
• MEDIUM
SOURCE
MEDIUM
SINK
Communications Media
•
•
•
•
•
•
•
Telephone
Satellite
Cellular
Cable
Fiber Optic
Infrared
etc.
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
Modems
modulator/demodulator
• Converts Digital signal to analog so it can
be sent over phone lines
• Reconverts analog to digital
on other end
1
1
1
0
0
01110000
0
0
0
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
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
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
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
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
TCP/IP
Protocol of the Internet
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
TCP
Transmission 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
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
IP - Internet Protocol
•
•
•
•
Handle datagrams
Defines Internet addressing scheme
Routes datagrams to remote hosts
Performs fragmentation and reassembly of
datagrams
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
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.
Gateways
• Gateways (also called IP routers) are the
computers used to connect your network to
the internet
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)
Standard TCP/IP Services
•
•
•
•
•
•
•
•
telnet - 23
rlogin
ftp - 21
NFS - Network File Service - 2049
Talk - 517
Ping Finger - 79
Sendmail - 25
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
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
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
Physical Networks
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
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
Packet Switched Network
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.
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
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
CS Concepts
• Server responds with a message in the
“standard” format
• Client receives message and processes it
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
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.
Client Server
User
Web Browser
Web
Server
Data Base Server
Issues in Client/Server
•
•
•
•
•
Fast developing standards
Isolates users from mainframe architecture
Enables application specific machines
Heterogeneous software and hardware
Subtle performance issues
Advantages
•
•
•
•
•
Application code is “closer” to the user
Application/server independence
Portability
Scalability
Performance ?
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
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
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
N Tier CS
User
Web Browser
Application
Server
Web Server
Data Base Server
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
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.
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
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
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
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.
Database Mgt Systems
An Overview
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

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
Advantages
Central mgt. of data
 Standardized data names

» less confusion
» eases coding
Data redundancy reduced
 Programs independent of data
structures

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)

Disadvantages
More training required
 Technical staff more expensive
 More complex environment
 $$$ Software costs
 Performance problems

Types of DBMS systems
Hierarchical
 Network
 Relational
 Object-oriented

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
Relational Concepts...

B. Relational Operators
– Union
– Difference
– Intersection
– Product
– Projection (new table)
– Selection (query)
– Join
Relational Concepts...

C. Normalization
» Functional dependencies
– Relationship between or among attributes
– Keys (group of attributes)
» Eliminate update anomalies
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
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
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
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
SQL(Structured Query
Language)

Standard syntax for querying/modifying
RDBs
Examples of SQL
Retrieval
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
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”
DELETE
• DELETE FROM classes WHERE
status=“cancelled”
INSERT
• INSERT INTO students (lastname,
firstname, major, class) VALUES (“White”,
“Norman”, “IS”, “B20.3322.30”);
Other Operations
•
•
•
•
•
Create Table
Drop Table
Index Table
Alter Table
…
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