Apoorv
Apoorv

Reputation: 2745

Do I need clock synchronisation for cassandra if only one client writes to cluster?

From cassandra's documentation I got to know that cassandra uses timestamps of query to resolve conflicts between two writes and hence the clocks on all the nodes of the cluster needs to be synchronised. In my use-case we have only one client writing to the cluster and multiple clients reading from the cluster. So, if I use client-side timestamp generator (which I believe is default for version>3) do I still need to have cluster node clocks synchronised with each other?

Upvotes: 3

Views: 576

Answers (2)

Andy Tolbert
Andy Tolbert

Reputation: 11638

In the context of write timestamps associated with data being stored, clock synchronization is not needed if you are using client timestamps and a single client.

However, I would still discourage not at least trying to keep clocks in sync in a Cassandra cluster. There have been cases where clock skew affects other parts of Cassandra. For example, CASSANDRA-11991 shows a case where clock skew effected the node clocks used for light weight transactions. While that particular issue has been addressed, it still seems like a good idea to make an effort to synchronize.

Upvotes: 5

Marko Švaljek
Marko Švaljek

Reputation: 2101

It depends:

  1. Insert with using timestamp [millis] - fine
  2. Insert with timestamp info generated by client in primary key column - fine
  3. Regular inserts without client set time in primary key - might be a good idea to keep the clocks in sync

Upvotes: 2

Related Questions