Do tables partitions ("low level rows") in Cassandra?

Let's say I have two tables (column families) defined via CQL.

CREATE TABLE a (
    pk    uuid,
    cka   int,
    val   text,
    PRIMARY KEY (pk, cka)
);

CREATE TABLE b (
    pk    uuid,
    ckb   text,
    val1  boolean,
    val2  decimal,
    PRIMARY KEY (pk, ckb)
);

      

If I now insert a row into each table with the same section key:

INSERT INTO a (pk, cka, val)
     VALUES ('f47ac10b-58cc-4372-a567-0e02b2a3d379', 5, 'hi');

INSERT INTO b (pk, ckb, val1, val2)
     VALUES ('f47ac10b-58cc-4372-a567-0e02b2a3d379', 'x', 'hello', 'hey');

      

Will there be 1 or 2 rows now at the storage level?

+3


source to share


1 answer


There will be 2.

Data in Cassandra is written to "memtables" and then dumped to "SSTables" on disk. Both memtables and SSTables are supported on a per-column basis, so rows in different column families (tables) will always create separate rows at the storage level.



See http://www.datastax.com/docs/1.1/dml/about_writes

Cassandra's entry is first written to the commit log (for durability) and then to an in-memory table structure called memtable. The write is successful after it is written to the commit log and memory, so there is very minimal disk I / O at the time of writing. Writes are written to memory and periodically written to disk in a persistent table structure called SSTable (sorted string table). Memtables and SSTables are supported for each column family. Memtables are organized into row sorted key and blushed on SSTables sequentially (no random lookup like in relational databases).

+3


source







All Articles