0

Is anyone aware of some simple examples of application taking into account the 'eventual consistency' caveat of a distributed database like Cassandra ? I am hoping that there are some design-patterns that helps us deal with this.

If the example is in Python or Java, it'd be easiest for me to understand.

Community
  • 1
  • 1
bdutta74
  • 2,798
  • 3
  • 31
  • 54

1 Answers1

1

Here is example from datastax. http://docs.datastax.com/en/developer/java-driver/2.1/common/drivers/reference/cqlStatements.html

  • Thanks for the answer Aravind. In the example pointed, what I can see is that prior to the CQL statement being issued, the consistency level is set to ONE (i.e. I believe 'eventually consistent'), but it doesn't show how we deal with the situation that the data being read, might not be consistent (yet!). – bdutta74 Aug 15 '15 at 11:21
  • 1
    Eventually consistency here means the nodes which would not have accurate data will eventually get the correct data, it is achieved by cassandra as read repair , anti entropy or hinted hand off. At any point of time if your write was successful based on your consistency level, then you will always get accurate data. (Exception cases: When the nodes which have accurate data are down, there is no way for the nodes which have older data to know what is latest and your application might never be able to determine if data is accurate) – Aravind Chamakura Aug 17 '15 at 15:28