Cassandra | Data story

Cassandra 1.1.11 has been released1

http://cassandra.apache.org/download/

This is a maintenance/bug fix release[1] on the 1.1 series. As always,
please pay careful attention to the release notes[2] and Let us know[3]
right away if have any problems.

[1]: http://goo.gl/QfZlg (CHANGES.txt)
[2]: http://goo.gl/O55QF (NEWS.txt)
[3]: https://issues.apache.org/jira/browse/CASSANDRA
[4]: http://goo.gl/KbiRm (CHEC)

Most popular data management systems1

According to the DB-Engine ranking dsds

 

April 2013
Rank Last Month DBMS Database Model Score Changes
1. 1. Oracle  Relational DBMS 1560.59 +27.20
2. 3. MySQL  Relational DBMS 1342.45 +47.24
3. 2. Microsoft SQL Server  Relational DBMS 1278.15 -40.21
4. 4. PostgreSQL  Relational DBMS 174.09 -3.07
5. 5. Microsoft Access  Relational DBMS 161.40 -8.77
6. 6. DB2  Relational DBMS 155.02 -4.31
7. 7. MongoDB  Document store 129.75 +5.52
8. 9. SQLite  Relational DBMS 88.94 +5.68
9. 8. Sybase  Relational DBMS 80.16 -5.25
10. 10. Solr  Search engine 46.15 +2.99
11. Teradata  Relational DBMS 44.93
12. 11. Cassandra  Wide column store 38.57 +2.21
13. 12. Redis  Key-value store 35.58 +3.15
14. 13. Memcached  Key-value store 24.80 -0.17
15. 14. Informix  Relational DBMS 24.00 +0.10
16. 15. HBase  Wide column store 21.84 +1.40
17. 16. CouchDB  Document store 18.72 +0.42
18. 17. Firebird  Relational DBMS 12.24 -1.54
19. Netezza  Relational DBMS 11.14
20. 18. Sphinx  Search engine 9.55 +0.09
21. 19. Neo4j  Graph DBMS 8.34 +0.90
22. 21. Elasticsearch  Search engine 8.31 +1.56
23. 22. Riak  Key-value store 7.20 +1.10

Cassandra 1.1.10 has been released1

 

Download Cassandra 1.1.10 at http://cassandra.apache.org/download

Includes following bugfix:
  • fix saved key cache not loading at startup (CASSANDRA-5166)
  • fix ConcurrentModificationException in getBootstrapSource (CASSANDRA-5170)
  • fix sstable maxtimestamp for row deletes and pre-1.1.1 sstables (CASSANDRA-5153)
  • fix start key/end token validation for wide row iteration (CASSANDRA-5168)
  • add ConfigHelper support for Thrift frame and max message sizes (CASSANDRA-5188)
  • fix nodetool repair not fail on node down (CASSANDRA-5203)
  • always collect tombstone hints (CASSANDRA-5068)
  • Fix thread growth on node removal (CASSANDRA-5175)
  • Fix error when sourcing file in cqlsh (CASSANDRA-5235)
  • Make Ec2Region’s datacenter name configurable (CASSANDRA-5155)

Cassandra performance review1

 

Original article available here

 

Four years ago, well before starting DataStax, I evaluated the then-current crop of distributed databases and explained why I chose Cassandra. In a lot of ways, Cassandra was the least mature of the options, but I chose to take a long view and wanted to work on a project that got the fundamentals right; things like documentation and distributed testscould come later.

 

2012 saw that validated in a big way, as the most comprehensive NoSQL benchmark to date was published at the VLDB conference by researchers at the University of Toronto. They concluded,

In terms of scalability, there is a clear winner throughout our experiments. Cassandra achieves the highest throughput for the maximum number of nodes in all experiments with a linear in- creasing throughput from 1 to 12 nodes.

As a sample, here’s the throughput results from the mixed reads, writes, and (sequential) scans:

