BICS546 Client/Server Database Application Development.

Post on 19-Dec-2015

220 views 1 download

transcript

BICS546Client/Server Database

Application Development

Evolution of Multi-User DBMS Architectures

• Teleprocessing: – One computer with a single CPU and a number of

dumb terminals.

• File-Server: – Applications run on workstations that contain a full

copy of the DBMS. File-server acts as a shared hard disk drive. The DBMS on each workstation sends requests to the file-server for data.

• Client-Server:

Client-Server

• Client/server is primarily a relationship between processes running on separate (or same) machines.

• Client: A process which requires some resources or services.

• Server: A process which provides the requested resources or services.

The Three Layers of Client/Server Systems

• Computer Network– Network and network operating system provide the platform that

runs the system.

• Client/Server Technology– Component and distributed object technology, such as COBRA

Common Object Request Broker Architecture, COM Component Object Model, DCOM, etc., provide the foundation to develop the system. Database access middleware such as ODBC Open Database Connectivity, provides easy connection to database server.

• Client/Server applications– Database applications, web applications, other applications.

Database Application

• An organized set of menus, forms, reports, business rules, and the database it operates on.

• An example:– C:\Program Files\Microsoft Office\Office\Sam

ples\Northwind.mdb

Three components in a database application

• Presentation – user interface– Menus, forms, reports, etc

• Processing logic – Business rules

• Database

Categories of Database Applications

• One-Tier– Legacy online transaction processing– PC database application

• Two-Tier client/server– Client-based presentation.– Processing logic is buried either inside the user interface

on the client or within the database on the server, or both.

• Three-Tier, N- tier– Processing logic is separated from the interface and

database.

Two-Tier

• Simplicity• Provides a basic separation of tasks. The

client is primarily responsible for the presentation of data to user, and the server is primarily responsible for supplying data services to the client.

• Fat client• Fat server

Fat Client

• More functions are placed on the client– Presentation and processing are placed on the

client– Traditional database/file server applications– Decision support and personal software (end-

user support)

Fat Server

• More functions are placed on the server.– Processing logic is placed on the server– Mission-critical transaction systems, and web

server are examples

Scalability

• The ability to add or remove clients.

• Two-tier model prevent the scalability:– A fat client requires considerable resources on

the client computer including disk space, RAM, and CPU power.

– A significant client-site administration overhead.

Three-Tier

• 1. User interface, 2. Business logic and data processing layer, 3. Database server.

• Advantage:– Less expensive client hardware.

– Application maintenance is centralized. No software distribution problem.

– Load balancing is easier with the separation of the business logic from the database functions.

– Fit naturally to the web environment.

Partitioned application and Component

• An application designed to run on a distributed system is referred to as a partitioned application.

• A partition application consists of several parts, and each part perform a specific and well-defined task.

• Each part of the partitioned application is referred to as a component

• A component interacts with others via interface: properties, methods, and events supported by the component

Interoperability between Components

• To provide seamless object integration and allow functional components that provide specific services to be created and plugged from one application to another.

Microsoft’s COM, and DCOM

• Component objects: Objects that provide services to other client applications.

• Component Object Model consists of a specification that defines the interface between objects and an implementation packaged as a Dynamic Link Library (DLL).

• DCOM extends COM to distributed environment. It allows components to look the same to clients on a remote computer as on a local computer.

Object Management Group’s ORB

• Object Request Broker is a distributed software bus that enables objects to make and receive requests and response from a provider. On receipt of a response from the provider, the ORB translates the response into a form that the original requester can understand.

Benefits of Building Applications from Components

• Reusability– Many applications can share the services provided by the

same component.

• Manageability– By dividing a program into components, a project can be

divided into smaller, more manageable tasks, and each individual programmers can build components for which their skills are best suited.

• Maintenance– Each component can be maintained as an individual unit.

• Flexibility– Components are not bound to a physical location, and can

be redistributed to other physical location.

Progression of the Internet• Hypertext web

– Publishing static web pages– A two-tier client/server application

• Simple response web – Dynamic web pages– Forms and three-tier CGI Common Gateway Interface

client/server– Stateless, cookies(server data held on the client)– Maintain session with server side scripts, ASP, JSP– Require web server to mediate between objects running on

the client and objects running on the server.

• Object web– Web server and object server– Provides object- to –object interactions between client

object and server object.

The Web as a Database Application Platform

• Three-tier architecture– Browser, web server, database server

• Advantages:– Cross-platform support– Graphical user interface

The Web as a Database Application Platform

• Disadvantages– Reliability: Internet is unreliable and slow.– Security– Cost: hardware and software 20%, marketing

24%, content development 56%.– Potentially enormous peak load.– Performance:

• Interpreted languages: HTML, VBScript, JavaScript

Approaches to Integrating the Web and DBMSs

• Common Gateway Interface (CGI)

• JAVA 2 Platform

• Microsoft Platform

CGI

• The Common Gateway Interface defines how scripts communicate with web servers.

• A CGI script is any script designed to accept and return data that conforms to the CGI specification.

• Processes:– The user calls the CGI script by clicking a link or a

button.– The server ensures the requester has access to the

script, prepares environment variables and launches the script.

– The script executes and reads the environment variables and STDIN and sends the output to STDOUT.

– The server sends the data in STDOUT to the browser.

Advantages and Disadvantages of CGI

• Advantages:– Simplicity and language independence.

• Disadvantages:– Communication between a client and the database

server must always go through the web server.

– Lack of transaction support due to the statelessness of HTTP.

• The database server must perform the same logon and logout for every query submitted by the same user.

Java 2 Platform

• Presentation Tier:– JavaScript, Java applet

• Server site scripting:– Servlets and Java Server Pages

• Business tier:– Enterprise Java Beans (EJB): A standard for building

server-site components in Java.

• Database access:– JDBC– SQLJ: Static embeded SQL in Java.

Portability Java: Write Once Run Anywhere

Java Source Code

Java Byte Code(Intermediate Code)

Java Byte Code

Java Virtual Machine(JVM)

Executable Code

Microsoft Platform

• Presentation Tier:– VBScript, JScript

• Web server and Server site scripting:– Internet Information Server, Active Server Pages

• Business tier:– COM ActiveX components

• Database access:– ODBC: An interface to access relational databases.– OLE DB: An interface to access any data sources

including relational and non-relational databases, email, text and graphics, etc.

– ADO.NET

Microsoft’s .Net

• Language must compliance with Common Language Specification, CLS.

• Compile the language into Microsoft Intermediate Language (MSIL) code.

• The MSIL code is then executed in the Common Language Runtime (CLR), which conceptually is same as the JVM, where it is translated into machine code by a compiler.

Techniques Covered in BICS546

• Prerequisites: Programming, Database, SQL• Visual Basic .NET

– Interface and event-driven programming– Class and component programming

• Database programming– ADO.NET programming model

• Web Techniques:– Client side scripting

• Browser object mode, VbScript, JavaScript, HTML

– Server side scripting: ASP.NET

• XML