• Non ci sono risultati.

DBG Client/Server architectures

N/A
N/A
Protected

Academic year: 2021

Condividi "DBG Client/Server architectures"

Copied!
28
0
0

Testo completo

(1)

Databases

Client/Server architectures

(2)

Centralized architecture

An architecture is centralized when data and applications (programs) reside in a single processing node

The intelligence is in the central elaborator (host or mainframe)

processing applications

Centralized user

terminals

(3)

Distributed architecture

An architecture is distributed when at least one of these two conditions is verified

Distributed processing: applications,

cooperating among themselves, reside on more than one processing node

Distributed database: Data are hosted on more than one processing node

(4)

Distributed architecture

processing

applications

local DBs user

terminals

processing node

applications processing

node

applications

(5)

Distributed architecture

It is a set of processing nodes linked in a determined way

LAN: Local Area Network WAN: Wide Area Network

Each node is able to communicate with some other nodes

Programs in execution on each node are able to share their information and to ask for the

execution of other programs by other nodes

(6)

Distributed architecture

Different complexity levels

It depends on independence level of nodes

Benefits

Improved performances Greater availability

Improved reliability

(7)

Important properties

Portability

Capacity to move an application from a system to another one

Guaranteed by SQL standard

Interoperability

Different DBMSs are able to cooperate in the execution of a given work

Interaction protocols are needed ODBC

X-Open-DTP

(8)

Distributed architecture

Applications are characterized by the role they perform in the system

Client: when the application uses services that are made available by other applications

Server: when the application provides services used by other applications

Actor: when the application assume both roles of the client and of the server, in different contexts

(9)

The client-server paradigm

Client: service user

Server: service supplier

Client and server have no meaning without a communication protocol that

Defines possible interactions between client and server

Specifies details of each interaction

Defines error conditions and related actions to perform

(10)

Protocols example

Service Client Protocol

World Wide Web

Mozilla Firefox, Internet Explorer,

Google Chrome, Opera, …

Hypertext Transfer Protocol (HTTP)

File transfer UNIX FTP, MS FTP, Filezilla, browser

Web

File Transfer Protocol (FTP) Electronic mail Eudora, Outlook,

Thunderbird

Simple Mail Transfer Protocol

(SMTP)

(11)

Client-server architecture

Particular case of a distributed system

The easiest and most diffused architecture

A client sends a request to a server for the execution of a task

A task may consist simply on requesting

information, or on executing complex elaborations

The server can be the client of another service at

the same time

(12)

Client-server architecture

2-levels architecture (2-Tier)

Thick client

Contains application logic DBMS server

Permits data access

DB CLIENT1

CLIENTn DBMS

SERVER

(13)

Client-server architecture

3-levels architecture (3-Tier)

Thin client

the browser

Application server

It implements application logic It is usually a web server

DBMS Server

Permits data access SERVERDBMS

DB CLIENT1

CLIENTn APPLICATION

SERVER

(14)

SQL execution

Compile & Go

Query is sent to the server Query is compiled

Generation of the execution plane Query is executed

Result is returned

Strong for the execution of not repeated queries

Flexible, good for dynamic SQL execution

(15)

SQL execution

Compile & Store

Query is sent to the server Query is compiled

Generation of the execution plane

The execution plane is stored for a future use Query is executed

Result is returned

Efficient for repeated queries

Parametric executions of the same query

(16)

C/S architecture: the World Wide Web

The World Wide Web is a graph of documents The server keeps a local set of documents and sends one of them to the client (browser Web) on demand

text, picture, video, ...

Some types of script ask the server for executing

a program (e.g. PHP script)

(17)

The World Wide Web

Internet Client

Web &

authentication server(s)

Transaction

server(s) Database Server(s) ISP

ISP

(18)

Databases

Web applications

(19)

Web application workflow

User Client-side

interface (browser)

Server-side

elaboration Data

source User defines a

query using the query interface

1

(20)

Web application workflow

User Client-side

interface (browser)

Server-side

elaboration Data

source User defines a

query using the query interface

Query is sent to the agent on

server-side

1 2

(21)

Web application workflow

User Client-side

interface (browser)

Server-side

elaboration Data

source User defines a

query using the query interface

Query is sent to the agent on

server-side

Agent responds to the query using the data

source

1 2 3

(22)

Web application workflow

User Client-side

interface (browser)

Server-side

elaboration Data

source User defines a

query using the query interface

Query is sent to the agent on

server-side

Agent responds to the query using the data

source

Data source returns the result of the

query

1 2 3

4

(23)

Web application workflow

User Client-side

interface (browser)

Server-side

elaboration Data

source User defines a

query using the query interface

Query is sent to the agent on

server-side

Agent responds to the query using the data

source

Data source returns the result of the

query Agent on server-side

returns the result of the query

1 2 3

4 5

(24)

Web application workflow

User Client-side

interface (browser)

Server-side

elaboration Data

source User defines a

query using the query interface

Query is sent to the agent on

server-side

Agent responds to the query using the data

source

Data source returns the result of the

query Agent on server-side

returns the result of the query Result of the query

is shown to the user

1 2 3

4 5

6

(25)

Web application workflow

Web applications perform more or less the same tasks:

Provide an interface for asking informations (query interface);

e.g.: search in a database, file request, purchase a book, booking a flight, … Transmit user data to the Web server

Process data on server-side, accessing a database if necessary

Transmit query results to the client

(26)

Static transaction

Client

serverWeb Internet

URL http request

HTMLfiles

http response display

page

TCP/IP

path

browser server file system

HTML send

(27)

Dynamic transaction

Client

Web server Internet

URL http request

& POST data http response display

page

com- mand

HTML send

Application

para- meters

logic

(28)

Transaction on a database

Client

Web server Internet

URL http

& POST display http

page

com- mand

HTML send

Application

para- meters

data Database

query

Riferimenti

Documenti correlati

I programmi in esecuzione su ciascun nodo sono in grado di condividere le proprie informazioni e di richiedere l’esecuzione di altri programmi da parte di altri nodi.

L’architettura più semplice e più diffusa L architettura più semplice e più diffusa Un client invia una richiesta ad un server per l’esecuzione di un compito (task). Un task

Cliente (Client): quando l’applicazione utilizza dei servizi messi a disposizione da altre applicazioni Servente (Server): quando l’applicazione fornisce servizi usati da

Le transazioni read-only non possono modificare n´ e il contenuto n´ e lo schema della base di dati e vengono gestite coi soli lock condivisi (read lock)...

z Il client è un qualsiasi programma che invia una richiesta e aspetta una risposta; tipicamente termina dopo avere usato un server un numero finito di volte. z Il server aspetta

n “Thin” client containing only the Presentation Logic subsystem (session, text input, dialog, and display management services). n

  $name è il nome della variabile associata al cookie e può essere usata anche per specificare un elemento di array.   $value è il valore associato e viene inviato in

Infatti, a questo punto, si può scegliere l'ultima opzione per la configurazione automatica, quella centrale per quella manuale (in tal caso bisogna selezionare View per una