If Dynamic columns are discouraged in cassandra 1.2/Cql3 , then how is it better than Mysql in functionality?
Asked Answered
A

3

10

Initially I started learning Cassandra because dynamic columns caught my attention. As I started learning more, I learnt that composite primary keys are preferred to dynamic columns and Cassandra is moving to schema based (Schema is optional and not compulsory but recommended). In cql3, it is compulsory though and I read cql3 is best approach for new applications in cassandra.

Here is where I face an interesting question. I was reading a particular slide (Mysql vs Casssandra) - http://lanyrd.com/2012/austin-mysql-meetup-january/spdrx/ (Jump to 31 slide) where it discusses about fraud detection use case.

"In FraudDetection To calculate risk, it is common to need to know all the emails,destinations,origins,devices,locations,phonenumbers,etcetera ever used for the account in question. "

It was explained how we have to maintain individual table for emails, destinations , origins etc in relational world and how easy it is to be in cassandra world with dynamic column key and values. (31- 34 slides).

Now that dynamic column keys and values and discouraged, how can we solve this problem ? Should we maintain individual column families for each emails, destinations etc ? Then how is it different from relational world ? Is it only about scalability ? Can we still go ahead with schema less approach ? Is this the golden rule "Schema is optional and recommended but not mandatory?"

Thanks

Albumenize answered 14/3, 2013 at 8:23 Comment(0)
A
8

Sorry for the confusion here. As it turned out , I didn't understand the basic concepts properly. Here is the answer

Dynamic columns are core of Cassandra. They are still supported and is still the core :) Its just that in thrift you do directly and in CQL you do in a different manner(through schema way). But still you do it :) - Read this - http://www.datastax.com/dev/blog/thrift-to-cql3

And regarding how Cassandra is better than Mysql - read this http://lanyrd.com/2012/austin-mysql-meetup-january/spdrx/ (16-24 slides)

Thanks :)

Albumenize answered 16/3, 2013 at 19:58 Comment(0)
K
2

You can still use a schema-less approach if you use the Thrift API instead of CQL. As a long-time Cassandra user, I also find the push toward upfront schema definition to be questionable. But fortunately the underlying storage mechanism is the same, and all clients that I'm aware of support using Thrift-based calls.

Knew answered 14/3, 2013 at 15:39 Comment(1)
This is old advice. See this for details on how to transition to CQL.Knew
G
2

Instead dynamic columns, there are supporting collection stuffs like Sets, Lists, Maps. Isn't it enough for dynamicity

Gianina answered 21/3, 2013 at 5:58 Comment(1)
But they cannot be indexed at the moment and so we cannot query on them. They will be added in future though.Albumenize

© 2022 - 2024 — McMap. All rights reserved.