consistency

how to set cassandra read and write consistency

折月煮酒 提交于 2019-12-06 02:10:45
I can not find the documentation for this. I know there is a consistency command in cqlsh, but there is no distinction between read and write consistency. How would I set different consistency levels for read and write? Furthermore, there is a mention of a "default" consistency level. Where is that default set? and is it for read or write? bechbd By default, the Consistency Level is ONE for all R/W Operations. Setting CL is done on a per query (read or upsert) basis by adding the CONSISTENCY XXXX syntax on the query as seen here: https://cassandra.apache.org/doc/latest/cql/dml.html#insert and

Consistency Level of Cassandra Lightweight transactions

痞子三分冷 提交于 2019-12-05 22:17:25
问题 I read about Cassandra 2's lightweight transactions. Is the consistency level of such a write always at QUORUM? Would this mean that even if I have a multi data center setup with 100s of nodes, then quorum of the entire cluster (majority of the row's replicas across all data centers) is involved? Won't this be really slow and wont it affect availability? Can we do LOCAL_QUORUM or EACH_QUORUM consistency? This would be preferred if writers for data replicated across multiple data centers would

Cassandra - Select without replication

余生长醉 提交于 2019-12-05 11:55:46
Lets say I've created a keyspace and table: CREATE KEYSPACE IF NOT EXISTS keyspace_rep_0 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 0}; CREATE TABLE IF NOT EXISTS some_table ( some_key ascii, some_data ascii, PRIMARY KEY (some_key) ); I don't want any replica of this data. I can insert into this table with consistency level ANY . But I couldn't select any data from this table. I got the following errors when querying with consistency levels ANY and ONE , respectively: message="ANY ConsistencyLevel is only supported for writes" message="Cannot achieve consistency level

Example of execution which is sequentially consistent but not quiescently consistent

我与影子孤独终老i 提交于 2019-12-05 05:55:39
In the context of correctness of concurrent programs, Sequential consistency is stronger condition than quiescent consistency according to The art of multiprocessor programming by Maurice Herlihy and Nir Shavit(chapter 3) Authors also mention in 3.4.1 that there are sequentially consistent executions that are not quiescently consistent. I don't understand how. Could somebody throw a light or provide sample execution ? ewernli Consider a queue (FIFO) to which you enqueue and dequeue elements. From this dissertation about concurrency, I read (p.20): An example of a scenario that is allowed in

inconsistency issue with Objectify query result and Datastore viewer result?

那年仲夏 提交于 2019-12-05 00:02:54
问题 I'm coding a sample project based on TodoMVC angularjs (http://todomvc.com/) and with a backend api with Google App Engine Cloud Endpoint and I'm having some consistency result when getting the todos liste from App Engine Datastore. Todo object are stored in the App Engine Datastore using objectify. A Todo entity is coded as follow: @Entity public class Todo { @Id private Long id; private String title; private boolean completed; private Date lastEdit; @Index private Long userId; public Todo()

Example of a memory consistency error when using volatile keyword?

余生颓废 提交于 2019-12-04 22:13:10
问题 From docs: Using volatile variables reduces the risk of memory consistency errors But this means that sometimes volatile variables don't work correct? Strange how it can be used - for my opinion it is very bad code that sometimes work sometimes not. I tried to Google but didn't find example memory consistency error with volatile. Could you please propose one? 回答1: The issue is not so much that volatile works unreliably. It always works the way it is supposed to work. The problem is that the

FireBase - maintain/guarantee data consistency

谁说我不能喝 提交于 2019-12-04 21:41:31
I'm trying to understand what is the right approach for this following scenario : Multiplayer game,each game structured only with two players. Each game/match will be completely randomized Lets assume 5 users "logs" the same time into my app, each one of them "searching" for a match. Each user hold a property named opponent which equal the the opponent uniqueID (initial value equal "" . so far so good. assuming user 1 matched with user 3. user 1 will update his own oppoent value to user 3 uniqueID and will do the same to user 3 Problem 1) What if at the same moment, user 2 tried to to the same

Choosing a NoSQL database for storing events in a CQRS designed application

你说的曾经没有我的故事 提交于 2019-12-04 11:49:24
I am looking for a good, up to date and "decision helping" explanation on how to choose a NoSQL database engine for storing all the events in a CQRS designed application. I am currently a newcomer to all things around NoSQL (but learning): please be clear and do not hesitate to explain your point of view in an (almost too much) precise manner. This post may deserve other newcomers like me. This database will: Be able to insert 2 to 10 rows per updates asked by the front view (in my case, updates are frequent). Think of thousand of updates per minute, how would it scale? Critically need to be

Are there any general algorithms for achieving eventual consistency in distributed systems?

岁酱吖の 提交于 2019-12-04 07:52:37
Are there any algorithms that are commonly used for achieving eventual consistency in distributed systems? There are algorithms that have been developed for ACID transactions in distributed systems, Paxos in particular, but is there a similar body of theory that has been developed for BASE scenarios, with weaker consistency guarantees? Edit: This appears to be an area of academic research that is only beginning to be developed. Mcdowella's answer shows that there has been at least some work in this area. If "Anti-entropy protocols for repairing replicated data, which operate by comparing

Cache consistency when using memcached and a rdbms like MySQL

放肆的年华 提交于 2019-12-03 12:07:52
I have taken a database class this semester and we are studying about maintaining cache consistency between the RDBMS and a cache server such as memcached. The consistency issues arise when there are race conditions. For example: Suppose I do a get(key) from the cache and there is a cache miss. Because I get a cache miss, I fetch the data from the database, and then do a put(key,value) into the cache. But, a race condition might happen, where some other user might delete the data I fetched from the database. This delete might happen before I do a put into the cache. Thus, ideally the put into