I encourage you to take a few minutes to skim the full results.

There are both architectural and implentation reasons for Cassandra’s dominating performance here. Let’s get down into the weeds and see what those are.

Architecture

Cassandra incorporates a number of architectural best practices that affect performance. None are unique to Cassandra, but Cassandra is the only NoSQL system that incorporates all of them.

Fully distributed: Every Cassandra machine handles a proportionate share of every activity in the system. There are no special cases like the HDFS namenode or MongoDB mongos that require special treatment or special hardware to avoid becoming a bottleneck. And with every node the same, Cassandra is far simpler to install and operate, which has long-term implications for troubleshooting.

Log-structured storage engine: A log-structured engine that avoids overwrites to turn updates into sequential i/o is essential both on hard disks (HDD) and solid-state disks (SSD). On HDD, because the seek penalty is so high; on SSD, to avoid write amplification and disk failure. This is why you see mongodb performance go through the floor as the dataset size exceeds RAM.

Tight integration with its storage engine: Voldemort and Riak support pluggable storage engines, which both limits them to a lowest-common-denominator of key/value pairs, and limits the optimizations that can be done with the distributed replication engine.

Locally-managed storage: HBase has an integrated, log-structured storage engine, but relies on HDFS for replication instead of managing storage locally. This means HBase is architecturally incapable of supporting Cassandra-style optimizations like putting the commitlog on a separate disk, or mixing SSD and HDD in a single cluster with appropriate data pinned to each.

Implementation

An architecture is only as good as its implementation. For the first years after Cassandra’s open-sourcing as an Apache project, every release was a learning experience. 0.3, 0.4, 0.5, 0.6, each attracted a new wave of users that exposed some previously unimportant weakness. Today, we estimate there are over a thousand production deployments of Cassandra, the most for any scalable database. Some are listed here. To paraphrase ESR, “With enough eyes, all performance problems are obvious.”

What are some implementation details relevant to performance? Let’s have a look at some of the options.

MongoDB

MongoDB can be a great alternative to MySQL, but it’s not really appropriate for the scale-out applications targeted by Cassandra. Still, as early members of the NoSQL category, the two do draw comparisons.

One important limitation in MongoDB is database-level locking. That is, only one writer may modify a given database at a time. Support for collection-level (a set of documents, analogous to a relational table) locking is planned. With either database- or collection-level locking, other writers or readers are locked out. Even a small number of writes can produce stalls in read performance.

Cassandra uses advanced concurrent structures to provide row-level isolation without locking. Cassandra eveneliminated the need for row-level locks for index updates in the recent 1.2 release.

A more subtle MongoDB limitation is that when adding or updating a field in a document, the entire document must be re-written. If you pre-allocate space for each document, you can avoid the associated fragmentation, but even with pre-allocation updating your document gets slower as it grows.

Cassandra’s storage engine only appends updated data, it never has to re-write or re-read existing data. Thus, updates to a Cassandra row or partition stay fast as your dataset grows.

Riak

Riak presents a document-based data model to the end user, but under the hood it maps everything to a key/value storage API. Thus, like MongoDB, updating any field in a document requires rewriting the whole thing.

However, Riak does emphasize the use of log-structured storage engines. Both the default BitCask backend and LevelDB are log-structured. Riak increasingly emphasizes LevelDB since BitCask does not support scan operations (which are required for indexes), but this brings its own set of problems.

LevelDB is a log-structured storage engine with a different approach to compaction than the one introduced by Bigtable. LevelDB trades more compaction i/o for less i/o at read time, which can be a good tradeoff for many workloads, but not all. Cassandra added support for leveldb-style compaction about a year ago.

LevelDB itself is designed to be an embedded database for the likes of Chrome, and clear growing pains are evident when pressed into service as a multi-user backend for Riak. (A LevelDB configuration for Voldemort also exists.) Basho cites “one stall every 2 hours for 10 to 30 seconds”, “cases that can still cause [compaction] infinite loops,” and no way to create snapshots or backups as of the recently released Riak 1.2.

