Optimistic and pessimistic locks on the "go" database

Source: Internet
Author: User

  Sometimes in order to get the maximum performance, the general database has the concurrency mechanism, but the problem is the data access conflict. To solve this problem, most databases use the data locking method. Therefore, pessimistic lock and optimistic lock is mainly used to ensure data security, processing multi-user concurrency.

Optimistic Lock: It is a pessimistic attitude to the data conflict, that is to say that the data will certainly conflict, so when the data began to read the data locked.

Pessimistic lock: think that the data generally does not cause conflict, so when the data is submitted to update the time, the data will be formally conflicting or not detected, if a conflict is found, let the user return the wrong information, let the user decide how to do.

Pessimistic locks can result in long access to the database and poor concurrency, especially for long transactions.

Optimistic locking in the reality of the use of more, manufacturers more use.

Optimistic and pessimistic locks on the "go" database

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.