GoConqr has a new look! Let us know what you think.

Notes

6. Database are Everywhere!

Berenice A•L Bases de Datos Spanish 2 pages

Content of the notes (2)

Page 1

6. Database are Everywhere!

Databases on the web

In a web-based system, the communications protocol used is HyperText Transfer Protocol (HTTP). When a user request (HTTP request) is sent the software answers the request and returns a corresponding web page (HTTP response).

System can be configuren in three layers and is referred to as threetier client/server system:

Presentation layer receives user input, such as search conditions, that needs to be passed on to the database. Processes query resuilts received from the database so that they can be displayed.

Logic layer performs data processing. Is where SQL statements are composed

Data layer processes data on a database server. Search results are returned from the database in response to SQL.

Using stored procedures

Storing procedures on the database server helps reduce the load on the network, because it eliminates the need for frequent transfers of SQL queries. Storing procedures also makes it easer to develop applications, since standard processes can be encapsulated into easy-to-use procedures.

Types of stored programs:

Stored procedure: program that does not return values from the processing procedure.

Stored function: program that returns values from the processing procedure

Trigger program that is launched automatically before and after the database operations.

What is a distributed database?

In a web-based system processing is distributed among a database server a web server and a webbrowser with different tasks assigned to each. This type of distributed system allows for flexible processing and decreases the processing capacity required by each server.

Horizontal distribuion: uses several peer database servers. this structure is use for a system of extended databases that operate separately. Is failure-resitant system by design since failure on one server will notaffect database operation.

Vertical distribution: assigns different functions to different database servers. One of the servers functions as the main server and performs a key role while the others are in charge of processing tasks as requested. It makes it easier to mainage the main database server though this main server sill have a heavy load.

Page 2

Partitioning data

Horizontal partitioning: divides data into units of rows. Rows resulting from the split are distributed across servers. This is often used when data can be ordened into groups in such a way that related data.

Vertical partitioning: divides data into units of columns. Columns resulting from the split are distributed across servers.

Preventing inconsistencies with a two-phase commit

Databases on different servers in a distributed database system can be configured to act as a single database. Two-phase commit creates one commit operation fom both the first and the second commit operations.

In the first phase, the coordinator asks the participant if a commit operation is possible. In the second phase, the coordinator gives the instructions for a commit and all participants perform a commit accordingly. If any one node fails to secure the operation in the two-phase commit all participants receive a rollback directive. This is how databases on all servers remain cosistent with each other.

Database replication

Replication: some distriuted databases have a duplicated or replica database that reduces the load on the network. The primaty database is referred to as the master database and the copy is called the replica.

Read-only replica is created an downloaded from the master database on the main server. To change data, users must connect to the main server.

Replication enabled for all servers: the same master database is shared by all servers. Updates to any of the servers are reflected in all other servers.

Further application of databases

Extensible Markup Language (XML): represents data by enclosing it tags. Its strictly structured grammar makes programmed processes easy.

Object-oriented databases: uses objects (sets of data and instructions on how that data shoukd be used). Each object is represented with an identifier.

Information

Description
Bases de Datos Note on 6. Database are Everywhere!, created by Berenice A•L on 18/02/2020.
Created by
Berenice A•L · Feb 2020
Updated
Feb 18, 2020
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?