On Mon, Sep 20, 2010 at 7:25 PM, Kuan(謝冠生) <lakersg...@mail2000.com.tw> wrote: > By using cassandra-cli tool, we don't have to input timestamp while > insertion. Does it mean that Cassandra have time synchronization build-in > already?
No, it means the cassandra-cli program is inserting a timestamp, which it then provides to the cluster via thrift, just like any other client. > Since cassandra depending on time-stamp parameter very much (both > read/write). The most ideal way to deal with timestamp is by cassandra > itself, considering data safty and consistensy.... > This doesn't fix anything, unfortunately. Time synchronization/event ordering in distributed systems is a notoriously hard problem. Having Cassandra nodes (remember, there are many in a cluster) assign timestamps just means their clocks need to be tightly synchronized, exactly as is the case for having clients insert timestamps. They will never be in sync enough to deal with badly designed apps attempting to simultaneously write to the same cell. Further, as jbellis mentioned, there are other reasons to not want the _current_ time used as the timestamp. The end result is that it is neither advantageous nor desirable to have cluster nodes assign timestamps. If that is the requirement, you need to a) fix your application, b) use a locking service like Zookeeper, or c) use an ACID database. b