Database Management System: There is a collection of data associated with each other and a set of programs to access these data, which is called database. Just write a concept, as the main line of this book.
1. The need to appear in the database and the requirements for the database
Although the file system can solve a lot of problems, the following problem is that the file system cannot solve, if these features are added to the file system, the file system has become a database (a bit bare device's taste).
Data redundancy and inconsistencies: repetitive data, and problem that data cannot be synchronized in distribution. Data access is difficult. Data Isolate: Say because the data store does not take the same format, so that the access data that uses a unified interface is not possible. Integrity Problem: It is difficult to achieve data constraints, and the example given in the book is, for example, give a minimum deposit amount to an account. Atomic issues: What is the transaction is handled, how to ensure an operation integrity. For example, bank transfer. Concurrent visit: This is also part of the transaction processing, and the database needs to address the possibility of simultaneously on the same data operation. Safety issues: Mainly database access issues.
Database concept layering
Physical layer: Define the storage format of the data. People who can involve one layer are database software developers. Logical layer: Define the relationship between data and data. People who can involve this layer are designers of the database. View layer: Define the format of the data that eventually presents in front of the customer. The developer of the database client is involved, and the final user.
These three layers are transparent from top to the lower layer. Users don't care about the database structure, database design developers don't care about the storage structure.
2. Data model
Entity ---- Contact Model Relationship Model
These two models look like, in fact, first use entities-contact models to do initial definitions, and then transform into a relational model. The relationship model is currently using the most widely used database model.
3. Database language
The database language is usually composed of two parts, (1) DDL - data definition language. (2) DML - data manipulation language. The most common database language is SQL.
Application architecture
With a database, how efficient and secure access is a problem, which requires developers to make client software. There are two models that develop this software usually follow.
Two-layer mode is the usual database - client mode. The advantage of this model is that it is efficient, and the disadvantages are safety, concurrency, and distributable. Compare the development of small database software. Three-layer mode: It is the database-server-application three-layer mode. A classic example of this mode is the JSP / Servlet - EJB - Database model. The advantage of this model is easy to transplant and maintenance, the client does not have to care about the database of the background, the database does not have to care about the outside of the client, and some are all managed by the intermediate server layer. The disadvantage is that the efficiency is not high. It is not possible to perform more targeted optimization and design for some kind of application.