Good programmer Java learning advanced MySQL database structure and engine comparison

  MySQL is the most popular relational database management system . Many Java programmers will be frightened by their complicated operations and knowledge structure when they begin to learn MySQL . Next, a good programmer Java training editor will give you a simple analysis of MySQL 's structure and engine Compared.

  MySQL database structure

  1. The top-level service is not unique to MySQL . Most network-based client / server tools or services have a similar architecture.

  2. In the second layer architecture, most of MySQL 's core service functions are at this layer, including query parsing, analysis, optimization, caching, and all built-in functions ( date and time, etc. ) . All cross-storage engine functions are This layer is implemented: stored procedures, triggers, views, etc.

  3. The third layer contains the storage engine. The storage engine is responsible for the storage and extraction of data in MySQL . MySQL supports various storage engines, and each storage engine has its advantages and disadvantages. The server communicates with the storage engine through the API . These API interfaces shield the differences between different storage engines, making these differences transparent to the upper layer query process. The storage engine does not parse SQL (InnoDB is an exception, it will parse foreign key definitions ) , and different storage engines cannot communicate with each other, but simply respond to requests from upper-level servers !

  Implementation process

  The database storage engine is the underlying software component of the database. The database management system uses the data engine to create, query, update, and delete data.

  Different storage engines provide different storage mechanisms, indexing techniques, locking levels, and other functions. Using different storage engines can also obtain specific functions.

  Many database management systems now support multiple different storage engines. The core of MySQL is the storage engine.

spacer.gif 

  MyISAM : It has high insertion and query speed, but it does not support transactions.

  InnoDB : MySQL 's default database after version 5.5 , the preferred engine for transactional databases, supports ACID transactions, and supports row-level locking.

  BDB : derived from Berkeley DB , another option for transactional databases, supporting other transactional features such as COMMIT and ROLLBACK .

  Memory : A storage engine where all data is placed in memory, with extremely high efficiency of inserting, updating and querying. But it will take up memory space proportional to the amount of data. And its content will be lost when Mysql restarts.

  Merge : Combining a certain number of MyISAM tables into a whole, it is very useful in ultra-large-scale data storage.

  Archive : Very suitable for storing large amounts of independent, historical data. Because they are not read often. Archive has an efficient insertion speed, but its support for queries is relatively poor.

  Federated : Combine different Mysql servers to form a complete database logically. Very suitable for distributed applications.

  Cluster / NDB : A highly redundant storage engine that uses multiple data machines to jointly provide services to improve overall performance and security. It is suitable for applications with large data volume and high security and performance requirements.

  CSV : A storage engine that logically separates data by commas. It will create a .CSV file for each data table in the database subdirectory . This is a normal text file, and each data line occupies one text line. The CSV storage engine does not support indexing.

  BlackHole : Black hole engine, any data written will disappear, generally used to record binlog for replication relay

  In addition, MySQL 's storage engine interface is well-defined. Interested developers write their own storage engine by reading the documentation.


Guess you like

Origin blog.51cto.com/14793189/2487557