PREDICTION MODELS FOR CONCURRENCY CONTROL TYPES
Examples disclosed herein relate to prediction models concurrency control types. Some of the examples enable generating a prediction model based on training data. The training data may comprise a set of access data associated with a data object. The set of access data may comprise: values for a set of attributes of the data object, and an indication whether a conflict occurred during processing of a request to access the data object.
1 . A method for generating prediction models for concurrency control types, the method comprising:
identifying a first set of access data associated with a first data object, the first set of access data comprising: values for a first set of attributes of the first data object, and an indication of whether a conflict occurred during processing of a request to access the first data object
identifying a second set of access data associated with a second data object, the second set of access data comprising: values for a second set of attributes of the second data object, and an indication of whether a conflict occurred during processing of a request to access the second data object: and
generating, using a machine-learning algorithm, a prediction model based on training data that includes the first and second sets of access data.
2 . The method of claim 1 , further comprising:
determining, using the prediction model, an indication of whether a conflict is predicted to occur during processing of a request to access a third data object: and
determining, based on the determined indication, a concurrency control type to be used to process the request to access the third data object.
3 . The method of claim 2 , wherein determining, using the prediction model, the indication of whether the conflict is predicted to occur further comprises:
identifying values for a third set of attributes of the third data object; and
determining, using the prediction model, the indication of whether the conflict is predicted to occur based on the values for the third set of attributes.
4 . The method of claim 2 , further comprising:
processing the request to access the third data object using the concurrency control type;
identifying an indication of whether a conflict occurred during processing of the request to access the third data object, and
updating the prediction model based on the training data that includes a third set of access data associated with the third data object, the third set access data comprising: values for the third set of attributes of the third data object, and the indication of whether the conflict occurred during processing of the request to access the third data object.
5 . The method of claim 2 , wherein the concurrency control type comprises a pessimistic concurrency control type or an optimistic concurrency control type
6 . The method of claim 2 , wherein the indication of whether the conflict is predicted to occur during processing of the request to access the third data object comprises a first indication that no conflict is predicted to occur, a second indication that the conflict is predicted to occur due to a locking of the third data object, or a third indication that the conflict is predicted to occur due to a rejection of an update to the d data object,
7 . The method of claim 6 , further comprising;
in response to the first indication, processing the request to access the third data object using an optimistic concurrency control type; and
in response to the second or third indication, processing the request to access the third data object using a pessimistic concurrency control type.
8 . A non-transitory machine-readable storage medium comprising instructions executable by a processor of a computing device for generating prediction models for concurrency control types, the machine-readable storage medium comprising:
instructions to identify a predict n model that is generated based on training data comprising: i) values for a first set of attributes of the first data object, and (ii) an indication of whether a conflict occurred during processing of a request to access the first data object;
instructions to determine, using the prediction model, a probability of a occurring during processing of a request to access a second data object; and
instructions to determine, based on the probability of the conflict for the second data object, a concurrency control type to be used to process the request to access the second data object
9 . The non-transit machine-readable storage medium of claim 8 , further comprising:
instructions to process the request access the second data object using the concurrency control type;
instructions to identify an indication of whether a conflict occurred during processing of the request to access the second data object; and
instructions to include a second set of access data associated with the second data object in the training data, the second set of access data comprising: values for a second set of attributes of the second data object, and the indication of whether the conflict occurred during processing of the request to access the second data object.
10 . The non-transitory machine-readable storage medium of claim 8 , wherein the second data object includes values of a second set of attributes of the second data object, further comprising:
instructions to use the values of the second set of attributes to determine the probability of the conflict occurring during processing of the request to access the second data object.
11 . The non-transitory machine-readable storage medium of claim 8 , further comprising:
instructions to determine, using the prediction model, a probability of a conflict occurring during processing of a request to access a third data object; and
instructions to determine, based on the probability of the conflict for the third data object, a concurrency control type to be used to process the request to access the third data object.
12 . A system for generating prediction models for concurrency control types comprising:
a processor that:
identifies a first set of access data associated with a first data object, the first set of access data comprising: values for a first set of attributes of the first data object, and an indication of whether a conflict occurred during processing of a request to access the first data object;
generates, using a machine-learning algorithm, a prediction model based on training data that includes the first set of access data;
identifies a second data object;
determines, using the prediction model, an indication of whether a conflict is predicted to occur during processing of a request to access the second data object; and
determines, based on the determined indication, the concurrency control type to be used to process the request to access the second data object.
13 . The system of claim 12 , herein the first set of access data comprises a concurrency control type that was used to process the request to access the first data object.
14 . The system of claim 12 , the processor that:
identifies a third data object for which a concurrency control type is determined using the prediction model;
determines, using the prediction model, an indication of whether a conflict is predicted to occur during processing of a request to access the third data object; and
determines, based on the determined indication, the concurrency control type to be used to process the request to access the third data object.
15 . The system of claim 14 , wherein the determination of the concurrency control type for the second data object and the determination of the concurrency control type for the third data object occur within a designated time period prior to processing of the request to access the second and third data objects.