HBase

HBase’s storage engine is the most similar to Cassandra’s; both drew on Bigtable’s design early on.

But despite a later start, Cassandra’s storage engine is far ahead of HBase’s today, in large part because building on HDFS instead of locally-managed storage makes everything harder for HBase. Cassandra added online snapshotsalmost four years ago; HBase still has a long ways to go.

HDFS also makes SSD support problematic for HBase, which is becoming increasingly relevant as SSD price/performance improves. Cassandra has excellent SSD support and even support for mixed SSD and HDD within the same cluster, with data pinned to the medium that makes the most sense for it.

Other differences that may not show up at benchmark time, but you would definitely notice in production:

HBase can’t delete data during minor compactions — you have to rewrite all the data in a region to reclaim disk space. Cassandra has deleted tombstones during minor compactions for over two years.

While you are running that major compaction, HBase gives you no way to throttle it and limit its impact on your application workload. Cassandra introduced this two years ago and continues to improve it. Dealing with local storage also lets Cassandra avoid polluting the page cache with sequential scans from compaction.

Compaction might seem like bookkeeping details, but it does impact the rest of the system. HBase limits you to two or three column families because of compaction and flushing limitations, forcing you to do sub-optimal things to your data model as a workaround.

Cassandra

I honestly think Cassandra is one to two years ahead of the competition, but I’m under no illusions that Cassandra itself is perfect. We have plenty of improvements to make still; from the recently released Cassandra 1.2 to our ticket backlog, there is no shortage of work to do.

Here are some of the areas I’d like to see Cassandra improve this year:

If working on an industry-leading, open-source database doing cutting edge performance work on the JVM sounds interesting to you, please get in touch.

Cassandra 1.2.1 has been released1

Cassandra 1.2.1 has been released and is available for download http://cassandra.apache.org/download

Changes included in this new version:
  • stream undelivered hints on decommission (CASSANDRA-5128)
  • GossipingPropertyFileSnitch loads saved dc/rack info if needed (CASSANDRA-5133)
  • drain should flush system CFs too (CASSANDRA-4446)
  • add inter_dc_tcp_nodelay setting (CASSANDRA-5148)
  • re-allow wrapping ranges for start_token/end_token range pairing (CASSANDRA-5106)
  • fix validation compaction of empty rows (CASSADRA-5136)
  • nodetool methods to enable/disable hint storage/delivery (CASSANDRA-4750)
  • disallow bloom filter false positive chance of 0 (CASSANDRA-5013)
  • add threadpool size adjustment methods to JMXEnabledThreadPoolExecutor and
  • CompactionManagerMBean (CASSANDRA-5044)
  • fix hinting for dropped local writes (CASSANDRA-4753)
  • off-heap cache doesn’t need mutable column container (CASSANDRA-5057)
  • apply disk_failure_policy to bad disks on initial directory creation(CASSANDRA-4847)
  • Optimize name-based queries to use ArrayBackedSortedColumns (CASSANDRA-5043)
  • Fall back to old manifest if most recent is unparseable (CASSANDRA-5041)
  • pool [Compressed]RandomAccessReader objects on the partitioned read path(CASSANDRA-4942)
  • Add debug logging to list filenames processed by Directories.migrateFilemethod (CASSANDRA-4939)
  • Expose black-listed directories via JMX (CASSANDRA-4848)
  • Log compaction merge counts (CASSANDRA-4894)
  • Minimize byte array allocation by AbstractData{Input,Output} (CASSANDRA-5090)
  • Add SSL support for the binary protocol (CASSANDRA-5031)
  • Allow non-schema system ks modification for shuffle to work (CASSANDRA-5097)
  • cqlsh: Add default limit to SELECT statements (CASSANDRA-4972)
  • cqlsh: fix DESCRIBE for 1.1 cfs in CQL3 (CASSANDRA-5101)
  • Correctly gossip with nodes >= 1.1.7 (CASSANDRA-5102)
  • Ensure CL guarantees on digest mismatch (CASSANDRA-5113)
  • Validate correctly selects on composite partition key (CASSANDRA-5122)
  • Fix exception when adding collection (CASSANDRA-5117)
  • Handle states for non-vnode clusters correctly (CASSANDRA-5127)
  • Refuse unrecognized replication and compaction strategy options (CASSANDRA-4795)
  • Pick the correct value validator in sstable2json for cql3 tables (CASSANDRA-5134)
  • Validate login for describe_keyspace, describe_keyspaces and set_keyspace(CASSANDRA-5144)
  • Fix inserting empty maps (CASSANDRA-5141)
  • Don’t remove tokens from System table for node we know (CASSANDRA-5121)
  • fix streaming progress report for compresed files (CASSANDRA-5130)
  • Coverage analysis for low-CL queries (CASSANDRA-4858)
  • Stop interpreting dates as valid timeUUID value (CASSANDRA-4936)
  • Adds E notation for floating point numbers (CASSANDRA-4927)
  • Detect (and warn) unintentional use of the cql2 thrift methods when cql3 was intended (CASSANDRA-5172)

