Live data from Hacker News

Serializable, Lockless, Distributed: Isolation in CockroachDB

cockroachlabs.com

1–10 of 54 posts

Re: Serializable, Lockless, Distributed: Isolation in CockroachDB

#3
post #2

I love the transparency this project operates with. Looking forward to when joins are implemented so I can try using it with something non-trivial.

> Looking forward to when joins are implemented so I can try using it with something non-trivial.

these types of databases typically don't have joins. you'll be waiting a while.

Re: Serializable, Lockless, Distributed: Isolation in CockroachDB

#4
post #2

I love the transparency this project operates with. Looking forward to when joins are implemented so I can try using it with something non-trivial.

> Looking forward to when joins are implemented so I can try using it with something non-trivial. these types of databases typically don't have joins. you'll be waiting a while.

It's not a nosql database if that's what you're thinking.

https://github.com/cockroachdb/cockroach/issues/2970

Re: Serializable, Lockless, Distributed: Isolation in CockroachDB

#5
post #2

I love the transparency this project operates with. Looking forward to when joins are implemented so I can try using it with something non-trivial.

> Looking forward to when joins are implemented so I can try using it with something non-trivial. these types of databases typically don't have joins. you'll be waiting a while.

Joins are coming, although they will take some time.

Re: Serializable, Lockless, Distributed: Isolation in CockroachDB

#7

How does this work if the clocks drift between the nodes? Does this allow incorrect behavior because one transaction looks like it happened before another?

This was discussed earlier on the same blog: https://www.cockroachlabs.com/blog/living-without-atomic-clo...

Short answer: the DB will check for drifts and correct small drifts automatically.

Re: Serializable, Lockless, Distributed: Isolation in CockroachDB

#8

How does this work if the clocks drift between the nodes? Does this allow incorrect behavior because one transaction looks like it happened before another?

(blog author here)

Interestingly, clock drift does not affect the serializability of the transaction history; this system guarantees that the history is serializable, regardless of clock drift.

However, "serializable" only means that the history is equivalent to some serial ordering of transactions - it makes no guarantee that the equivalent serial ordering is consistent with the real-time ordering of the involved transactions. A history with that property (agrees with real-time) is termed "linearizable", and requires additional rules to guarantee in an environment with clock drift.

As mentioned by knz42, there was another Cockroach Labs blog post (written by Spencer Kimball) that addressed this in some detail; that blog post contrasted our strategy for dealing with drift with that of Google's Spanner.

A quick overview of CockroachDB's properties re linearizability: it guarantees that access to any individual key is linearizable, and by composition any two transactions which share a key (that one of the transactions modifies) will be linearizable with respect to each other. However, if two transactions do not have any overlap in modified keys, Cockroach does not (by default) guarantee the resulting commit history is linearizable. CockroachDB's underlying KV layer does have a "linearizable" flag on transactions that can guarantee this, but it requires that transactions be slowed down considerably; Spencer's blog post addresses some other strategies that CockroachDB is considering to address the issue.

Re: Serializable, Lockless, Distributed: Isolation in CockroachDB

#10

How does this work if the clocks drift between the nodes? Does this allow incorrect behavior because one transaction looks like it happened before another?

Hybrid logical and physical clocks. http://muratbuffalo.blogspot.com/2014/07/hybrid-logical-cloc...
Post reply on HN