You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "Sloot, Hans-Peter" <ha...@atos.net> on 2013/02/27 19:01:24 UTC

data model advice needed

Hi,

I would like to get some advice on how to model columnfamilies for storing log of firewalls.
The columns are listed further below.
All the possibilities confuse me a bit (super columns, secondary indexes etc).

My main question is how can I create the columnfamily in order to be able to get slices of data by the timestamp column combined with
getting this data for a specific host or some other column

In sql this would be select * from traffic where ts between ... and .. and host = ' xxx' and source_ip = 'xx.xx.xx.xx'  and severity = 'xx'

Probably any combination can be usefull (the slice/between and host probably the most important.

Hopefully someone can shed some light.

Regards Hans-Peter

CREATE COLUMNFAMILY traffic
  (key uuid primary key,
        host varchar,
        facility varchar,
        priority varchar,
        severity varchar,
        tag varchar,
        ts  timestamp,
        program varchar,
        msg varchar,
        protocol varchar,
        policy varchar,
        sourcezone varchar,
        sourceip varchar,
        destzone varchar,
        destip varchar,
        destport varchar
     );





Dit bericht is vertrouwelijk en kan geheime informatie bevatten enkel bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen. Aangezien de integriteit van het bericht niet veilig gesteld is middels verzending via internet, kan Atos Nederland B.V. niet aansprakelijk worden gehouden voor de inhoud daarvan. Hoewel wij ons inspannen een virusvrij netwerk te hanteren, geven wij geen enkele garantie dat dit bericht virusvrij is, noch aanvaarden wij enige aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit bericht. Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten waaronder Atos Nederland B.V. goederen en/of diensten levert zijn met uitsluiting van alle andere voorwaarden de Leveringsvoorwaarden van Atos Nederland B.V. van toepassing. Deze worden u op aanvraag direct kosteloos toegezonden.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Nederland B.V. group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. On all offers and agreements under which Atos Nederland B.V. supplies goods and/or services of whatever nature, the Terms of Delivery from Atos Nederland B.V. exclusively apply. The Terms of Delivery shall be promptly submitted to you on your request.

Atos Nederland B.V. / Utrecht
KvK Utrecht 30132762

Re: data model advice needed

Posted by Michal Michalski <mi...@opera.com>.
I can't suggest you any book, but you might be interested in this:

http://www.ebaytechblog.com/2012/07/16/cassandra-data-modeling-best-practices-part-1/
http://www.ebaytechblog.com/2012/08/14/cassandra-data-modeling-best-practices-part-2/

M.

W dniu 28.02.2013 08:44, Sloot, Hans-Peter pisze:
> What would be the best book to read about data modeling in Cassandra?
> I have ‘Cassandra the definitive guide’ but that is relatively old and has only a very limited example of how to
> design a model.
>
> Hans-Peter
>
>
> From: kadey@comcast.net [mailto:kadey@comcast.net]
> Sent: woensdag 27 februari 2013 19:12
> To: user@cassandra.apache.org
> Subject: Re: data model advice needed
>
> One possibility would be to use dynamic columns, with each column name being a composite made from a timestamp, and the value of each containing serialized json of the details. The host could be the key. Then you could slice the data by column name.
>
> Ken....
>
> ________________________________
> From: "Hans-Peter Sloot" <ha...@atos.net>>
> To: user@cassandra.apache.org<ma...@cassandra.apache.org>
> Sent: Wednesday, February 27, 2013 1:01:24 PM
> Subject: data model advice needed
>
> Hi,
>
> I would like to get some advice on how to model columnfamilies for storing log of firewalls.
> The columns are listed further below.
> All the possibilities confuse me a bit (super columns, secondary indexes etc).
>
> My main question is how can I create the columnfamily in order to be able to get slices of data by the timestamp column combined with
> getting this data for a specific host or some other column
>
> In sql this would be select * from traffic where ts between ... and .. and host = ' xxx' and source_ip = 'xx.xx.xx.xx'  and severity = 'xx'
>
> Probably any combination can be usefull (the slice/between and host probably the most important.
>
> Hopefully someone can shed some light.
>
> Regards Hans-Peter
>
> CREATE COLUMNFAMILY traffic
>    (key uuid primary key,
>          host varchar,
>          facility varchar,
>          priority varchar,
>          severity varchar,
>          tag varchar,
>          ts  timestamp,
>          program varchar,
>          msg varchar,
>          protocol varchar,
>          policy varchar,
>          sourcezone varchar,
>          sourceip varchar,
>          destzone varchar,
>          destip varchar,
>          destport varchar
>       );
>
>
>
>
>
> Dit bericht is vertrouwelijk en kan geheime informatie bevatten enkel bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen. Aangezien de integriteit van het bericht niet veilig gesteld is middels verzending via internet, kan Atos Nederland B.V. niet aansprakelijk worden gehouden voor de inhoud daarvan. Hoewel wij ons inspannen een virusvrij netwerk te hanteren, geven wij geen enkele garantie dat dit bericht virusvrij is, noch aanvaarden wij enige aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit bericht. Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten waaronder Atos Nederland B.V. goederen en/of diensten levert zijn met uitsluiting van alle andere voorwaarden de Leveringsvoorwaarden van Atos Nederland B.V. van toepassing. Deze worden u op aanvraag direct kosteloos toegezonden.
>
> This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Nederland B.V. group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. On all offers and agreements under which Atos Nederland B.V. supplies goods and/or services of whatever nature, the Terms of Delivery from Atos Nederland B.V. exclusively apply. The Terms of Delivery shall be promptly submitted to you on your request.
>
> Atos Nederland B.V. / Utrecht
> KvK Utrecht 30132762
>
>
>
>
>
> Dit bericht is vertrouwelijk en kan geheime informatie bevatten enkel bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen. Aangezien de integriteit van het bericht niet veilig gesteld is middels verzending via internet, kan Atos Nederland B.V. niet aansprakelijk worden gehouden voor de inhoud daarvan. Hoewel wij ons inspannen een virusvrij netwerk te hanteren, geven wij geen enkele garantie dat dit bericht virusvrij is, noch aanvaarden wij enige aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit bericht. Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten waaronder Atos Nederland B.V. goederen en/of diensten levert zijn met uitsluiting van alle andere voorwaarden de Leveringsvoorwaarden van Atos Nederland B.V. van toepassing. Deze worden u op aanvraag direct kosteloos toegezonden.
>
> This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Nederland B.V. group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. On all offers and agreements under which Atos Nederland B.V. supplies goods and/or services of whatever nature, the Terms of Delivery from Atos Nederland B.V. exclusively apply. The Terms of Delivery shall be promptly submitted to you on your request.
>
> Atos Nederland B.V. / Utrecht
> KvK Utrecht 30132762
>


RE: data model advice needed

Posted by "Sloot, Hans-Peter" <ha...@atos.net>.
What would be the best book to read about data modeling in Cassandra?
I have ‘Cassandra the definitive guide’ but that is relatively old and has only a very limited example of how to
design a model.

Hans-Peter


From: kadey@comcast.net [mailto:kadey@comcast.net]
Sent: woensdag 27 februari 2013 19:12
To: user@cassandra.apache.org
Subject: Re: data model advice needed

One possibility would be to use dynamic columns, with each column name being a composite made from a timestamp, and the value of each containing serialized json of the details. The host could be the key. Then you could slice the data by column name.

Ken....

________________________________
From: "Hans-Peter Sloot" <ha...@atos.net>>
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Sent: Wednesday, February 27, 2013 1:01:24 PM
Subject: data model advice needed

Hi,

I would like to get some advice on how to model columnfamilies for storing log of firewalls.
The columns are listed further below.
All the possibilities confuse me a bit (super columns, secondary indexes etc).

My main question is how can I create the columnfamily in order to be able to get slices of data by the timestamp column combined with
getting this data for a specific host or some other column

In sql this would be select * from traffic where ts between ... and .. and host = ' xxx' and source_ip = 'xx.xx.xx.xx'  and severity = 'xx'

Probably any combination can be usefull (the slice/between and host probably the most important.

Hopefully someone can shed some light.

Regards Hans-Peter

CREATE COLUMNFAMILY traffic
  (key uuid primary key,
        host varchar,
        facility varchar,
        priority varchar,
        severity varchar,
        tag varchar,
        ts  timestamp,
        program varchar,
        msg varchar,
        protocol varchar,
        policy varchar,
        sourcezone varchar,
        sourceip varchar,
        destzone varchar,
        destip varchar,
        destport varchar
     );





Dit bericht is vertrouwelijk en kan geheime informatie bevatten enkel bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen. Aangezien de integriteit van het bericht niet veilig gesteld is middels verzending via internet, kan Atos Nederland B.V. niet aansprakelijk worden gehouden voor de inhoud daarvan. Hoewel wij ons inspannen een virusvrij netwerk te hanteren, geven wij geen enkele garantie dat dit bericht virusvrij is, noch aanvaarden wij enige aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit bericht. Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten waaronder Atos Nederland B.V. goederen en/of diensten levert zijn met uitsluiting van alle andere voorwaarden de Leveringsvoorwaarden van Atos Nederland B.V. van toepassing. Deze worden u op aanvraag direct kosteloos toegezonden.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Nederland B.V. group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. On all offers and agreements under which Atos Nederland B.V. supplies goods and/or services of whatever nature, the Terms of Delivery from Atos Nederland B.V. exclusively apply. The Terms of Delivery shall be promptly submitted to you on your request.

Atos Nederland B.V. / Utrecht
KvK Utrecht 30132762





Dit bericht is vertrouwelijk en kan geheime informatie bevatten enkel bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen. Aangezien de integriteit van het bericht niet veilig gesteld is middels verzending via internet, kan Atos Nederland B.V. niet aansprakelijk worden gehouden voor de inhoud daarvan. Hoewel wij ons inspannen een virusvrij netwerk te hanteren, geven wij geen enkele garantie dat dit bericht virusvrij is, noch aanvaarden wij enige aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit bericht. Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten waaronder Atos Nederland B.V. goederen en/of diensten levert zijn met uitsluiting van alle andere voorwaarden de Leveringsvoorwaarden van Atos Nederland B.V. van toepassing. Deze worden u op aanvraag direct kosteloos toegezonden.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Nederland B.V. group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. On all offers and agreements under which Atos Nederland B.V. supplies goods and/or services of whatever nature, the Terms of Delivery from Atos Nederland B.V. exclusively apply. The Terms of Delivery shall be promptly submitted to you on your request.

Atos Nederland B.V. / Utrecht
KvK Utrecht 30132762

Re: data model advice needed

Posted by "Hiller, Dean" <De...@nrel.gov>.
There are many different patterns in noSQL with 90% being different than
an RDBMS.  Check out this page for some things to get you thinking

http://buffalosw.com/wiki/Patterns-Page/


If you ever consider playorm and you can figure out how to partition your
data(perhaps by month), you can do queries into the partitions very easily
on any of your data.  The issue is though if you design wrong, you may
have to query multiple partitions.  You can do stuff like that with or
without playorm. Playorm just does some heavy lifting to make your life
easier in some cases.

Later,
Dean

On 2/27/13 11:01 AM, "Sloot, Hans-Peter" <ha...@atos.net> wrote:

>Hi,
>
>I would like to get some advice on how to model columnfamilies for
>storing log of firewalls.
>The columns are listed further below.
>All the possibilities confuse me a bit (super columns, secondary indexes
>etc).
>
>My main question is how can I create the columnfamily in order to be able
>to get slices of data by the timestamp column combined with
>getting this data for a specific host or some other column
>
>In sql this would be select * from traffic where ts between ... and ..
>and host = ' xxx' and source_ip = 'xx.xx.xx.xx'  and severity = 'xx'
>
>Probably any combination can be usefull (the slice/between and host
>probably the most important.
>
>Hopefully someone can shed some light.
>
>Regards Hans-Peter
>
>CREATE COLUMNFAMILY traffic
>  (key uuid primary key,
>        host varchar,
>        facility varchar,
>        priority varchar,
>        severity varchar,
>        tag varchar,
>        ts  timestamp,
>        program varchar,
>        msg varchar,
>        protocol varchar,
>        policy varchar,
>        sourcezone varchar,
>        sourceip varchar,
>        destzone varchar,
>        destip varchar,
>        destport varchar
>     );
>
>
>
>
>
>Dit bericht is vertrouwelijk en kan geheime informatie bevatten enkel
>bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd,
>verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te
>vernietigen. Aangezien de integriteit van het bericht niet veilig gesteld
>is middels verzending via internet, kan Atos Nederland B.V. niet
>aansprakelijk worden gehouden voor de inhoud daarvan. Hoewel wij ons
>inspannen een virusvrij netwerk te hanteren, geven wij geen enkele
>garantie dat dit bericht virusvrij is, noch aanvaarden wij enige
>aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit
>bericht. Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten
>waaronder Atos Nederland B.V. goederen en/of diensten levert zijn met
>uitsluiting van alle andere voorwaarden de Leveringsvoorwaarden van Atos
>Nederland B.V. van toepassing. Deze worden u op aanvraag direct kosteloos
>toegezonden.
>
>This e-mail and the documents attached are confidential and intended
>solely for the addressee; it may also be privileged. If you receive this
>e-mail in error, please notify the sender immediately and destroy it. As
>its integrity cannot be secured on the Internet, the Atos Nederland B.V.
>group liability cannot be triggered for the message content. Although the
>sender endeavours to maintain a computer virus-free network, the sender
>does not warrant that this transmission is virus-free and will not be
>liable for any damages resulting from any virus transmitted. On all
>offers and agreements under which Atos Nederland B.V. supplies goods
>and/or services of whatever nature, the Terms of Delivery from Atos
>Nederland B.V. exclusively apply. The Terms of Delivery shall be promptly
>submitted to you on your request.
>
>Atos Nederland B.V. / Utrecht
>KvK Utrecht 30132762


Re: data model advice needed

Posted by ka...@comcast.net.
One possibility would be to use dynamic columns, with each column name being a composite made from a timestamp, and the value of each containing serialized json of the details. The host could be the key. Then you could slice the data by column name. 




Ken.... 
----- Original Message -----
From: "Hans-Peter Sloot" <ha...@atos.net> 
To: user@cassandra.apache.org 
Sent: Wednesday, February 27, 2013 1:01:24 PM 
Subject: data model advice needed 

Hi, 

I would like to get some advice on how to model columnfamilies for storing log of firewalls. 
The columns are listed further below. 
All the possibilities confuse me a bit (super columns, secondary indexes etc). 

My main question is how can I create the columnfamily in order to be able to get slices of data by the timestamp column combined with 
getting this data for a specific host or some other column 

In sql this would be select * from traffic where ts between ... and .. and host = ' xxx' and source_ip = 'xx.xx.xx.xx' and severity = 'xx' 

Probably any combination can be usefull (the slice/between and host probably the most important. 

Hopefully someone can shed some light. 

Regards Hans-Peter 

CREATE COLUMNFAMILY traffic 
(key uuid primary key, 
host varchar, 
facility varchar, 
priority varchar, 
severity varchar, 
tag varchar, 
ts timestamp, 
program varchar, 
msg varchar, 
protocol varchar, 
policy varchar, 
sourcezone varchar, 
sourceip varchar, 
destzone varchar, 
destip varchar, 
destport varchar 
); 





Dit bericht is vertrouwelijk en kan geheime informatie bevatten enkel bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen. Aangezien de integriteit van het bericht niet veilig gesteld is middels verzending via internet, kan Atos Nederland B.V. niet aansprakelijk worden gehouden voor de inhoud daarvan. Hoewel wij ons inspannen een virusvrij netwerk te hanteren, geven wij geen enkele garantie dat dit bericht virusvrij is, noch aanvaarden wij enige aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit bericht. Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten waaronder Atos Nederland B.V. goederen en/of diensten levert zijn met uitsluiting van alle andere voorwaarden de Leveringsvoorwaarden van Atos Nederland B.V. van toepassing. Deze worden u op aanvraag direct kosteloos toegezonden. 

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Nederland B.V. group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. On all offers and agreements under which Atos Nederland B.V. supplies goods and/or services of whatever nature, the Terms of Delivery from Atos Nederland B.V. exclusively apply. The Terms of Delivery shall be promptly submitted to you on your request. 

Atos Nederland B.V. / Utrecht 
KvK Utrecht 30132762