You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by suraj pasuparthy <su...@gmail.com> on 2017/07/06 06:01:12 UTC

Guaranteed order for syncing Records

Hello Experts,
I had a question

We have a multi DC cluster for cassandra and wanted to confirm one behavior.
Are the records order maintained while syncing to the backup datacenter?
What i mean is, if say, Record A is written to a Table A and Record B is
written to Table B on Datacenter 1, Does cassandra ensure that first Record
A is synced to Table A in Datacenter 2 and then the Record B syncs to table
B ?

Is there a possibility of "out of order " syncs between datacenters ?

-- 
Suraj Pasuparthy

Re: Guaranteed order for syncing Records

Posted by Jeff Jirsa <jj...@apache.org>.

On 2017-07-05 23:14 (-0700), suraj pasuparthy <su...@gmail.com> wrote: 
> thanks Pranay,
> But is the order maintained across tables?
> As in the client in DC1 first writes record A in table A and then
> immediately writes Record B in Table B,
> So will the order be maintained, where in Table A gets synced first and
> then Table B?
> 

Cassandra doesn't use traditional sync mechanisms like you may be assuming (there is no binary transaction log that is replayed in order on each server). The order of mutations arriving on the replicas is NOT guaranteed at this time.

If you need to guarantee the above behavior, you may be able to accomplish it with either sufficiently high consistency levels (block the acknowledgement of the write until N replicas have responded, including the remote datacenters) at the cost of query latency.
 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org


Re: Guaranteed order for syncing Records

Posted by Jonathan Haddad <jo...@jonhaddad.com>.
Cassandra uses the writetime to resolve the conflict. Highest time stamp
wins. There's no guarantee on the order the mutations arrive in.
On Thu, Jul 6, 2017 at 7:14 AM suraj pasuparthy <su...@gmail.com>
wrote:

> thanks Pranay,
> But is the order maintained across tables?
> As in the client in DC1 first writes record A in table A and then
> immediately writes Record B in Table B,
> So will the order be maintained, where in Table A gets synced first and
> then Table B?
>
> Thanks again
> -Suraj
>
> On Wed, Jul 5, 2017 at 11:08 PM, Pranay akula <pr...@gmail.com>
> wrote:
>
>> Hello suraj,
>>
>> Nope there will no out sync between same tables in different Datacenters,
>> so Record A in Table A in Datacenter 1 will also be in Table A in
>> Datacenter 2, just make sure there is no communication issues between
>> Datacenters.
>>
>>
>> Thanks
>> Pranay.
>>
>> On Thu, Jul 6, 2017 at 2:01 AM, suraj pasuparthy <
>> suraj.pasuparthy@gmail.com> wrote:
>>
>>> Hello Experts,
>>> I had a question
>>>
>>> We have a multi DC cluster for cassandra and wanted to confirm one
>>> behavior.
>>> Are the records order maintained while syncing to the backup datacenter?
>>> What i mean is, if say, Record A is written to a Table A and Record B is
>>> written to Table B on Datacenter 1, Does cassandra ensure that first Record
>>> A is synced to Table A in Datacenter 2 and then the Record B syncs to table
>>> B ?
>>>
>>> Is there a possibility of "out of order " syncs between datacenters ?
>>>
>>> --
>>> Suraj Pasuparthy
>>>
>>>
>>
>
>
> --
> Suraj Pasuparthy
>
> cisco systems
> Software Engineer
> San Jose CA
>

Re: Guaranteed order for syncing Records

Posted by suraj pasuparthy <su...@gmail.com>.
thanks Pranay,
But is the order maintained across tables?
As in the client in DC1 first writes record A in table A and then
immediately writes Record B in Table B,
So will the order be maintained, where in Table A gets synced first and
then Table B?

Thanks again
-Suraj

On Wed, Jul 5, 2017 at 11:08 PM, Pranay akula <pr...@gmail.com>
wrote:

> Hello suraj,
>
> Nope there will no out sync between same tables in different Datacenters,
> so Record A in Table A in Datacenter 1 will also be in Table A in
> Datacenter 2, just make sure there is no communication issues between
> Datacenters.
>
>
> Thanks
> Pranay.
>
> On Thu, Jul 6, 2017 at 2:01 AM, suraj pasuparthy <
> suraj.pasuparthy@gmail.com> wrote:
>
>> Hello Experts,
>> I had a question
>>
>> We have a multi DC cluster for cassandra and wanted to confirm one
>> behavior.
>> Are the records order maintained while syncing to the backup datacenter?
>> What i mean is, if say, Record A is written to a Table A and Record B is
>> written to Table B on Datacenter 1, Does cassandra ensure that first Record
>> A is synced to Table A in Datacenter 2 and then the Record B syncs to table
>> B ?
>>
>> Is there a possibility of "out of order " syncs between datacenters ?
>>
>> --
>> Suraj Pasuparthy
>>
>>
>


-- 
Suraj Pasuparthy

cisco systems
Software Engineer
San Jose CA

Re: Guaranteed order for syncing Records

Posted by Pranay akula <pr...@gmail.com>.
Hello suraj,

Nope there will no out sync between same tables in different Datacenters,
so Record A in Table A in Datacenter 1 will also be in Table A in
Datacenter 2, just make sure there is no communication issues between
Datacenters.


Thanks
Pranay.

On Thu, Jul 6, 2017 at 2:01 AM, suraj pasuparthy <suraj.pasuparthy@gmail.com
> wrote:

> Hello Experts,
> I had a question
>
> We have a multi DC cluster for cassandra and wanted to confirm one
> behavior.
> Are the records order maintained while syncing to the backup datacenter?
> What i mean is, if say, Record A is written to a Table A and Record B is
> written to Table B on Datacenter 1, Does cassandra ensure that first Record
> A is synced to Table A in Datacenter 2 and then the Record B syncs to table
> B ?
>
> Is there a possibility of "out of order " syncs between datacenters ?
>
> --
> Suraj Pasuparthy
>
>