dbms-Basic Concepts

Source: Internet
Author: User
Tags dba odbc

The main drawbacks of the file processing system (File-processing systems):

Data redundancy and inconsistency (redundancy and inconsistency), data access difficulties (difficulty in accessing), data isolation, integrity issues (isolation Problem), atomicity issues (atomicity problem), concurrent access exceptions (concurrent-access anomaly), security issues (safety problem).

Three levels of data abstraction

1) Physical layer (physical level): detailed description of complex underlying data structures

2) Logic layer (logical level): describes what data is stored in the database and the relationships that exist between the data.

Physical Data independence (physical data Independence): Applications do not rely on physical mode, even if the physical schema changes without rewriting the application, the logical layer of the user does not have to know the logical layer structure implementation may involve complex physical layer structure.

3) View level: describes only one part of the database, and the system can provide multiple views of the same database, making it easier for users to interact with the system.

Database schema

instance (instance): A collection of information stored in a database at a particular moment is called an instance of the data.

Database schema: The overall design of the database, even if there is a change, is not frequent.

The database system can be divided into several different modes: e.g. physical mode, logical mode, sub-mode (Subschema, which describes different views of the database).

Data Model: A collection of conceptual tools that describe data, data connections, data semantics, and consistency constraints, providing a way to describe the physical, logical, and view-layer database designs.

The data model can be classified into four categories:

Relational Model: A record-based model that uses a collection of tables to represent the connection between data and data, with multiple columns per table and a unique column name for each column. Relational

Entity-Contact model (entity-relationship model,a.k.a. E-r): based on a perception of the real world-the real world consists of a set of basic objects (entities) and the connections between them. Entities are a thing or an object that can be distinguished from other objects in the real world.

E-R provides a convenient graphical way to observe data, relationships, and constraints.

The entities in the database are described by the set of attributes (attribute);

Contact (relationship) is the association between several entities;

A collection of all entities of the same type is called an entity set, and the collection of all contacts of the same type is called the contact set (relationship set);

Object-based data model: The E-R model can be seen as an extension of concepts such as encapsulation, methods, and object flags. object-based The object-relational data model combines the characteristics of an object-oriented data model and a relational data model.

semi-structured data Model (semistructured): allows data items of the same type to contain data definitions for different sets of properties.

The network data model, the hierarchical data model, is now rarely used in hierarchical.

Database language

The database system provides the data definition language (Data-definition language) and the Data Manipulation language (Data-manipulation language), which forms the different parts of a single database language.

1. Data Manipulation Language (DML): enables users to access or manipulate data that is organized according to an appropriate data model.

Types of access to DML include: Add, delete, check, change.

Query: A statement that requires the retrieval of information, and the part of DML that involves information retrieval is called the query language.

There are usually two basic types of DML:

1) Procedural DML (procedural DML): requires the user to specify what data is required and how to obtain the data.

2) declarative DML (declarative DML): also known as non-procedural DML, requires the user to specify what data is required, without specifying how to obtain the data.

2. Database Definition language (DDL): A series of definitions that express a description of the database schema (which defines the database schema), and can also be used to define other characteristics of the data.

data storage and Definition language: a series of special DDL statements that illustrate the storage structure and access methods used by the database system, and define the implementation details of the database schema.

The data values stored in the database must meet certain consistency constraints (consistency constraint), and the DDL language provides the tools that specify such constraints, which are checked by the database system whenever the database is updated.

· domain constraint: Each property corresponds to a field that consists of all possible values.

· referential integrity (referential integrity): The value on a given set of properties in a relationship also appears in the value of a property set of another relationship.

· Assertion (Assertion): a database needs to satisfy a certain condition at all times. After the assertion is created, the system monitors its validity, and if the assertion is valid, then only database updates that do not break the assertion are allowed later.

· Authorization (Authorization): These differences are expressed by authorization for different users to allow different types of access on different data values in the database. such as: A. Read authorization allows data to be read but not modified; b. Insert authorization allows new data to be inserted, but does not allow modification of existing data; Update authorization allows modification but cannot delete data; Delete permission Authorization) allows data to be deleted.

Data dictionary: The DDL is entered as an instruction (statement), and the generated output is placed in the Data Dictionary (dictionary). The data dictionary contains meta data (metadata). The data dictionary can be regarded as a special kind of table, which can only be accessed and modified by the database system itself, and the data system should refer to the data dictionary before reading and modifying the actual data.

relational database: based on a relational model, a series of tables are used to express the data and the relationships between the data. A record-based model, the structure of a database of several fixed-format records.

Table: Each table contains a record of a specific type, each record type defines a fixed number of fields or properties (multiple columns per table), and the table's columns correspond to the attributes of the record type (each column has a unique name).

