MySQL mandatory meeting-mysql management transaction processing

Source: Internet
Author: User

1. MySQL transaction support:

Not all engines Support clear transaction processing management.

 

Advantages

Disadvantages

MyISAM

The access speed is fast and there is no requirement for transaction integrity.

Transactions and Foreign keys are not supported.

InnoDB

Supports acid transactions, row-level locks, and concurrency

The write processing efficiency is lower, and more disk space is occupied to retain data and indexes.

Memory

Memory tables can be accessed very quickly.

Once the server is shut down, data will be lost.

2. Role

Transaction Processing (Transaction Processing) can be used to maintain the integrity of the database. It can ensure that batch MySQL operations are either completely executed or not executed at all.

3. Several terms:

Transaction is a group of SQL statements.

Rollback: cancels a specified SQL statement.

Commit writes unstored SQL statement results to the database table.

The temporary placeholder (Place-holder) set in the savepoint transaction processing, you can release the rollback for it (different from the process of rolling back the entire transaction ).

4. Transaction Model

A. The implicit transactions caller does not need to execute the begin transaction statement to start the transaction. The database engine automatically opens transactions when executing SQL statements. The caller must call commit or rollback.

B. The explicit transaction (explicit transactions) caller needs to callThe begin transaction statement must call commit or rollback to commit or roll back the transaction.

C. Automatic transactions (autocommit transactions) are automatically defaulted by the system. Each separate SQL statement (SQL statemenet) is a separate transaction and is automatically submitted after the statement is executed. The caller does not need to manually control the transaction process.

References:

MySQL required

Http://justsee.iteye.com/blog/1062914 《About the storage engine of MySQL database"

Thomesca (BEI Cai ):Http://blog.csdn.net/thomescai
(Reprinted and retained)

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.