Questions tagged [cassandra]

Apache Cassandra is a highly scalable, eventually consistent, distributed, structured row store. Questions about Cassandra server administration should be asked on https://dba.stackexchange.com/questions/tagged/cassandra .

Apache Cassandra is a highly scalable, eventually consistent, distributed, structured row/column store. Cassandra brings together the distributed systems technologies from Dynamo and the data model from Google's . Like , Cassandra is eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based data model richer than typical key/value systems.

Cassandra's Dynamo-based cluster model provides linear scalability and fault tolerance on commodity hardware or cloud infrastructure. Its support for replicating across multiple data centers is best-in-class, providing low latency and the ability to survive entire data center outages.

Cassandra's data model offers the convenience of column indexes with the performance of log-structured updates and powerful built-in caching with the fastest write performance as compared to other database solutions and makes it a compelling option for big data processing. It provides linear scalability with the provision to add/remove nodes on the fly without downtime.

Cassandra was open-sourced by Facebook in 2008 and quickly became a top-level Apache project. Today, it's widely used by companies in many markets.

Official links:

Documentation

Useful Links:

20596 questions
80
votes
1 answer

Explain Merkle Trees for use in Eventual Consistency

Merkle Trees are used as an anti-entropy mechanism in several distributed, replicated key/value stores: Dynamo Riak Cassandra No doubt an anti-entropy mechanism is A Good Thing - transient failures just happen, in production. I'm just not sure I…
Johnny Graettinger
  • 1,078
  • 1
  • 8
  • 7
80
votes
2 answers

What is the difference between Cassandra and CouchDB?

I'm looking at both projects and I can't really see the difference from Cassandra Site: Cassandra is a highly scalable, eventually consistent, distributed, structured key-value store...Cassandra is eventually consistent. Like BigTable, Cassandra…
Gabriel Sosa
  • 7,897
  • 4
  • 38
  • 48
79
votes
4 answers

How to run shell script file using nodejs?

I need to run a shell script file using nodeJS that executes a set of Cassandra DB commands. Can anybody please help me on this. inside db.sh file: create keyspace dummy with replication = {'class':'SimpleStrategy','replication_factor':3} create…
programoholic
  • 4,830
  • 5
  • 20
  • 59
75
votes
8 answers

What should I choose: MongoDB/Cassandra/Redis/CouchDB?

We're developing a really big project and I was wondering if anyone can give me some advice about what DB backend should we pick. Our system is compound by 1100 electronic devices that send a signal to a central server and then the server stores the…
Juanda
  • 1,648
  • 1
  • 20
  • 29
74
votes
5 answers

Cassandra: text vs varchar

Does anyone know the difference between the two CQL data types text and varchar in Cassandra? The Cassandra documentation describes both types as "UTF-8 encoded string" and nothing more.
darcyy
  • 5,236
  • 5
  • 28
  • 41
71
votes
5 answers

How to query JSON data column using Spark DataFrames?

I have a Cassandra table that for simplicity looks something like: key: text jsonData: text blobData: blob I can create a basic data frame for this using spark and the spark-cassandra-connector using: val df = sqlContext.read …
70
votes
22 answers

Cassandra cqlsh - connection refused

I've just started working with Cassandra (datastax), version 2.1.3 and cqlsh version 5.0.1. Cassandra starts up fine and the cluster is operational instantly. Cqlsh is not working (on any of the nodes) and emits the following error: Connection…
Chros
  • 701
  • 1
  • 5
  • 4
70
votes
2 answers

what is the recommend cassandra gui client for cassandra-1.1.2

I'm looking for some gui client for cassandra (like sqlDeveloper) to invoke some basic methods, and run cql queries
Julias
  • 5,752
  • 17
  • 59
  • 84
66
votes
11 answers

How to obtain number of rows in Cassandra table

This is a super basic question but it's actually been bugging me for days. Is there a good way to obtain the equivalent of a COUNT(*) of a given table in Cassandra? I will be moving several hundreds of millions of rows into C* for some load testing…
Evan Volgas
  • 2,900
  • 3
  • 19
  • 30
66
votes
2 answers

Understand cassandra replication factor versus consistency level

I want to clarify very basic concept of replication factor and consistency level in Cassandra. Highly appreciate if someone can provide answer to below questions. RF- Replication Factor RC- Read Consistency WC- Write Consistency 2 cassandra nodes…
Indika Sampath
  • 1,065
  • 2
  • 12
  • 21
65
votes
4 answers

How to run cql files (.cql) from within cqlsh?

The problem that I am having is that I want to run the following command (and I can't): cqlsh < cql_directory/cql_create_stuff.cql Because I have not logged in to cqlsh. So I logged in: cqlsh -u 'my_username' -p 'my_super_secret_password' and now…
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
65
votes
3 answers

How to get current timestamp with CQL while using Command Line?

I am trying to insert into my CQL table from the command line. I am able to insert everything. But I am wondering if I have a timestamp column, then how can I insert into timestamp column from the command line? Basically, I want to insert current…
user2467545
64
votes
5 answers

What's The Best Practice In Designing A Cassandra Data Model?

And what are the pitfalls to avoid? Are there any deal breaks for you? E.g., I've heard that exporting/importing the Cassandra data is very difficult, making me wonder if that's going to hinder syncing production data to development…
Jerry
  • 2,497
  • 4
  • 22
  • 31
63
votes
3 answers

Cassandra UUID vs TimeUUID benefits and disadvantages

Given that TimeUUID handily allows you to use now() in CQL, are there any reasons you wouldn't just go ahead and always use TimeUUID instead of plain old UUID?
Jay
  • 19,649
  • 38
  • 121
  • 184
62
votes
15 answers

Export cassandra query result to a csv file

I'm new in cassandra, and I have to export the result of a specific query to a csv file. I found the COPY command, but (from what I understand) it allows you only to copy an already existing table to a csv file, and what I want is to copy directly…
Dady09
  • 649
  • 2
  • 7
  • 10