Slashdot Mirror


Cassandra 0.7 Can Pack 2 Billion Columns Into a Row

angry tapir writes "The cadre of volunteer developers behind the Cassandra distributed database have released the latest version of their open source software, able to hold up to 2 billion columns per row. The newly installed Large Row Support feature of Cassandra version 0.7 allows the database to hold up to 2 billion columns per row. Previous versions had no set upper limit, though the maximum amount of material that could be held in a single row was approximately 2GB. This upper limit has been eliminated."

28 of 235 comments (clear)

  1. Typical applications? by oldhack · · Score: 3, Interesting

    What sorta applications need so many columns? Curious.

    --
    Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
    1. Re:Typical applications? by Brummund · · Score: 5, Funny

      Any application developed by one or more Visual Basic developers, given enough time.

    2. Re:Typical applications? by gratuitous_arp · · Score: 5, Interesting

      Apparently the extra columns can be used to the effect of doing "more" than store data. A link in the article explains how lots of extra columns can be useful for querying data (Casandra doesn't use SQL). http://maxgrinev.com/2010/07/12/do-you-really-need-sql-to-do-it-all-in-cassandra/

      So the primary reason for this doesn't seem to be that one's run-of-the-mill database needs more columns.

    3. Re:Typical applications? by SQL+Error · · Score: 3, Interesting

      The main reason was that Cassandra prior to 0.7 didn't support secondary indexes. Your keys in a table ("columnfamily" in Cassandra-speak) were indexed, and the names of the columns in a row were indexed. And Cassandra is schemaless, so the columns in one row could be completely different to the columns in another.

      So you'd use columns as sub-records to get the data structures you need.

      With 0.7 and secondary indexes, that's going to be less important.

    4. Re:Typical applications? by jrumney · · Score: 5, Funny

      What sorta applications need so many columns?

      Facebook needs one column for every privacy violation.

    5. Re:Typical applications? by RobertM1968 · · Score: 3, Funny

      Any application developed by one or more Visual Basic developers, given enough time.

      How could that possibly be true, MS Access only supports 255 columns.

      And now you understand why Cassandra is so important! :-)

    6. Re:Typical applications? by red_blue_yellow · · Score: 3, Informative

      Columns in Cassandra aren't analogous to columns in an RDBMS. Every row is basically a list of (key, value) pairs. This is referred to as a column, with the key being the column name. There's no requirement that rows have the same set of column names.

      Typically large rows are used for indexes or timelines. In a timeline example, you might use a timestamp for every column name and store the entry as the column value. Cassandra keeps the row sorted by column name, so all of the entries in the row (timeline) will be in chronological order.

      In the case of indexes, you may use one row for every indexed value (say, one row for all users from Utah, one for all from Texas, etc). Here, each column would store the row key (primary key) of a row in another column family (table) that matches that indexed value; in this case, every column might hold a userId.

      --
      A neutral communications medium is essential. It is the basis of science, by which humankind should decide what is true.
    7. Re:Typical applications? by mini+me · · Score: 3, Informative

      Cassandra did not support said indexes until this very release. Even with secondary indexes, storing data in columns is still a reasonable design choice for many requirements. A column in Cassandra is not like a column in a relational database.

      I am sure that this is welcome news for big Cassandra users, but I do agree that it is a strange choice for the front page of Slashdot. Then again, with the number of comments asking why you would need so many columns, it seems that Slashdot needs to talk about Cassandra a little more.

    8. Re:Typical applications? by NFN_NLN · · Score: 3, Informative

      Any application developed by one or more Visual Basic developers, given enough time.

      How could that possibly be true, MS Access only supports 255 columns.

      And now you understand why Cassandra is so important! :-)

      In all seriousness I had no idea what Cassandra was or what made it unique as a database. However, I did find this tutorial that others might also find useful:

      http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model

    9. Re:Typical applications? by Sarten-X · · Score: 4, Informative

      Welcome to the first five minutes of using a column store. Screwey, ain't it?

      My understanding is that rows' contents are indexed such that they may be retrieved quickly. Think of a row name as a primary key. It's easy to get the whole row when you know its name. Continuing the census application, it's be like asking for all the birth years of everyone in a geographical region. The requested column family (geographical region) is opened, and each column (person) is quickly checked for the particular row's contents (in case the birth year wasn't provided). Partitioning is done by both row and column family, so only some of the column family's data is actually scanned. That's where the cluster provides a very nice speedup, as well.

      locating a value in a specific row can't tell how to retrieve that entire column

      Now, I'm not sure if I understand your rage-induced rambling correctly, but if you're trying to make a SQL example, you're starting from the wrong premise, which explains why you're having trouble making sense of it all.

      Quick review: The "R" in "RDBMS" stands for "relational", referring to a n-ary relation. SQL is intended to manipulate those relations, isolating the data you want to extract. Something that is not described as an RDBMS should not be expected to have relations.

      Cassandra functions (from the application perspective) as a key-value store, with no relation structure. That means you don't work with sets, and you don't need to think about set operations. Pull out a row, and you get a list of columns with defined values, as well as those values. Iterate through each value looking for whatever value you're looking for. When you find it, you already have the column name. Just ask for the whole column next. Since the whole thing is running in a cluster, you can parallelize the iterations (I think... I've used HBase, but not Cassandra personally) to speed up the scan.

      If that's not fast enough for you (which is likely), you can use Hadoop's MapReduce framework to scan each cell and create an index, possibly laid over the other table as just more rows & columns (though a different table would be better, from a sanity perspective). Since there's no mandatory structure, that's legit.

      Of course, that's only valid for this particular census application, which assumes that the only reason for the database is either basic statistics or something complex enough for a MapReduce program.

      It's entirely possible to run Cassandra arranged similar to a normal RDBMS. Use only a few column families with very specific columns (such as a single family for all the "Name, address, etc."). Throw in a bunch of index families, updated with MapReduce. Then, your processing can be a complex MapReduce job, iterating over each row with a particular set of rows meeting all your needed criteria. It'd be just like a normal RDBMS, except you have better scalability, and maintain indexes yourself.

      If the trouble of indexing is too much for you, you can follow Google's route with Colossus, which runs MapReduce-like tasks when rows are changed. That's your dynamic indexing.

      Here's some links to help your understanding:

      --
      You do not have a moral or legal right to do absolutely anything you want.
    10. Re:Typical applications? by Sarten-X · · Score: 3, Informative

      Close. It's more of a hash table of a sorted hash table... Columns are unsorted, but rows are (I think... I've only used HBase personally).

      If you know what you'll be looking for ahead of time, you can make your life easy with a write-heavy system. What's missing in standard Cassandra is a way to run ad-hoc queries. My understanding is that Cassandra can now run with Hadoop's MapReduce framework. Any query or computation can be run against the Cassandra table in a widely-distributed fashion as a MapReduce job. It's not as fast as an SQL query on an indexed column, but far better than a query on an unindexed one, because everything runs in parallel across the cluster.

      --
      You do not have a moral or legal right to do absolutely anything you want.
    11. Re:Typical applications? by AlXtreme · · Score: 3, Insightful

      Dear $DEITY, the number of times I've seen (mostly) PHP crapplications use CREATE DATABASE and CREATE / ALTER TABLE, often with ingenious naming schemes, instead of simply inserting new rows. Certain people shouldn't be allowed to touch databases.

      If anyone needs me I'll be sobbing over my coffee.

      --
      This sig is intentionally left blank
    12. Re:Typical applications? by jellomizer · · Score: 3, Interesting

      I don't think it is a good idea to propose limitation just to stop bad coding practices.

      For 1 the limitations rairly incourage good ones they only make them worse. Eg 254 columns with the 255th pointing to the tablename2 with more data.

      Second by preventing people from doing something stupid they also prevent them from doing something ingenious.

      Third there may be a good reason to do this as well.

      Fourth you make it big enough so you won't need to make it bigger

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    13. Re:Typical applications? by bjourne · · Score: 4, Informative

      Maybe Cassandra should have choosen some other terminology for their database that so obviously doesn't conflict with already existing terms. A column in Cassandra is a tuple which in an RDBMS is a row. Confusion all around.

  2. Why? by Xoc-S · · Score: 3, Insightful
    Only a completely de-normalized flat-file database would need anything like that number of columns. That would mean many duplicate pieces of information, and a complete maintenance nightmare. The only purpose I can see is to have views of existing normalized data for fast searching, but that would be read-only data.

    This is a feature in need of an application and I can see very few applications.

    1. Re:Why? by Jeremi · · Score: 3, Funny

      This is a feature in need of an application and I can see very few applications.

      I think you're right, but as long as we're adding features for the sake of having features... why limit the table to two dimensions? Perhaps the next version of Cassandra can support 3D-data-cubes, with each cell specified via a (row,column,level) triplet. And the version after that will allow hypercubes of data with any number of dimensions (up to 2 billion dimensions maximum, of course).

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
  3. 2 billion columns... by aBaldrich · · Score: 4, Funny

    ought to be enough for everybody

    --
    In soviet russia the government regulates the companies.
  4. This is a triumph for hideously bad schema by Sarusa · · Score: 4, Informative

    Well good on them for solving an interesting technical problem, but the use cases for this are all bad.

    Obvious first use: boss will suggest we optimize the database by using only one gigantic row with two billion columns.

  5. Re:Only 2 billion? by Anonymous Coward · · Score: 5, Funny

    You work for Gillette, don't you.

  6. for those that absolutely positively cannot RTFA by Son+of+Byrne · · Score: 5, Informative

    Cassandra appears to be a multi-dimensional datastore that does not store data in the same fashion as a typical RDBMS. It uses columns and rows both to store sets of data uniquely. If you're familiar with Big Table, then, apparently, its kinda like that.

    That just means that they've added even more storage vectors to it than before...not sure why it made slashdot front page...

    --
    I'd happily pay you Tuesday for a biopsy today!
  7. Re:If you have more than 30 columns by ogrisel · · Score: 5, Informative

    Not with column store databases such as Cassandra, HBase and BigTable.

  8. Cassandra by tverbeek · · Score: 5, Funny

    I predict that bad things will come of this.

    Not that anyone will believe me.

    --
    http://alternatives.rzero.com/
  9. Indexes by Twillerror · · Score: 3, Informative

    Cassandra like many of the "no sql" type databases doesn't have classic indexes.

    So instead of having an index you typically have a separate table that acts as the index.

    Image you have a users table. One of the field is country. Now you want to know all the users for a particular country.

    In standard RDMS type systems you just scan each row or have a index that has done that "ahead of time" or as rows are inserted.

    In Cassandra the rows of users are distributed possibly among 100s of servers. So scanning for all users that have a particular country would require scanning all rows which could a long time.

    Unlike RDMS like system rows don't have a 2d structure and don't have real limitation on the number of columns they can have. And columns can essentially be arrays\rows of objects.

    So as you design/bang out your application you typically realize you need to know "users by country" for some stupid report. So you create a new table to hold these values. This has one row per country. As users are entered you append to this row. This essentially creates an array like structure. You then lookup the row for a particular country and you now know all the users for that particular country.

    Sounds like Cassandra is getting rid of a limitation that could have caused very large index to require multiple rows.

  10. Yes and the funniest thing about all this is by Giant+Electronic+Bra · · Score: 4, Insightful

    That we had all of this stuff 30 years ago. It was called 'network' databases, which were pretty much the standard sort of technology before RDBMS came along and everyone realized how incredibly much better relational algebra was for the vast majority of problems. As with many other things older ideas eventually resurface with new names and a few more features. There are times when this kind of facility is useful. Nothing wrong with it. The vast majority of cases though where I've seen people using something like Cassandra or Big Table were ill advised. A properly optimized RDBMS with correctly designed schema can handle all but a few edge cases. Most of the hype these tools are generating is based on a lack of real understanding of how to properly use databases combined with people believing myths about other technologies and helped along by the industry's short memory span. The best part though is that when something turns into a giant mess guys like me can make nice money fixing the mess. lol.

    --
    "Malo periculosam, libertatem quam quietam servitutem." -- Jefferson
    1. Re:Yes and the funniest thing about all this is by red_blue_yellow · · Score: 3, Informative

      Indeed, and there are edge cases, like Facebook, or Google, or whatever. The edge cases are gigantic databases that are accessed in certain specific way.

      It's true that many people attempt to prematurely optimize by using Cassandra first instead of something they are already familiar with. However, when faced with some of the pains of growing an RDMBS beyond what a single box can handle, it's worth it to consider your other options. Keep in mind that if it's easy to store and make use of a huge pile of data, you're more tempted to gather that data in the first place, where 10 years ago it might have been prohibitively expensive or difficult.

      There are probably less edge cases than actual NoSQL codebases, which is pretty surreal. There are more actual products then the number of people who need the products. And 99.99% of the people playing with them don't need them at all.

      I can assure you that you're incorrect, but since you don't have any data to back this up, I won't bother either.

      The real joke is people using them in ways that are actually slower than any RDBMS, but they think it's 'easier', usually because they never bothered to learn how JOINs work, and don't understand that it's perfectly fine to make a dozen SQL queries on a web page...that's what indexes are for.

      Yes, only knuckle-dragging imbeciles are interested in new systems... *sigh*. This is an often-touted piece of flamebait that has little basis in reality. Some of the largest Cassandra users are companies who already have extensive experience scaling MySQL and other RDMBS.

      While some might find that document stores like MongoDB are "easier" and use it for that reason, Cassandra has a reputation for being difficult to get started with; the reason it gets used nevertheless is because the benefits outweigh the steep learning curve.

      --
      A neutral communications medium is essential. It is the basis of science, by which humankind should decide what is true.
  11. Re:Only 2 billion? by zach_the_lizard · · Score: 4, Funny

    He doesn't, otherwise it'd be uint64_t and a lather strip!

    --
    SSC
  12. And Oracle supports EXABYTE sized databases by dirkdodgers · · Score: 3, Interesting

    So I can appreciate that this announcement sounds like News for Nerds, but can someone why it Matters that Cassandra can support 2 billion columns?

    The article basically says "because you can't execute SQL you need lots of columns". OK, great, why would I want that? The article doesn't tell me. The Cassandra website sure doesn't tell me.

    Oracle 11 supports up to 8 fucking EXABYTES of data in an RDBMS that I can execute SQL against. What Cassandra puts in columns, I put in rows.

    I've scoured this thread like all the other ones on Cassandra for the killer feature, for the "you can do this with Cassandra that you can't do as well with an RDBMS" and I can't find it.

    The best I can come up with is "I want to store lots of indexed data, I don't care about transactional integrity, and I don't want to pay Oracle". Is that it? That's fine if it's it, Oracle doesn't come cheap and that can be a deal breaker for new companies, but I just wish someone would spell out that this is the justification for Cassandra's existence.

    1. Re:And Oracle supports EXABYTE sized databases by DavidTC · · Score: 4, Interesting

      NoSQL stuff is useful in weird extreme fringe cases, where you need to access data in essentially random ways. Digg, Facebook, and Google all NoSQL databases, and I think the first two use Cassandra.

      Specifically, you kinda make your own rows. It's like having permanent multiple JOINs that you can access instantly, from what I understand. (This is what this article is talking about, it's now unlimited.)

      Essentially, it's a giant blob of data that exists, and you draw lines on it in advance that are your results, and you can get those result instantly, at the cost of being unable to decide to get other results in real time.

      Many of the products let you have them on different servers, so you can have a 'people who have voted for this Digg' table or something, on the server that handles that thing.

      I'm not entirely sure how it works, but that's basically it. Oh, and the fact they talk about 'columns' and 'rows' is just utter stupidity in naming to confuse everyone. Basically, they simply tend to keep each column as a file, which allows them to do what I mentioned above..copy needed columns, and just needed columns, to other servers.

      It's really weird, and, like I said, only relevant for giant giant databases. There's no way that google could do a full text search on a RDBMS, regardless if it fits in Oracle. What it can do is make a 'column' for each word, and a 'row' for each URL, put different columns on different servers, and that actually works in the non-relational database they use, when there's no way in hell that would work on a RDBMS.

      However, more importantly for slashdot, a fuckload of fools think that SQL is somehow 'retarded' and that NoSQL is 'awesome, dude', so they like to play with it, usually by spewing out some crap PHP or Perl or something that works about a tenth as well as just using an RDBMS would work. If they actually understood how to use an RDBMS, that is.

      --
      If corporations are people, aren't stockholders guilty of slavery?