[openstack-dev] [MagnetoDB] Configuring consistency draft of concept
Illia Khudoshyn
ikhudoshyn at mirantis.com
Mon May 5 08:06:53 UTC 2014
Can't say for others but I'm personally not really happy with Charles &
Dima approach. As Charles pointed out (or hinted) , QUORUM during write may
be equal to both EVENTUAL and STRONG, depending on consistency level chosen
for later read. The same is with QUORUM for read. I'm afraid, this way MDB
will become way too complex, and it would take more effort to predict its
behaviour from user's point of view.
I'd rather prefer it to be as straightforward as possible -- take full
control and responsibility or follow reasonable defaults.
And, please note, we're aiming to multi DC support, soon or late. And for
that we'll need more flexible consistency control, so binary option would
not be enough.
Thanks
On Thu, May 1, 2014 at 12:10 AM, Charles Wang <Charles_Wang at symantec.com>wrote:
> Discussed further with Dima. Our consensus is to have WRITE consistency
> level defined in table schema, and READ consistency control at data item
> level. This should satisfy our use cases for now.
>
> For example, user defined table has Eventual Consistency (Quorum). After
> user writes data using the consistency level defined in table schema, when
> user tries to read data back asking for Strong consistency, MagnetoDB can
> do a READ Eventual Consistency (Quorum) to satisfy user's Strong
> consistency requirement.
>
> Thanks,
>
> Charles
>
> From: Charles Wang <charles_wang at symantec.com>
> Date: Wednesday, April 30, 2014 at 10:19 AM
> To: "OpenStack Development Mailing List (not for usage questions)" <
> openstack-dev at lists.openstack.org>, Illia Khudoshyn <
> ikhudoshyn at mirantis.com>
> Cc: Keith Newstadt <keith_newstadt at symantec.com>
>
> Subject: Re: [openstack-dev] [MagnetoDB] Configuring consistency draft of
> concept
>
> Sorry for being late to the party. Since we follow mostly DynamoDB, it
> makes sense not to deviate too much away from DynamoDB’s consistency mode.
>
> From what I read about DynamoDB, READ consistency is defined to be either
> strong consistency or eventual consistency.
>
> "ConsistentRead <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#DDB-Query-request-ConsistentRead>": "*boolean*”,
>
> *ConsistentRead <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#API_Query_RequestSyntax>*
>
> If set to true, then the operation uses strongly consistent reads; otherwise, eventually consistent reads are used.
>
> Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with *ConsistentRead* set to true, you will receive an error message.
>
> Type: Boolean
>
> Required: No
>
>
> http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
>
> WRITE consistency is not clearly defined anywhere. From what Werner
> Vogel’s description, it seems to indicate writes are replicated across
> availability zones/data centers synchronously. I guess inside data center,
> writes are replicated asynchronously. And the API doesn’t allow user to
> specify WRITE consistency level.
>
> http://www.allthingsdistributed.com/2012/01/amazon-dynamodb.html
>
> Considering the above factors and what Cassandra’s capabilities, I propose
> we use the following model.
>
> READ:
>
> - Strong consistency (synchronously replicate to all, maps to
> Cassandra READ All consistency level)
> - Eventual consistency (quorum read, maps to Cassandra READ Quorum)
> - Weak consistency (not in DynamoDB, maps to Cassandra READ ONE)
>
> WRITE:
>
> - Strong consistency (synchronously replicate to all, maps to
> Cassandra WRITE All consistency level)
> - Eventual consistency (quorum write, maps to Cassandra WRITE Quorum)
> - Weak consistency (not in DynamoDB, maps to Cassandra WRITE ANY)
>
> For conditional writes (conditional putItem/deletItem), only strong and
> eventual consistency should be supported.
>
> Thoughts?
>
> Thanks,
>
> Charles
>
> From: Dmitriy Ukhlov <dukhlov at mirantis.com>
> Reply-To: "OpenStack Development Mailing List (not for usage questions)" <
> openstack-dev at lists.openstack.org>
> Date: Tuesday, April 29, 2014 at 10:43 AM
> To: Illia Khudoshyn <ikhudoshyn at mirantis.com>
> Cc: "OpenStack Development Mailing List (not for usage questions)" <
> openstack-dev at lists.openstack.org>
> Subject: Re: [openstack-dev] [MagnetoDB] Configuring consistency draft of
> concept
>
> Hi Illia,
> WEAK/QUORUM instead of true/false it is ok for me.
>
> But we have also STRONG.
>
> What does STRONG mean? In current concept we a using QUORUM and say that
> it is strong. I guess it is confusing (at least for me) and can have
> different behavior for different backends.
>
> I believe that from user point of view only 4 usecases exist: write and
> read with consistency or not.
> For example if we use QUORUM for write what is usecase to use read with
> STRONG one? QUORUM read is enought to get consistent data. Or if we use
> WEAK (ONE) for consistent write what is the use case to use read from
> QUORUM? we need to read from ALL.
>
> But we can to use different kinds of backend's abilities to implement
> consistent and incosistent operation. To provide the best flexibility of
> backend specific features I propose to use backend specific configuration
> section in table schema. In this case you can get much more then in initial
> concept. For example specify consistensy level ANY instead of ONE for WEAK
> consistency if you want concentrate on performance of TWO if you want to
> provide more fault tolerant behavior.
>
> With my proposal we will have only one limitation in comparison with first
> proposal - We have maximally flexible consistency, but per table, not
> per request. We have only 2 choices to specify consistensy per request
> (true or false). But I believe that it is enough to cover user usecases
>
>
>
> On Tue, Apr 29, 2014 at 6:16 AM, Illia Khudoshyn <ikhudoshyn at mirantis.com>wrote:
>
>> Hi all,
>>
>> Dima, I think I understand your reasoning but I have some issues with
>> that. I agree that binary logic is much more straightforward and easy to
>> understand and use. But following that logic, having the only one hardcoded
>> consistency level is even easier and more understandable.
>> As I can see, the idea of the proposal is to provide user a more
>> fine-grained control on consistency to leverage backend features AND at the
>> same time to not bound ourselves with only this concrete backend's
>> features. In scope of Maksym's proposal choice between WEAK/QUORUM for me
>> is pretty much the same as your FALSE/TRUE. But I'd prefer to have more.
>>
>> PS Eager to see your new index design
>>
>>
>> On Tue, Apr 29, 2014 at 7:44 AM, Dmitriy Ukhlov <dukhlov at mirantis.com>wrote:
>>
>>>
>>> Hello Maksym,
>>>
>>> Thank you for your work!
>>>
>>> I suggest you to consider more general approach and hide backend
>>> specific staff. I have the next proposal:
>>> 1) add support for inconsistent write operation by adding PutItem,
>>> UpdateItem and DeleteItem request parameters "consistent" = True of False
>>> (as well as GetItem and Query requests)
>>> 2) add possibility to set backend specific metadata (it would be nice to
>>> use some generic format like json) per table in scope of create table
>>> request. I suggest to specify mapping for Cassandra consistency level per
>>> operation type (consistent read, inconsistent read, consistent write,
>>> inconsistent write)
>>>
>>> I agree that now we have a limitation for inconsistent write operation
>>> on tables with indexed fields and for requests with specified expected
>>> conditions. I have thought about how to overcome this limitation and it
>>> seems that I found out solution for index handling without CAS operation.
>>> And maybe it is reasonable to redesign it a bit.
>>>
>>> On Mon, Apr 28, 2014 at 8:33 AM, MAKSYM IARMAK (CS) <
>>> Maksym_Iarmak at symantec.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Because of we can't use inconsistent write if we use indexed table and
>>>> condition operations which indexes based on (this staff requires the state
>>>> of data), we have one more issue.
>>>>
>>>> If we want to make write with consistency level ONE (WEAK) to the
>>>> indexed table, we will have 2 variants:
>>>> 1. Carry out the operation successfully and implicitly make write to
>>>> the indexed table with minimally possible consistency level for it (QUORUM);
>>>> 2. Raise an exception, that we can not perform this operation and list
>>>> all possible CLs for this operation.
>>>>
>>>> I personally prefer the 2nd variant. So, does anybody have some
>>>> objections or maybe another ideas?
>>>>
>>>> ------------------------------
>>>> *From:* MAKSYM IARMAK (CS) [Maksym_Iarmak at symantec.com]
>>>> *Sent:* Friday, April 25, 2014 9:14 PM
>>>> *To:* openstack-dev at lists.openstack.org
>>>> *Subject:* [openstack-dev] [MagnetoDB] Configuring consistency draft
>>>> of concept
>>>>
>>>> >So, here is specification draft of concept.
>>>>
>>>> _______________________________________________
>>>> OpenStack-dev mailing list
>>>> OpenStack-dev at lists.openstack.org
>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Dmitriy Ukhlov
>>> Mirantis Inc.
>>>
>>
>>
>>
>> --
>>
>> Best regards,
>>
>> Illia Khudoshyn,
>> Software Engineer, Mirantis, Inc.
>>
>>
>>
>> 38, Lenina ave. Kharkov, Ukraine
>>
>> www.mirantis.com <http://www.mirantis.ru/>
>>
>> www.mirantis.ru
>>
>>
>>
>> Skype: gluke_work
>>
>> ikhudoshyn at mirantis.com
>>
>
>
>
> --
> Best regards,
> Dmitriy Ukhlov
> Mirantis Inc.
>
--
Best regards,
Illia Khudoshyn,
Software Engineer, Mirantis, Inc.
38, Lenina ave. Kharkov, Ukraine
www.mirantis.com <http://www.mirantis.ru/>
www.mirantis.ru
Skype: gluke_work
ikhudoshyn at mirantis.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140505/5594c154/attachment.html>
More information about the OpenStack-dev
mailing list