PHP learning is still continuing, but I met some friends in some large PHP exchange forums who were not clear about the most basic database concepts, so I came up with the idea of writing this article!
(1) Concepts
A database is a collection of information. Each collection contains one or more records in a unified form, and the records are composed of fields. The collection is usually called a table, and the records are called rows in the table.
Databases are generally It is divided into: flat file database (TEXT), hierarchical database, network database, relational database (mysql), object and object-relational database!
(2) Relational database is the liberation of programmers to develop software
Since the flat file database must communicate directly with the operating system, when the application needs to edit this information, it must ensure that the fields have the correct form. This form of interface is expensive because she requires a The third generation language (3GL) requires highly skilled personnel for long-term development! For example, programmers must consider the logical and physical representation of data. For example, to read an integer from a file, the programmer needs to know how it is written Text form or binary form. When data flows between files and applications, certain conventions must be followed. Therefore, the efficiency of flat file database programs generally depends on the hard work and level of programmers! Compared with MYSQL, data independence is achieved, and structure independence is also achieved! Therefore, programmers do not need to bear the burden of data management! Put aside Many internal details of database processing! This is the most important reason for the emergence of RDBMS! It is also the reason for its popularity!
(3) Excellent program - object-relational database model
In the database model , MYSQL is a relational database, but the relational model is not a patent of MYSQL. The innovation of database theory is continuing. Some basic principles of advanced technology can also be used in the relational model. If you are a programmer proficient in 3GL, use flat files. The database can not only develop excellent programs! It also has great advantages in basic data processing, programming control, and resource utilization! If you need to frequently read and write a large amount of data, you can use the positioning pointer to read the specified data , fixed-length index, the so-called load problem is easily solved, and the control is also very flexible and convenient. Security issues, hierarchical and network model concurrency models can all be used! Of course, the most important thing is the programmer's sensitivity and perfect design. The index table is very important!
The advantage of MYSQL mainly lies in its physical storage: MYLSAM table supports 3 row modes and fixed-length row ideas, which is flexible for data processing, and uses file descriptors to read and write tables , the buffering and caching of system memory are all the reasons for MYSQL's fast data processing capabilities! At the same time, you can use the convenience brought by physical storage to repair, defragment, etc. the data!
I believe that as long as you have excellent Database model, no matter what type of database you use, the program you develop must be an excellent program!