MySQL Storage engine

Source: Internet
Author: User

Storage Engine: Different storage engines can bring different functions and performance to the database.

View which storage engines are supported by the current database software
Mysql> show engines;

In MySQL 5.5 and later versions, the default storage engine is InnoDB, and before 5.5, the default is MyISAM engine

  1. MyISAM engine
    The MyISAM storage engine focuses on speed, but does not support transactions, does not support foreign keys, and so on.
    Directory structure of the MyISAM storage engine

    . frm: The table structure is stored
    . MYD: Data stored in a table
    . MYI: The index of the table is stored

  2. InnoDB Storage Engine: Supports transactions, supports row-level locks, supports foreign keys

    The storage engine will only hold the structure of the table in the database directory
    Table data is stored in the Ibdata1 file in the/data/mysql directory

    5.6 The inside index exists also in the database directory (. ibd)

    InnoDB support transactions: DML operations (INSERT, UPDATE, DELETE)
    Transactions meet four features: ACID
    1, a--atomicity Atomic nature
    A transaction is a whole, and all operations within it are either done or not, and cannot be split.
    2, C--consistency consistency
    The integrity constraints of the database are consistent before and after the transaction begins
    3, i--isolation isolation, Independence
    Two transactions are mutually irrelevant.
    4. D--durability Persistence
    After the transaction is complete, all changes to the database are persisted in the database and will not be rolled back.

    Normally: A transaction can be rolled back and committed.

    Flag for end of transaction:
    1, the explicit implementation of commit commits, indicating confirmation of changes
    2, explicitly perform rollback rollback, means to cancel all changes
    3, encountered DDL statement, automatic submission (Create, ALTER, DROP, truncate)
    4, normal exit, automatic submission
    5, abnormal exit, automatic rollback

  3. Memory storage Engine: Data is stored in RAM, and after the service is restarted, data is lost and is typically used for temporary tables.

MySQL Storage engine

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.