OpenSource For You

The data model

-

The data model for Cassandra is column- family- based, which resembles the design for relational databases using tables. In this case, however, the data model works in a fundamenta­lly different manner to fixed- size columns. In Cassandra, the database schema is not required to be fixed before the applicatio­n is used— and it can actually be updated on the fly without any problems on the server. In most cases, the client can arbitraril­y determine the number of columns and metadata it wants to store in a particular column family. This results in much more flexibilit­y for the applicatio­n and in rows that vary in size and in the number of columns.

.HysSDFHs DUH usHG WR GHfiQH WhH QDPHsSDFH IRU HDFh DSSOLFDWLR­Q’s FROuPQ IDPLOLHs. +HQFH, WhHsH FDQ EH GHfiQHG RQ D per-applicatio­n basis, or according to any other schema design that is required. Column families can be of two types— static and dynamic. ThH sWDWLF FROuPQ IDPLOy DOORws SUHGHfiQHG columns in which a value may or may not be stored. Dynamic column families, on the other hand, allow the applicatio­n WR GHfiQH FROuPQs whHQHYHU WhHy DUH QHHGHG DFFRUGLQJ WR their usage. While specifying a column, its name, value and timestamp are needed. So basically, a column is the most basic unit in which a piece of informatio­n can be stored. Cassandra also supports structures like super columns and composite columns, which allow for further nesting.

Almost all RDBMS' require you to specify a datatype for each column. Though Cassandra does not have any such sWURQJ UHTuLUHPHQ­Ws, LW DOORws sSHFLfiFDW­LRQ RI FRPSDUDWRU­s and validators, which act like a datatype for the column name and the column’s value, respective­ly. Except for counters, DOPRsW DOO GDWDWySHs OLNH LQWHJHU, flRDW, GRuEOH, WHxW, BRROHDQ, etc, can be used for comparator­s and validators.

Newspapers in English

Newspapers from India