cassandra best practise

modeling by query.

secondary index is best on table that has many rows the contain fewer unique values (low cardinality). but,

don‘t index on high-cardinality columns,

don‘t index in table which has a counter column,

don‘t index on a frequently updated or deleted column,

don‘t abuse the index to look for a row in a large partition

primary key 包含rowkeys, clustering columns.

the colustering columns are used to locate a unique record, they are ordered, by default, and have the ability to use the order by clause in the select statements, as well as MIN, MAX, LIMIT

date bucket pattern, partitioning by date in row keys.

range query on partition: 使用token function。

if the primary column contains only one column, the row is skinny row, otherwise, the primary key contains more than one column, it‘s called wide row.

valueless column,即 column value可为null。

时间: 2024-07-28 16:26:36

cassandra best practise的相关文章

cassandra 的一次调试

配置好 cassandra.yaml 之后 ,两台主机竟然不通信: [[email protected]_190 apache-cassandra-2.1.2]# cat conf/cassandra.yaml |grep 172 - seeds: "172.16.1.141,172.16.1.190" listen_address: 172.16.1.190 rpc_address: 172.16.1.190 原来 第二台主机的防火墙一直开着呢, service iptables s

cassandra的schema version, gossip_generation 和host id

这是cassandra里面很重要的三个值; schema version是cassandra cluster里每个node的schema版本,什么叫版本呢?因为cassandra是无中心化的,所以你很难知道所有的node上的schema是否是一致的.你不可能每次把所有的schema都拿了去比较一次.这样很不高效.所以cassandra里就有了schema version这个概念.每次执行DDL操作的时候,都会新生成一个新的schema version, 当这个DDL操作复制到其他node的时候,

Cassandra存储time series类型数据时的内部数据结构?

因为我一直想用Cassandra来存储我们的数字电表中的数据,按照之前的文章(getting-started-time-series-data-modeling)的介绍,Cassandra真的和适合用于存储time series类型的数据,那么我就想要弄清楚,对于下面这张表 CREATE TABLE temperature ( weatherstation_id text, event_time timestamp, temperature text, PRIMARY KEY (weathers

cassandra指定数据库路径

参考 https://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html 我们讨论的是 tarball installation 的方式,即自己下载源码放到指定路径,假设放在 /home/user/cassandra下 这个路径下有bin,data,conf等文件夹 默认情况下,数据sst和log都存放在data目录下. data目录下的data就是sst存放目录,里面根据数

cassandra的源代码的入口

参考 http://ju.outofmemory.cn/entry/115864 cassandra自带服务端,这和leveldb不一样. 入口就从服务端程序说起. 具体的入口程序在  CassandraDaemon 类(路径 org.apache.cassandra.service 下). 这个类有一个函数叫start,这就是入口 在这里可以打印一句话,然后ant编译一下,启动服务,在输出类表里可以找到打印的那句话.

Cassandra 和 Spark 数据处理一窥

关于Linux的学习,请参考书籍<Linux就该这么学> Apache Cassandra数据库近来引起了很多的兴趣,这主要源于现代云端软件对于可用性及性能方面的要求.那么,Apache Cassandra 是什么?它是一种为高可用性及线性可扩展性优化的分布式的联机交易处理 (OLTP) 数据库 具体说到 Cassandra 的用途时,可以想想你希望贴近用户的系统,比如说让我们的用户进行交互的系统.需要保证实时可用的程序等等,如:产品目录,物联网,医疗系统,以及移动应用.对这些程序而言,下线时

Cassandra 总接归纳

清空表里的所有数据 Truncate falcon_gps; TRUNCATE accepts a single argument for the column family name, and permanently removes all data from said column family. 查询Cassandra某表里一空有多少行记录 select count(*) from falcon_gps; 批量导入数据 BEGIN BATCH USING CONSISTENCY QUORU

Cassandra - Non-system keyspaces don&#39;t have the same replication settings, effective ownership information is meaningless

In cassandra 2.1.4, if you run "nodetool status" without any keyspace specified, you will get a Note: ? 1 2 3 4 5 6 7 8 9 $ nodetool status Datacenter: datacenter1 ======================= Status=Up/Down |/ State=Normal/Leaving/Joining/Moving --

cassandra-cli的基本操作——cassandra总结(三)

一.启动cassandra客户端 首先启动cassandra,然后运行bin\cassandra-cli.bat启动客户端,默认hostname为localhost,port为9160 F:\apache-cassandra-2.1.11-bin\bin>cassandra-cli Starting Cassandra Client org.apache.thrift.transport.TTransportException: java.net.ConnectException: Conn e