Database access from the application

Most calculations and actions must be done in a host language (such as C/c++/java), where an embedded SQL query is used to complete access to the database. The two ways that the host language performs DML access to the database include:

1. Send DML and DDL statements to the database and retrieve the results by providing an application interface (the process set). e.g. C language +odbc, JAVA+JDBC

2. Embed DML calls in the program of the host language by extending the syntax of the host language.

Standardization

A method used to design a database, by designing a pattern that conforms to the appropriate paradigm (normal form), generates a collection of relational patterns that does not unnecessarily redundant when storing information, and can easily retrieve data.

Data storage and querying

The functional parts of a database system can be broadly divided into storage managers and query processing parts.

1) Storage Manager: the part of the database system that provides the interface between the low-level data stored in the database and the application and the queries submitted to the system, which is responsible for storing, retrieving, and updating the data in the database.

Storage Management parts include:

· Permissions and Integrity Manager (authorization and Integrity Manager): detects whether the integrity constraint is met, and checks the permissions of the user who accesses the data in the view.

· transaction manager (transaction manager): ensures that the database remains in a consistent (correct) state even if a failure occurs, and that the execution of concurrent transactions does not conflict.

· FileManager: Manages the allocation of disk storage space and manages the data structure used to represent the information stored on the disk.

· BufferManager: Responsible for taking data from the disk into memory and deciding which data should be buffered in memory.

The storage Manager implements several data structures as part of the physical implementation of the system:

• Data files: Stores the database itself.

• Data dictionary: Stores metadata about the structure of the database, especially the database schema.

• Index: Provides quick access to data items (e.g. Pointer, hash)

2) Query processor

The query processor is responsible for compiling and executing DDL and DML statements, including:

· DDL Interpreter (DDL interpreter): interprets DDL statements and records those definitions in a data dictionary.

· DML compiler (DML compiler): translates DML statements in the query language into execution scenarios, including a series of low-level instructions that the query execution engine can understand.

The DML compiler also performs query optimization, choosing the least cost from several equivalent execution scenarios with the same results.

· Query Evaluation engine: Executes low-level directives produced by the DML compiler.

Transaction management

Transaction (Transaction): A collection of operations that complete a single logical function in a database application. Each transaction is a unit that is both atomic and consistent.

A transaction should be defined so that it does not violate the consistency constraints of the database. A transaction can be defined as being composed of multiple individual programs, and the program executes sequentially to maintain consistency, but the individual program itself does not move the database from a consistent state to a new suppressed state, so these programs are not transactions.

The transaction manager (transaction manager) includes the concurrency Control Manager (Concurrency-control Manager, which controls the interaction of concurrent things, guarantees consistency), and the recovery manager (Recovery manager, failure recovery in case of transaction failure, guaranteed atomicity and durability).

Database architecture

1. Two-tier architecture (Two-tier architecture): the application resides on the client (front end) and invokes the database system functionality (backend) on the server through a query language expression. (Application interface standard E.G.ODBC/JDBC for client and server interaction)

2. Three-tier architecture (Three-tier architecture): The backend is divided into Application server and database server; The client only acts as the front end and does not contain any direct database calls through a form interface to the application server (application Server), the application servers communicate with the database system to access the data, and the business logic of the application is embedded in the application server rather than across multiple clients.

Database Users and Administrators

The person who uses the database can be divided into database users and database administrators

1. Database Users

Database users can be divided into four types, the system for different types of users to design different types of user interface

• Inexperienced users (na?ve user): By activating pre-written applications to interact with the system, a typical user interface is a tabular interface.

• Application Clerk (Application Programmer): Developing the user interface

• Experienced users (sophisticated user): Do not interact with the system by writing programs, but instead use tools such as database query language or data analysis software to express requirements.

• Dedicated users (specialized user): Write specialized, experienced users who are not suitable for database applications in traditional data processing frameworks.

2. Database administrator

The person who centrally controls the system is called the database Administrator,dba, and the role of the DBA includes:

• Schema Definition (schema definitions). Create the initial database schema by writing a series of definitions in DDL.

• Storage structure and access method definitions (storage structure and access-method definition).

• Schema and physical organization modifications (schema and physical-organization modification). The schema and physical organization are modified by the DBA to reflect changes in the organization's requirements, or to select different physical organizations for improved performance.

• Data access authorization (granting of Authorization for data access). DBAs grant different types of permissions to specify which parts of the database each user can access.

• Daily maintenance (routine maintenance), including:

A. Regularly backing up data

B. Spare disk space required to ensure normal operation and upgrade disk space when needed

C. Monitor the operation of the database and ensure that database performance is not degraded by a number of users committing more time-consuming tasks.

dbms-Basic Concepts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.