[erlang-questions] Looking for advice on simultaneous data modification

Daniil Churikov ddosia@REDACTED
Wed Jun 24 17:11:43 CEST 2015


Thanks, Benoit! Completely forgot about this wonderful library!

2015-06-19 17:10 GMT+01:00 Benoit Chesneau <bchesneau@REDACTED>:

> maybe locks could work for your case also?
>
> https://github.com/uwiger/locks
>
> - benoît
>
> On Thu 18 Jun 2015 at 11:31 Daniil Churikov <ddosia@REDACTED> wrote:
>
>> Hi Robert. This possible that main-record deletion may be initiated in
>> the same time from different processes,
>> but it is highly unlikely.
>> On a contrary,  dependent-records will be added/modified/deleted in
>> highly concurrent fashion.
>>
>> 2015-06-17 22:26 GMT+01:00 Robert Virding <rvirding@REDACTED>:
>>
>>> How do you mean "All the operations may happen in different processes
>>> simultaneously."? Does it mean that many processes may initiate a record
>>> deletion in parallel or does it mean that there maybe be parallel accesses
>>> to the actual databases?
>>>
>>> Robert
>>>
>>>
>>> On 17 June 2015 at 15:53, Daniil Churikov <ddosia@REDACTED> wrote:
>>>
>>>> Hello dear list. I am looking for advice to, perhaps, very common
>>>> problem.
>>>>
>>>> I have database which does not support transactions, only CAS
>>>> operations for single record.
>>>> I have one-to-many relationship between 2 tables, and I need to
>>>> implement cascade deletion of dependent records from table_2 when main
>>>> record from table_1 was deleted. All the operations may happen in different
>>>> processes simultaneously.
>>>> So my intention is to do some kind of a mutex, which incorporate
>>>> following properties:
>>>> * when main record is in deletion-state, every other action on main
>>>> and/or dependent record should wait until it will be deleted;
>>>> * if main record is in normal-state, all dependencies may be modified
>>>> without any strict order.
>>>>
>>>> Is there any library in the wild which allow me to do this kind of
>>>> mutex?
>>>> Maybe I have chosen wrong approach? Any suggestions?
>>>>
>>>> Thanks!
>>>>
>>>> _______________________________________________
>>>> erlang-questions mailing list
>>>> erlang-questions@REDACTED
>>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>>
>>>>
>>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150624/de7d1118/attachment.htm>


More information about the erlang-questions mailing list