Databases and the Web - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Databases and the Web

Description:

In a File-Server client architecture each client must run a copy of the DBMS ... input type='submit' name='submit' value='click' /input /form /body /html ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 19
Provided by: osirisSun
Category:

less

Transcript and Presenter's Notes

Title: Databases and the Web


1
Databases and the Web
2
Client-Server Architecture
  • In a File-Server client architecture each client
    must run a copy of the DBMS
  • A better solution is to have a central database
    server which performs all database commands sent
    to it from client PCs.
  • Application programs on each client PC can then
    concentrate on user interface functions.
  • Database recovery, security and concurrency
    control is managed centrally on the server.

3
Client-Server Architecture
  • DATABASE SERVER
  • The SERVER portion of the client/server database
    system provides processing and shared access
    functions.

4
Client-Server Architecture
  • CLIENT
  • Manages the user interface (controls the PC
    screen, interprets data sent to it by the server
    and displays the results of database queries)
  • The client forms queries in a specified language
    (usually SQL) to retrieve data from the database.
    This query process is usually transparent to the
    user.

5
Client-Server Architecture
  • ADVANTAGES
  • Allows companies to harness the benefits of
    microcomputer technology such as low cost.
  • Processing can be performed close to the source
    of the data - more speed.
  • Allows the use of GUI interfaces that are
    commonly available on PCs and workstations.
  • Paves the way for truly open systems.

6
Client-Server Architecture
  • DESIGN ISSUES 1
  • The server must be upgradeable to allow for the
    growth in clients.
  • The server must have capabilities for backup,
    recovery, security and UPS.

7
Client-Server Architecture
  • DESIGN ISSUES 2
  • Can be complex and so requires specialised and
    expensive tools such as database servers and
    APIs.
  • A lack of comprehensive standards.

8
Traditional Client-Server Architecture
  • Traditional Database Systems are based on a
    two-tier client-server architecture
  • Fat clients
  • User interface
  • Main business and data processing logic

Client
Database Server
  • Server-side validation
  • Database access

9
Web Architecture
  • Need for enterprise scalability causes problems
    which can be solved by a three-tier architecture
  • Thin clients
  • User interface

Client
Application Server
  • Business logic
  • Data processing logic
  • Server-side validation
  • Database access

Database Server
10
Web as a Database Platform
  • Advantages
  • DBMS advantages, e.g. transaction control,
    concurrency control, security, integrity
  • HTML easy to use, standardised, cross-platform
    support
  • Graphical User Interface simplify and improve
    access to database
  • Transparent network access URLs
  • Scalable deployment no need to update clients
  • Innovation globally accessible

11
Web Database Approaches
  • Traditional web pages are normally static
  • To run queries, we need to be able to produce
    dynamic HTML pages
  • Approaches include
  • CGI - Common Gateway Interface (with PERL etc)
  • JavaScript - code which runs on client machine
  • PHP - Server side processing
  • Active Server Pages - MS variation of PHP

12
Simple Page Request
13
PHP Request
14
PHP/Oracle Request
15
Example PHP code
  • ltHTMLgt
  • ltHEADgtltTITLEgtPHP Exercise 1lt/TITLEgt
  • lt/HEADgt
  • ltBODYgt
  • lt?php
  • echo "Hello php world"
  • ?gt
  • lt/BODYgt
  • lt/HTMLgt

16
Example HTML code
  • lthtmlgt
  • ltHEADgtltTitlegtPHP Exercise 2lt/titlegt
  • lt/headgt
  • ltbodygt
  • lth2gtltcentergtEnter the details belowlt/centergtlt/h2gt
  • ltbrgt
  • ltform method"post" action"phpex3.php"gt
  • Enter your Userid
  • ltinput type"text" name"usid"gtlt/inputgtltbrgt
  • Enter your password
  • ltinput type"password" name"passw"gtlt/inputgtltbrgt
  • ltinput type"submit" name"submit"
    value"click"gtlt/inputgt
  • lt/formgt
  • lt/bodygt
  • lt/htmlgt

17
Example PHP code
  • lthtmlgt
  • ltheadgtlttitlegtPHP Exercise 3lt/titlegt
  • lt/headgt
  • ltbodygt
  • lt?php
  • Check that input has been made in userid field
  • testin1 substr(usid,0,1)
  • testin2 substr(passw,0,1)
  • if (testin1 "")
  • print "lthrgtlth1gtNo Name Entered -- Go Back To
    Previous Pagelt/h1gtlthrgt"
  • elseif (testin2 "")
  • print "lthrgtlth1gtNo Password Entered -- Go Back To
    Previous Pagelt/h1gtlthrgt"
  • else
  • echo "Welcome usid to the world of PHPltbrgt"
  • ?gt
  • lta href"phpex2.html"gtReturnlt/agt

18
Useful Sources
  • Client-Server
  • Connolly Begg, 3rd and 4th edition, chapter 2
  • Databases and the web
  • http//www.php.net
  • Connolly Begg, 3rd edition, chapter 28
  • Connolly Begg, 4th edition, chapter 29
  • Next week
  • Revision
Write a Comment
User Comments (0)
About PowerShow.com