Pergunta

Cassandra and many other similar systems provide no transactions support. Instead they provide eventual consistency which means that the writer to the system eventually will be in consistent state. Are there any examples on how can I use to emulate something that transactions can emulate?

I understand that there are cases where eventual consistency is what we need. For example, we can easily tolerate a list of friends in a social network isn't always up-to-date, etc. But what should we do in case of systems like hotel reservation or money transfer? Google app engine has entity groups, can we emulate them somehow in a system which provides eventual consistency?

Are there any aritcles where can I find examples of similar architectures?

Foi útil?

Solução

You can have distributed consistency (for a single operation) without transactions, but not atomicity (for groups of operations). Although 'consistency' in Cassandra is used in a slightly more specific sense than for ACID databases in general.

Cassandra supports tunable consistency levels (CLs) - you can specify the consistency level for each read and write. See http://wiki.apache.org/cassandra/API.

These levels range from CL.ANY (which reads or writes from/to a single node, initially) to CL.ALL (which gives you full consistency, at the expense of availability).

However, it doesn't give you a way to group operations into atomic transactions so they all succeed or all fail (though I think multiple operations on the same row are atomic, but not independent).

See also:

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top