Is it possible to have a Cassandra table that is not replicated?

There is one specific table in the system in which I really want to remain unique based on each server.

i.e. http://server1.example.com/some_stuff.html and http://server2.example.com/some_stuff.html should store and display data unique to this particular server. If one of the servers dies, this table and its data go with it.

+4
source share
2 answers

I think that CQL does not support replication factors at the table level (see create table parameters ). One option is to create a key space with a replication ratio = 1:

CREATE KEYSPACE <ksname> WITH replication = {'class':'<strategy>' [,'<option>':<val>]}; Example: To create a keyspace with SimpleStrategy and "replication_factor" option with a value of "1" you would use this statement: CREATE KEYSPACE <ksname> WITH replication = {'class':'SimpleStrategy', 'replication_factor':1}; 

then all tables created in this key space will not have replication.

If you want to have a table for each node, I think Cassandra does not directly support this. One work task is to launch an additional Cassandra cluster for each node, where each cluster has only one node.

+3
source

I'm not sure why you would like to do this, but here is my example:

The distribution of the actual data between the nodes of your Cassandra cluster is determined by the row key.

Just setting the replication coefficient to 1 will not transfer all the data from the same family / table in column 1 node. The data will still be split / distributed according to your row.

Exactly where your data will be stored is determined by the line key along with the delimiter, as described here . This is an integral part of DDBS, and there is no easy way to force it.

The only way I can present all the data for one server physically in one table on one node is:

+1
source

Source: https://habr.com/ru/post/1496576/


All Articles