转载:cassandra读写性能原理分析

转载:cassandra读写性能原理分析

分类: 互联网 | 标签:  cassandra    读    写    性能    原理  
2010-03-31 23:06阅读( 2643) 评论(0)

   

1.  关于cassandra的读性能分析的一篇文章:

     Mike Perham  continues his series now explaining: “reads and […] why they are slow”.

So what happens with a Cassandra read?

  • a client makes a read request to a random node
  • the node acts as a proxy determining the nodes having copies of data
  • the node request the corresponding data from each node
  • the client can select the strength of the read consistency:
    • single read => the request returns once it gets the first response, but data can be stale
    • quorum read => the request returns only after the majority responded with the same value

Mark mentions a couple of corner cases related to this behavior that is more complicated.

  • the node also performs read repair of any inconsistent response
  • each node reading data uses either Memtable (in-memory) or SSTables (disk)

Mike and Jonathan provide a very detailed explanation of the read performance:

Mike: To scan the SSTable, Cassandra uses a row-level column index and bloom filter to find the necessary blocks on disk, deserializes them and determines the actual data to return. There’s a lot of disk IO here which ultimately makes the read latency higher than a similar DBMS.

Jonathan: The reason uncached reads are slower in Cassandra is not because the SSTable is inherently io-intensive (it’s actually better than b-tree based storage on a 1:1 basis) but because in the average case you’ll have to merge row fragments from 2-4 SSTables to complete the request, since SSTables are not update-in-place.

It is also important to note that Cassandra employs row caching that addresses reads latency.

 

2.  关于cassandra的写性能分析的一篇文章:

An interesting explanation of how Cassandra write ops are happening:

  • client submits its write request to a single, random Cassandra node
  • the node behavior is similar to a proxy writing data to the cluster
  • writes are replicated to N nodes according to the  (the details of RackAwareStrategy are quite interesting)
  • each of the N nodes performs 2 actions when receiving a write (in the form of RowMutation):
    • append the mutation to the commit log for transactional purposes
    • update an in-memory Memtable structure with the change

There are also a couple of asynchronous operations:

  • Memtable is written to disk in a structure called SSTable
  • SSTables corresponding to a  are merged into a raw ColumnFamily datafile.

参考文档:

 http://nosql.mypopescu.com/post/474623402/cassandra-reads-performance-explained

 http://nosql.mypopescu.com/post/454521259/cassandra-write-operation-performance-explained 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值