MySQL performance optimization

Source: Internet
Author: User
Tags database load balancing

concurrency control shared lock exclusive lock table-level row-level lock InnoDB Falcon

transaction: Start Transaction ..... Commit

ACID: atomicity, consistency, isolation, durability

A deadlock is a vicious phenomenon that occurs when two or more transactions occupy each other on a uniform resource and request locking. Deadlocks occur when multiple transactions enter a lock on the same resource in a different order. At any time, multiple errors at the same time lock a resource, must produce a deadlock.

Each transaction executes the first query, updates the rows of data, and locks the data rows in the process. Then each transaction goes into the second row of data, but finds that the row has been locked by the other, and the two transactions begin to wait for each other to finish.

Workaround: The InnoDB storage engine can predict cyclic correlation and immediately return an error.

MySQL provides a three transactional storage engine: InnoDB NDB Cluster Falcon

MySQL default operation mode is Autocommit mode. In a pro-connect, you can set by variable, enable (Enbale) and disable (Disable) SHOW VARIABLES like 'autocommit'

Four isolation levels: READ UNCOMMITTED reads uncommitted content read COMMITTED reads submissions

Repeatable READ Reread SERIALIZABLE serializable

Algorithm for database load balancing:

Random poll minimum connection first fastest response priority hash weight

High availability: Create redundant mechanisms that can be replaced online in the case of a part of the system, which is fast and reliable

Cache: Local cache, local shared-memory cache, distributed memory cache disk cache

Cache control: Time-to-live is explicitly voided when read

  

MySQL performance optimization

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.