Home >Common Problem >What is a database instance?
A database instance is a program, a layer of data management software located between the user and the operating system, and a channel for accessing the database; the user can perform any operation on the data in the database, including data definition, data query, Data maintenance, database operation control, etc. are all performed under the database instance. Applications can only deal with the database through the database instance.
The operating system of this tutorial: Windows 10 system, mysql version 8.0, Dell G3 computer.
1. Database (Database)
A collection of physical operating system files or disk data blocks
such as data files, index files, and structure files.
Not all database systems are file-based, and there are also forms that directly write data to data storage.
2. Database Instance
Instance refers to a series of processes in the operating system and the memory blocks allocated for these processes.
A database instance is a program, a layer of data management software located between the user and the operating system.
The database instance is the channel for accessing the database. Any operations performed by users on the data in the database, including data definition, data query, data maintenance, database operation control, etc., are all performed under the database instance. Applications can only deal with the database through the database instance.
Generally speaking, one database instance corresponds to one database.
The database is used to store data for a long time, and we all know that memory can only temporarily store data, and disks can truly store data.
The database Where will it be placed? It must be stored on the disk. In fact, the database is a file on the disk.
From the above we draw the conclusion: database == file on disk.
Since the database can be regarded as a file on disk, how do we use the database?
If We can use the database directly, which is equivalent to directly using the files on the disk.
We know this common sense: the files on the disk must be read into the memory before they can be used. This is the same as what we knew before It goes against a common sense.
Then the correct process should be like this? Read the file on the disk into the memory first, and then use it.
By the way, this is the use The correct process of the database.
How does the database read into the memory?
At this time, it is the instance we want to introduce. The instance is the memory structure and a set of background processes.
In fact, the normal process of reading a database into memory is that a group of background processes in the instance reads the data file from the disk into the memory of the instance, and then operates on the data in the memory and then reads it from the instance. The memory is written to the database through a set of background processes.
Compared to the database, the instance should be the running environment of the database (it may not be accurate but it is also very appropriate).
The above is the detailed content of What is a database instance?. For more information, please follow other related articles on the PHP Chinese website!