First look at the architecture diagram of the disk structure
1). System Tablespace
2). File-Per-Table Tablespaces
If the innodb_file_per_table switch is turned on , a file-per-table tablespace contains the data and indexes for a single InnoDB table and is stored in a single data file on the file system.
Switch parameter: innodb_file_per_table , this parameter is enabled by default.
3). General Tablespaces
General table space, you need to create a general table space through the CREATE TABLESPACE syntax, you can specify the table space when creating a table.
Create tablespace:
CREATE TABLESPACE ts_name ADD DATAFILE 'file_name' ENGINE = engine_name;
Specify empty table when creating table:
CREATE TABLE xxx ... TABLESPACE ts_name;
4). Undo Tablespaces
To undo tablespaces, the MySQL instance will automatically create two default undo tablespaces (initial size 16M ) during initialization to store undo log logs.
5). Temporary Tablespaces
InnoDB uses session temporary tablespaces and global temporary tablespaces. Store data such as temporary tables created by users.
6). Doublewrite Buffer Files
Double-write buffer. Before the innoDB engine flushes the data pages from the Buffer Pool to the disk, it first writes the data pages into the double-write buffer file, which is convenient for recovering data when the system is abnormal.