The infoworld technology of the year 20131

Infoworld just published its Technology of the Year Award winners and some well known NoSQL solution have been rewarded:

  • Apache Hadoop
  • Apache Cassandra
  • Couchbase Server

http://www.infoworld.com/slideshow/80986/infoworlds-2013-technology-of-the-year-award-winners-210419#slide1

NoSQL Benchmark1

There is probably no perfect NoSQL database. Every database has its advantages and disadvantages that become more or less important depending on your preferences and the type of tasks your trying to achieve.

Altoros Systems as performed an independent and interesting benchmark to help you sort out the current prons and crons between different solution including: HBase,Cassandra,Riak and MongoDb

http://www.networkworld.com/cgi-bin/mailto/x.cgi?pagetosend=/news/tech/2012/102212-nosql-263595.html

What makes this research unique?

Often referred to as NoSQL, non-relational databases feature elasticity and scalability in combination with a capability to store big data and work with cloud computing systems, all of which make them extremely popular. NoSQL data management systems are inherently schema-free (with no obsessive complexity and a flexible data model) and eventually consistent (complying with BASE rather than ACID). They have a simple API, serve huge amounts of data and provide high throughput.

In 2012, the number of NoSQL products reached 120-plus and the figure is still growing. That variety makes it difficult to select the best tool for a particular case. Database vendors usually measure productivity of their products with custom hardware and software settings designed to demonstrate the advantages of their solutions. We wanted to do independent and unbiased research to complement the work done by the folks at Yahoo.

Using Amazon virtual machines to ensure verifiable results and research transparency (which also helped minimize errors due to hardware differences), we have analyzed and evaluated the following NoSQL solutions:

● Cassandra, a column family store
● HBase (column-oriented, too)
● MongoDB, a document-oriented database
● Riak, a key-value store

We also tested MySQL Cluster and sharded MySQL, taking them as benchmarks.

After some of the results had been presented to the public, some observers said MongoDB should not be compared to other NoSQL databases because it is more targeted at working with memory directly. We certainly understand this, but the aim of this investigation is to determine the best use cases for different NoSQL products. Therefore, the databases were tested under the same conditions, regardless of their specifics.

Cassandra 1.1.6 has been released3

Cassandra 1.1.6 has been release and can be downloaded here: http://cassandra.apache.org/download

