You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Kia Rahmani <ki...@gmail.com> on 2018/08/13 17:44:00 UTC

Effect of WriteSynchronizationMode on write operations inside a transaction in Apache Ignite

Hi Folks,

WriteSynchronizationMode allows users to pick from 3 different
synchronization modes (FULL_SYNC, FULL_ASYNC, PRIMARY_SYNC) when performing
writes on a distributed setting.

Based on my understanding, when writing to the cache (whether inside or
outside of a transaction) the user-perceived latency must be the same in the
following two scenarios if the WriteSynchronizationMode is set to
PRIMARY_SYNC:

1)one-node cluster where only 1 primary copy of the data exits in a remote
server.
2) two-node cluster where 1 primary copy of the data resides on the remote
server and a backup copy 
    exists in the adjacent server.

In other words, the write latency should not be affected by the number of
backup copies in PRIMARY_SYNC.

However, in my current experiments (performing 2 writes inside a
transaction), I am facing different latencies for the above settings (3RTT
for scenario #1 and 4RTT for scenario #2 ). 

Can someone please explain why this is happening how I can fix it? 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

RE: Effect of WriteSynchronizationMode on write operations inside atransaction in Apache Ignite

Posted by Stanislav Lukyanov <st...@gmail.com>.
Hi,

Generally, your initial thoughts on the expected latency are correct – PRIMARY_SYNC allows you not to wait for the writes
to complete on the backups. However, some of the operations still have to be completed on all nodes (e.g. acquiring key locks),
so increasing the number of backups does affect the execution time.

If what you need is a local copy to speed up reads than you’re probably looking for a near cache:
https://apacheignite.readme.io/docs/near-caches

Stan

From: Kia Rahmani
Sent: 13 августа 2018 г. 22:22
To: user@ignite.apache.org
Subject: Re: Effect of WriteSynchronizationMode on write operations inside atransaction in Apache Ignite

The main reason I want to add backups is to allow very fast reads (assuming
backup reads are allowed). 
Do you know of any way of keeping (stale) copies locally (next to the
clients) in order to save network latency in read operations, without
affecting write latency?





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: Effect of WriteSynchronizationMode on write operations inside a transaction in Apache Ignite

Posted by Kia Rahmani <ki...@gmail.com>.
The main reason I want to add backups is to allow very fast reads (assuming
backup reads are allowed). 
Do you know of any way of keeping (stale) copies locally (next to the
clients) in order to save network latency in read operations, without
affecting write latency?





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Effect of WriteSynchronizationMode on write operations inside a transaction in Apache Ignite

Posted by Kia Rahmani <ki...@gmail.com>.
Thanks for the prompt reply!

Here is my client code:
https://www.codepile.net/pile/ywYXOvJX

In the experiment, the client resides in Singapore and 2 servers are located
at Singapore (same machine as the client) and Ohio. The primary copy is
maintained at Ohio and the backup is kept in Singapore next to the client. 
(The main reason of doing this is to be able to achieve performance by
keeping a backup copy next to the clients, however I am not able to see
this, because although the reads become much faster (assuming backup reads
are allowed) the writes now become slower (compared to a single server and
copy setup)

Thanks!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Effect of WriteSynchronizationMode on write operations inside a transaction in Apache Ignite

Posted by akurbanov <an...@gmail.com>.
Hello,

Can you share your benchmark?




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/