Earlier quoted context omitted.
It's not a nosql database if that's what you're thinking. https://github.com/cockroachdb/cockroach/issues/2970
Joins in distributed databases all must make some sort of unsavory tradeoff be it speed or space or limiting what you can join. So, while any distributed database can do a join, it may not be fast or flexible enough to be worth it.
Serializable, Lockless, Distributed: Isolation in CockroachDB
21–30 of 54 posts
Re: Serializable, Lockless, Distributed: Isolation in CockroachDB
#22Earlier quoted context omitted.
Can Cockroach do the equivalent of a "select ... for update" (e.g., PostgreSQL), where you lock one thing while applying changes elsewhere? Concrete example: We have app that has a "documents" table and a "translog" table. The translog is like a series of diff-patches, representing changes to the documents. When we write to the translog, we first lock the document with a "select ... for update", so that no intervenin…
(employee here) It seems to me that your use-case does not require locking specifically - you just want to make sure no concurrent transactions can clobber your "update A". As mrtracy explained, such overlapping transactions are linearizable in CockroachDB, so this invariant is preserved without the need for explicit locking.
Re: Serializable, Lockless, Distributed: Isolation in CockroachDB
#23Earlier quoted context omitted.
It's not a nosql database if that's what you're thinking. https://github.com/cockroachdb/cockroach/issues/2970
Joins in distributed databases all must make some sort of unsavory tradeoff be it speed or space or limiting what you can join. So, while any distributed database can do a join, it may not be fast or flexible enough to be worth it.
Best way to solve a problem is to avoid it.
Re: Serializable, Lockless, Distributed: Isolation in CockroachDB
#24Earlier quoted context omitted.
> 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.
(employee/founder here) Re joins: we have top men working on it right now. Joins are definitely an interesting problem for a distributed database.
Also, what levels of isolation do you actually offer? Serialized snapshot isolation appears to be MVCC, but I see you also have just snapshot isolation - what is the difference?
Edit: oh brother, the proof you link to, I just realized I bought that book some time ago and never got around to reading it... Transactional Information Systems by Weikum & Vossen, right? time for me to hit the books I guess. Still trying to get my head around that second graph you have drawn, can't work out how you have gotten it :(
Re: Serializable, Lockless, Distributed: Isolation in CockroachDB
#25One quick question since I saw the devs around and I can't find a final answer on it on google: are there any strong roadblock or performance drawbacks against storing principally medium size binary data like images, say, Yeah I could use something more appropriate but I'd be back to figuring out hadoop installation or fighting s3 eventual consistency.
Re: Serializable, Lockless, Distributed: Isolation in CockroachDB
#26Earlier quoted context omitted.
(employee here) It seems to me that your use-case does not require locking specifically - you just want to make sure no concurrent transactions can clobber your "update A". As mrtracy explained, such overlapping transactions are linearizable in CockroachDB, so this invariant is preserved without the need for explicit locking.
I think it does require locking, because in PostGres (or Oracle) readers do not block writers and writers do not block readers. So to be sure you update the same version you read, you have to select...for update.
A typical RDBMS will prevent conflicts by forcing queries to block until they can be executed in a conflict-free ordering. CockroachDB instead detects conflicts after the fact and prevents inconsistent transactions from committing, forcing them to retry. The end result -- that is, the set of possible outcomes of a series of transactions -- is the same, but the performance characteristics will be different.
Re: Serializable, Lockless, Distributed: Isolation in CockroachDB
#27I 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.
And if you add an additional requirement to correctly execute ad hoc consistent joins under very high write workloads and continuous failures, then it is definitely non-trivial engineering. But it is possible, I've designed implementations like this before, it just requires a very high degree of effort and skill that is rarely applied to the design of typical NoSQL databases.
Re: Serializable, Lockless, Distributed: Isolation in CockroachDB
#28Earlier quoted context omitted.
(employee/founder here) Re joins: we have top men working on it right now. Joins are definitely an interesting problem for a distributed database.
Hi Peter, sounds pretty awesome! Quick question though - on your front page you say that CockroachDB does SQL - but if it can't do a join, then how can you say it uses SQL? Or is distributed SQL a different thing entirely? It does sounds like a very limited SQL subset though... I'm sure I must be missing something as I'm not familiar with your product. Also, what levels of isolation do you actually offer? Serialized…
For now CockroachDB's supports a subset of the SQL implemented by other databases, with some extensions of its own. This subset will grow over time.
The two levels of isolation offered are snapshot (SI) and serializable (SSI). Snapshot means that concurrent transactions are atomic with regards to each other and "see" the same initial state from the DB. Serializable adds into this that they can't introduce write skews, ie if there are concurrent transactions they will "see" each others effects in some order.
Re: Serializable, Lockless, Distributed: Isolation in CockroachDB
#29By coincidence I was looking around for a datastore. I almost settled on couchbase when I saw this; easy cluster deployment is my main draw after looking at how bad setting up master-master system is in other solutions (hbase, mongo, couchdb all have eterogeneus nodes and weird failure modes) One quick question since I saw the devs around and I can't find a final answer on it on google: are there any strong roadblock…
I'd suggest having an immutable distributed blob store, and just store the index in the distributed database.
Of course, now you are half way towards a distributed filesystem...
Re: Serializable, Lockless, Distributed: Isolation in CockroachDB
#30Earlier quoted context omitted.
> 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.
(employee/founder here) Re joins: we have top men working on it right now. Joins are definitely an interesting problem for a distributed database.