Changes in version 1.1.6:
 * Wait for writes on synchronous read digest mismatch (CASSANDRA-4792)
 * fix commitlog replay for nanotime-infected sstables (CASSANDRA-4782)
 * preflight check ttl for maximum of 20 years (CASSANDRA-4771)
 * (Pig) fix widerow input with single column rows (CASSANDRA-4789)
 * Fix HH to compact with correct gcBefore, which avoids wiping out
   undelivered hints (CASSANDRA-4772)
 * LCS will merge up to 32 L0 sstables as intended (CASSANDRA-4778)
 * NTS will default unconfigured DC replicas to zero (CASSANDRA-4675)
 * use default consistency level in counter validation if none is
   explicitly provide (CASSANDRA-4700)
 * Improve IAuthority interface by introducing fine-grained
   access permissions and grant/revoke commands (CASSANDRA-4490, 4644)
 * fix assumption error in CLI when updating/describing keyspace 
   (CASSANDRA-4322)
 * Adds offline sstablescrub to debian packaging (CASSANDRA-4642)
 * Automatic fixing of overlapping leveled sstables (CASSANDRA-4644)
 * fix error when using ORDER BY with extended selections (CASSANDRA-4689)
 * (CQL3) Fix validation for IN queries for non-PK cols (CASSANDRA-4709)
 * fix re-created keyspace disappering after 1.1.5 upgrade 
   (CASSANDRA-4698, 4752)
 * (CLI) display elapsed time in 2 fraction digits (CASSANDRA-3460)
 * add authentication support to sstableloader (CASSANDRA-4712)
 * Fix CQL3 'is reversed' logic (CASSANDRA-4716, 4759)
 * (CQL3) Don't return ReversedType in result set metadata (CASSANDRA-4717)
 * Backport adding AlterKeyspace statement (CASSANDRA-4611)
 * (CQL3) Correcty accept upper-case data types (CASSANDRA-4770)
 * (cqlsh) Fix table completion for CREATE KEYSPACE (CASSANDRA-4334)
 * Support allow_deletes for Hadoop clusters (CASSANDRA-4499)
 * (cqlsh) Provide consistent ordering for COPY TO and COPY FROM (CASSANDRA-4594)
 * Fix race when setting cql version with thrift sync server (CASSANDRA-4657)
 * (CQL3) Fix start IN queries with ORDER BY (CASSANDRA-4689)
 * (cqlsh) Fix auto completion with fully qualified names (CASSANDRA-4423)
 * (CLI) allow to insert double values (CASSANDRA-4661)
 * (cqlsh) Multi-line support for history buffer (CASSANDRA-4666)
Merged from 1.0:
 * Switch from NBHM to CHM in MessagingService's callback map, which
   prevents OOM in long-running instances (CASSANDRA-4708)

Cassandra 1.0.12 has been released1

Cassandra 1.0.12 has been released introducing the following changes:

  • Switch from NBHM to CHM in MessagingService’s callback map, whichprevents OOM in long-running instances (CASSANDRA-4708)
  • increase Xss to 160k to accomodate latest 1.6 JVMs (CASSANDRA-4602)
  • fix toString of hint destination tokens (CASSANDRA-4568)
  • (Hadoop) fix setting key length for old-style mapred api (CASSANDRA-4534)
  • (Hadoop) fix iterating through a resultset consisting entirely
  • of tombstoned rows (CASSANDRA-4466)
  • Fix multiple values for CurrentLocal NodeID (CASSANDRA-4626)

 

Download http://cassandra.apache.org/download/

Cassandra 1.1.4 has been released1

Cassandra 1.1.4 (maintenance) has been released and can be downloaded here:  http://cassandra.apache.org/download

Bug fixed:

  • fix offline scrub to catch >= out of order rows (CASSANDRA-4411)
  • fix cassandra-env.sh on RHEL and other non-dash-based systems(CASSANDRA-4494)
  • Merged from 1.0, (Hadoop) fix setting key length for old-style mapred api (CASSANDRA-4534)

Follow LuxNoSQL on Twitter
 
Join the LuxNoSQL Community on LinkedIn