News for hackers. Stuff that matters.
Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by jhgg on Saturday October 08, 2022 @09:31PM (#33137557)
What is wrong with CQL? The only gotcha I am aware of is UPDATE/INSERT really just meaning UPSERT.
Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by mnd999 on Sunday October 09, 2022 @04:30AM (#33139116)
It encourages you to think you can use secondary indexes to make different types of query over the same data like SQL, which you mostly can’t.
Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by Luker88 on Sunday October 09, 2022 @04:46AM (#33139174)
In no particular order:

* LWT (Lightweight Transactions) are nothing like what you expect when you head "transactions". LWT are single row only.

* error handling is asinine. E.g: A quorum insert fails. is the data there or not? Maybe!

* material views. Added, removed, readded, deprecated.

* big limits on secondary indexes which only work inside each single partition

* different format of timestamp for insert and select

* BATCH is atomic, but not isolated.

...In general CQL feels like a hack. In classic SQL you understand early that you can compose queries, subqueries and such. CQL leads to you to believe that this is possible, only for you to find out that it isn't. The docs are full of stuff like "You can do this query, except in this case, unless this other case in which you can again, but not in this other". It's just exception on top of exception. Even the documentation does not list all exceptions (I managed to find a couple in my last work).

Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by jlokier on Sunday October 09, 2022 @05:56AM (#33139508)
> A quorum insert fails. is the data there or not? Maybe!

How is this point fundamentally different from SQL? In SQL, after you send COMMIT to a remote database and get back a network error, you don't know if your INSERTed data is committed or not. You'll have to reconnect and check for it.

Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by Luker88 on Sunday October 09, 2022 @06:22AM (#33139655)
In CQL queries can fail even if your connection is still up and running.

In this case it means that it could not write to 3 nodes, but it is not telling you if it did not write anything or at least once. Writing just once means that the data will be replicated.

So if only 1 of the 3 nodes is up, it will still write there and then return error, even if the coordinator knows that the other nodes are not up.

Queries have a maximum running time (only configurable at the database level if I remember correctly), and if your write exceeds this, it returns error. The replication still goes on and the data is still there.

Network errors are different category, since you might not even know if your command was sent or not. Cassandra kind of sidesteps the network errors though since the client connects to multiple coordinators in the cluster.

Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by _benedict on Sunday October 09, 2022 @07:26AM (#33140009)
They are not a different category. This is a distributed database, network errors and node failures are a fundamental part of its function.

Eventual consistency is a simple mechanism offering one round-trip operations. Fundamentally, if you have only one round-trip you cannot guarantee that a failure response to a client means a failure to proceed with the operation, as the round may have completed before the coordinator is informed. This limitation applies to all such optimal latency protocols including newer transactional ones.

Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by jfray2k22 on Sunday October 09, 2022 @11:51PM (#33147585)
I think the concern there is that these different failure modes are all given the same error/exception messaging? The caller could make different decisions based on these different potential outcomes, but only if the caller receives specific errors. It's been a while since I've used Cassandra, so if the error handling has improved along those lines then I apologize.
Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by _benedict on Monday October 10, 2022 @02:04AM (#33148285)
A timeout is pretty much always an unknown outcome. Cassandra does have dedicated exceptions for failed writes (which should have a certain outcome of not applied) but this is much rarer in practice.

Cassandra does today inform you on timeout how many replicas have been successfully written to, if it was insufficient to reach the requested level of durability, which many years ago it did not. But this is no guarantee the write is durable, as this will represent a minority of nodes - and they may fail, or be partitioned from the remainder of the cluster. So the write remains in an unknown state until successfully read at QUORUM, much like a timeout during COMMIT for any database.

Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by _benedict on Sunday October 09, 2022 @07:12AM (#33139940)
> LWTs

Single partition only. Poorly named, sure. Feature-wise though pretty comparable to peer offerings. Fortunately general purpose transactions are coming next year.

> material views. Added, removed, readded, deprecated.

No; added, then marked experimental. Never removed or deprecated, though they may be superseded before long.

> error handling is asinine

Fundamental distributed systems problem that is just more apparent with eventual consistency. Failure does not have a certain outcome.

Re:Cassandra at Apple: 1000s of Clusters, 300k Nodes, 100 PB by skyde on Sunday October 09, 2022 @12:48PM (#33142876)
please tell me more about General purpose transaction! I really hope they work Kyle Kingsbury.