Live data from Hacker News

A Newbie’s Guide to Cassandra

blog.insightdatascience.com

1–10 of 26 posts

Re: A Newbie’s Guide to Cassandra

#3
These days I work with Cassandra on a daily basis. The company I am contracting with switched to Cassandra a while back for their primary data store. A few poor decisions later and they were spending tens of thousands of dollars a month running Cassandra in Azure. The cost was high because they modeled and queried their data like they were still using a SQL database which was incredibly inefficient.

The lesson here is to think long and hard about how you are going to access your data before switching to a database like Cassandra. This will help you decide if Cassandra is the right database to fit your use-cases. If so, be sure to model your data appropriately.

In this case, based on how the company wants to query the data, they would have been better off with PostgeSQL.

Re: A Newbie’s Guide to Cassandra

#4
> Cassandra’s data model is a partitioned row store with tunable consistency where each row is an instance of a column family that follows the same schema

"Total Newbie" apparently means well-versed in database paradigms and terminology.

Re: A Newbie’s Guide to Cassandra

#5

These days I work with Cassandra on a daily basis. The company I am contracting with switched to Cassandra a while back for their primary data store. A few poor decisions later and they were spending tens of thousands of dollars a month running Cassandra in Azure. The cost was high because they modeled and queried their data like they were still using a SQL database which was incredibly inefficient. The lesson here i…

> The cost was high because they modeled and queried their data like they were still using a SQL database which was incredibly inefficient.

That's literally every Cassandra database I've ever encountered in the wild.

If you use Cassandra, you WILL need to duplicate data across tables for lookups. Don't use Cassandra if you can't stomach that fact (and the disk bills that come with it).

Re: A Newbie’s Guide to Cassandra

#6

These days I work with Cassandra on a daily basis. The company I am contracting with switched to Cassandra a while back for their primary data store. A few poor decisions later and they were spending tens of thousands of dollars a month running Cassandra in Azure. The cost was high because they modeled and queried their data like they were still using a SQL database which was incredibly inefficient. The lesson here i…

any recommendation and resources to read up on for when to use cassandra and how to design the schema?

Re: A Newbie’s Guide to Cassandra

#7

> Cassandra’s data model is a partitioned row store with tunable consistency where each row is an instance of a column family that follows the same schema "Total Newbie" apparently means well-versed in database paradigms and terminology.

Agreed. If anyone has recommended resources for someone coming from from SQL world and wanting to learn more about databases like Cassandra and HBase space, please share!

Re: A Newbie’s Guide to Cassandra

#8
CQL is the best and worst thing about Cassandra. The pro is that obviously it is very similar to SQL so it's easy to understand, the con is that C* is nothing like a RDBMS so you can be easily fooled into doing dumb/inefficient things with the nice CQL syntax.

I think that Cassandra is best thought of as a fancy K/V store that lets extra data ride along with query results. Don't think of rows/columns at first, it will just screw you up in your modeling. Also keep in mind that the cost for very fast queries is a lot of extra time spent figuring out how to model new data access patterns in the future.

Re: A Newbie’s Guide to Cassandra

#9
This article does a massive disservice by using the pre-CQL Column Family and Row terminology. While it's the Cassandra data modelling I'm the most accustomed to personally, it causes endless confusion for users who find themselves in the CQL documentation trying to understand how it all maps to Primary Keys, Partition Keys, static columns, etc.

This transition has been causing confusion for at least 5 years now, and it appears people are still using the old terminology! https://www.datastax.com/dev/blog/thrift-to-cql3

Re: A Newbie’s Guide to Cassandra

#10
One thing that Cassandra doesn't have a good story of, and what intro guides continue to gloss over is the ops situation. I've recently moved some our largest Cassandra tables to BigTable for this reason. The compaction / repair / garbage collection death cycle is probably the most difficult thing to manage, and in the past 3 years of using Cassandra, managing it has gotten worse. Tools have been deprecated (like OpsCenter) and new features can exacerbate the problem. There is still no reliable way to detect when repairs have finished, and if you have a large enough table, repairs can take a week to finish. Combine that with the fact that if a table is that large, then it probably has a high write volume - meaning it has a lot of compactions as well. So you have repairs and compactions going on which thrash the heap, and now you also have a GC tuning problem.

It took a lot of experimentation to get right, but once I did, scaling started to mean smaller drives and more nodes, which meant a more expensive cluster, for which I was largely paying for my CPUs to repair and garbage collect data.

Other than ops however, Cassandra is a great tool and does everything it says it does on the box.

Post reply on HN