question stringlengths 11 28.2k | answer stringlengths 26 27.7k | tag stringclasses 130
values | question_id int64 935 78.4M | score int64 10 5.49k |
|---|---|---|---|---|
In BigTable/GFS and Cassandra terminology, what is the definition of a SSTable?
| Sorted Strings Table (borrowed from google) is a file of key/value string pairs, sorted by keys
| Cassandra | 2,576,012 | 157 |
I am learning NoSQL and looking at different options for one of my client's requirements. I have gone through various resources before putting up this question (a person with little knowledge in NoSQL)
I need to store data at faster rate and read data.
Fully fail-safe and easily scalable.
Able to search through data... | One of our applications uses data that is stored into both Cassandra and ElasticSearch. We use Cassandra to access those records whenever we can, and have data duplicated into query tables designed to adhere to specific application-side requests. For a more liberal search than our query tables can allow, ElasticSearc... | Cassandra | 27,054,954 | 139 |
I know there are three different, popular types of non-sql databases.
Key/Value: Redis, Tokyo Cabinet, Memcached
ColumnFamily: Cassandra, HBase
Document: MongoDB, CouchDB
I have read long blogs about it without understanding so much.
I know relational databases and get the hang around document-based databases like Mo... | The main differences are the data model and the querying capabilities.
Key-value stores
The first type is very simple and probably doesn't need any further explanation.
Data model: more than key-value stores
Although there is some debate on the correct name for databases such as Cassandra, I'd like to call them column-... | Cassandra | 3,554,169 | 121 |
The three types of NoSQL databases I've read about is key-value, column-oriented, and document-oriented.
Key-value is pretty straight forward - a key with a plain value.
I've seen document-oriented databases described as like key-value, but the value can be a structure, like a JSON object. Each "document" can have all,... | The main difference is that document stores (e.g. MongoDB and CouchDB) allow arbitrarily complex documents, i.e. subdocuments within subdocuments, lists with documents, etc. whereas column stores (e.g. Cassandra and HBase) only allow a fixed format, e.g. strict one-level or two-level dictionaries.
| Cassandra | 7,565,012 | 114 |
When experimenting with Cassandra I've observed that Cassandra listens to the following ports:
TCP *:8080
TCP *:8888
TCP *:57311
TCP *:57312
TCP 127.0.0.1:7000
TCP 127.0.0.1:9160
UDP 127.0.0.1:700
How does Cassandra use each of the ports listed?
| @Schildmeijer is largely right, however port 7001 is still used when using TLS Encrypted Internode communication
So my complete list would be for current versions of Cassandra:
7199 - JMX (was 8080 pre Cassandra 0.8.xx)
7000 - Internode communication (not used if TLS enabled)
7001 - TLS Internode communication (used i... | Cassandra | 2,359,159 | 110 |
Is there a command to all the rows present in a cql table in cassandra like the one in sql?
delete from TABLE
Going by the documentation, I don't find any way to perform delete operation without a where condition.
DELETE col1 FROM SomeTable WHERE userID = 'some_key_value';
| To remove all rows from a CQL Table, you can use the TRUNCATE command:
TRUNCATE keyspace_name.table_name;
Or if you are already using the keyspace that contains your target table:
TRUNCATE table_name;
Important to note, but by default Cassandra creates a snapshot of the table just prior to TRUNCATE. Be sure to clean... | Cassandra | 25,483,308 | 108 |
I am nearly landed at Cassandra after my research on large scale data storage solutions. But its generally said that Hbase is better solution for large scale data processing and analysis.
While both are same key/value storage and both are/can run (Cassandra recently) Hadoop layer then what makes Hadoop a better candid... | As a Cassandra developer, I'm better at answering the other side of the question:
Cassandra scales better. Cassandra is known to scale to over 400 nodes in a cluster; when Facebook deployed Messaging on top of HBase they had to shard it across 100-node HBase sub-clusters.
Cassandra supports hundreds, even thousands of... | Cassandra | 7,237,271 | 87 |
There are many tables in cassandra database, which contain column titled user_id. The values user_id are referred to user stored in table users. As some users are deleted, I would like to delete orphan records in all tables that contain column titled user_id.
Is there a way to list all tables using CassandraSQLContext ... | From cqlsh execute describe tables;
| Cassandra | 38,696,316 | 86 |
Reading several papers and documents on internet, I found many contradictory information about the Cassandra data model. There are many which identify it as a column oriented database, other as a row-oriented and then who define it as a hybrid way of both.
According to what I know about how Cassandra stores file, it us... |
If you take a look at the Readme file at Apache Cassandra git repo, it says that,
Cassandra is a partitioned row store. Rows are organized into tables
with a required primary key.
Partitioning means that Cassandra can distribute your data across
multiple machines in an application-transparent matter. Cassandra will
... | Cassandra | 13,010,225 | 84 |
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 table dummy (userhandle text, email text primary key , name text,profi... | You could use "child process" module of nodejs to execute any shell commands or scripts with in nodejs. Let me show you with an example, I am running a shell script(hi.sh) with in nodejs.
hi.sh
echo "Hi There!"
node_program.js
const { exec } = require('child_process');
var yourscript = exec('sh hi.sh',
(error,... | Cassandra | 44,647,778 | 83 |
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 provides a ColumnFamily-based data model richer than typical key/value sy... | CouchDB is a document store. You put documents (JSON objects) in it and define views (indexes) over them. The objects can be arbitrarily complex with potentially deep structure. Further, they are not constrained to following some consistent schema.
Cassandra is a ragged-table key-value store. It just stores rows, e... | Cassandra | 1,104,624 | 81 |
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 understand why Merkle Trees are the popular approach.
Sending a complet... | Merkle trees limit the amount of data transferred when synchronizing. The general assumptions are:
Network I/O is more expensive than local I/O + computing the hashes.
Transferring the entire sorted key space is more expensive than progressively limiting the comparison over several steps.
The key spaces have fewer dis... | Cassandra | 5,486,304 | 81 |
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.
| text is just an alias for varchar!
The documentation:
Using cql3 - Datastax
CQL commands - Datastax
Documentation on Datatypes in CQL - Datastax
CQL3 Documentation - Apache
EDIT
Here's the link to the C* 1.2 docs. The text vs varchar info is still the same, however this document contains some extra datatypes.
EDIT v2... | Cassandra | 17,530,230 | 74 |
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
.format("org.apache.spark.sql.cassandra")
.options(Map("table" -> "mytable", "keyspace" -... | Spark >= 2.4
If needed, schema can be determined using schema_of_json function (please note that this assumes that an arbitrary row is a valid representative of the schema).
import org.apache.spark.sql.functions.{lit, schema_of_json, from_json}
import collection.JavaConverters._
val schema = schema_of_json(lit(df.sele... | Cassandra | 34,069,282 | 71 |
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 I tried doing the command in cqlsh shell but It just responds with a sy... | Use the SOURCE
http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/source_r.html
You can use -f option as well to execute commands from file
http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/cqlsh.html
| Cassandra | 22,495,409 | 66 |
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 (Ex: A, B) RF=1, RC=ONE, WC=ONE or ANY
can I write data to node A and ... | Short summary: Replication factor describes how many copies of your data exist. Consistency level describes the behavior seen by the client. Perhaps there's a better way to categorize these.
As an example, you can have a replication factor of 2. When you write, two copies will always be stored, assuming enough nodes ar... | Cassandra | 24,587,869 | 66 |
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 and I'd like to at least get a row count on some sample ETL jobs befor... | Yes, you can use COUNT(*). Here's the documentation.
A SELECT expression using COUNT(*) returns the number of rows that matched the query. Alternatively, you can use COUNT(1) to get the same result.
Count the number of rows in the users table:
SELECT COUNT(*) FROM users;
| Cassandra | 26,620,151 | 66 |
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 timestamp whenever I am inserting into my CQL table -
Currently, I am ha... | You can use the timeuuid functions now() and dateof() (or in later versions of Cassandra, toTimestamp()), e.g.,
INSERT INTO TEST (ID, NAME, VALUE, LAST_MODIFIED_DATE)
VALUES ('2', 'elephant', 'SOME_VALUE', dateof(now()));
The now function takes no arguments and generates a new unique timeuuid (at th... | Cassandra | 19,623,432 | 65 |
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?
| UUID and TIMEUUID are stored the same way in Cassandra, and they only really represent two different sorting implementations.
TIMEUUID columns are sorted by their time components first, and then by their raw bytes, whereas UUID columns are sorted by their version first, then if both are version 1 by their time componen... | Cassandra | 17,945,677 | 64 |
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 the stdout of my query to the csv file. is there any way to do it with C... | If you don't mind your data using a pipe ('|') as a delimiter, you can try using the -e flag on cqlsh. The -e flag allows you to send a query to Cassandra from the command prompt, where you could redirect or even perform a grep/awk/whatever on your output.
$ bin/cqlsh -e'SELECT video_id,title FROM stackoverflow.videos... | Cassandra | 26,909,408 | 63 |
For a bit of background - this question deals with a project running on a single small EC2 instance, and is about to migrate to a medium one. The main components are Django, MySQL and a large number of custom analysis tools written in python and java, which do the heavy
lifting. The same machine is running Apache as we... | Cassandra and the other distributed databases available today do not provide the kind of ad-hoc query support you are used to from sql. This is because you can't distribute queries with joins performantly, so the emphasis is on denormalization instead.
However, Cassandra 0.6 (beta officially out tomorrow, but you can ... | Cassandra | 2,332,113 | 60 |
I'm working on a real-time advertising platform with a heavy emphasis on performance. I've always developed with MySQL, but I'm open to trying something new like MongoDB or Cassandra if significant speed gains can be achieved. I've been reading about both all day, but since both are being rapidly developed, a lot of th... | There are several ways to achieve this with all of the technologies listed. It is more a question of how you use them. Your ideal solution may use a combination of these, with some consideration for usage patterns. I don't feel that the information out there is that dated because the concepts at play are very fundament... | Cassandra | 6,162,789 | 60 |
I'm quite a newbie to Spring boot, but here's the problem I'm facing now:
// Application.java
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Autowired
private Cluster cluster = null;
@PostConstruct
private void migrateCassandra() ... | The test environment needs to know where your beans are defined, so you have to tell it the location.
In your test class, add the @ContextConfiguration annotation:
@RunWith(SpringRunner.class)
@AutoConfigureTestDatabase(replace = Replace.NONE)
@DataJpaTest
@ContextConfiguration(classes = {YourBeans.class, MoreOfYourBea... | Cassandra | 44,925,324 | 60 |
I'm currently experimenting around with Cassandra.
On the client-side (with Hector) I look up a few keys like this:
ColumnFamilyResult<String, String> result = template.queryColumns(Arrays.asList("key1","key2","key3"));
Most of the time it seems to work. But other times I get a timeout exception on the client:
Caused... | This is either https://issues.apache.org/jira/browse/CASSANDRA-4687 or https://issues.apache.org/jira/browse/CASSANDRA-5202
You can run the command "nodetool invalidatekeycache" on all of the server showing the error. If it keeps coming back you may want to disable key cache.
If it is 5202 it should only happen after ... | Cassandra | 11,623,356 | 59 |
How am I supposed to bot a new Cassandra node when I get this error?
INFO [SSTableBatchOpen:1] 2014-02-25 01:51:17,132 SSTableReader.java (line 223) Opening /var/lib/cassandra/data/system/local/system-local-jb-5 (5725 bytes)
ERROR [main] 2014-02-25 01:51:17,377 CassandraDaemon.java (line 237) Fatal exception during ini... | You can rename the cluster without deleting data by updating it's name in the system.local table (but you have to do this for each node...)
cqlsh> UPDATE system.local SET cluster_name = 'test' where key='local';
# flush the sstables to persist the update.
bash $ ./nodetool flush
Finally you need to rename the cluster ... | Cassandra | 22,006,887 | 59 |
For Cassandra, do UPDATEs become an implied INSERT if the selected row does not exist? That is, if I say
UPDATE users SET name = "Raedwald" WHERE id = 545127
and id is the PRIMARY KEY of the users table, and the table has no row with a key of 545127, will that be equivalent to
INSERT INTO users (id, name) VALUES (5... | Yes, for Cassandra UPDATE is synonymous with INSERT, as explained in the CQL documentation where it says the following about UPDATE:
Note that unlike in SQL, UPDATE does not check the prior existence of the row: the row is created if none existed before, and updated otherwise. Furthermore, there is no mean to know whi... | Cassandra | 17,348,558 | 56 |
I'm looking for a way to delete all of the rows from a given column family in cassandra.
This is the equivalent of TRUNCATE TABLE in SQL.
| You can use the truncate thrift call, or the TRUNCATE <table> command in CQL.
http://www.datastax.com/docs/1.0/references/cql/TRUNCATE
| Cassandra | 10,520,110 | 54 |
Suppose I have a column family:
CREATE TABLE update_audit (
scopeid bigint,
formid bigint,
time timestamp,
record_link_id bigint,
ipaddress text,
user_zuid bigint,
value text,
PRIMARY KEY ((scopeid, formid), time)
) WITH CLUSTERING ORDER BY (time DESC)
With two secondary indexes, where record_link_id... | select * from update_audit where scopeid=35 and formid=78005 and record_link_id=9897;
How the above query will work internally in cassandra?
Essentially, all data for partition scopeid=35 and formid=78005 will be returned, and then filtered by the record_link_id index. It will look for the record_link_id entry for ... | Cassandra | 29,692,738 | 54 |
Just learning cassandra, is there a way to insert a UUID using CQL, ie
create table stuff (uid uuid primary key, name varchar);
insert into stuff (name) values('my name'); // fails
insert into stuff (uid, name) values(1, 'my name'); // fails
Can you do something like
insert into stuff (uid, name) values(nextuid(), 'my... | As of Cassandra 2.0.7 you can just use uuid(), which generates a random type 4 UUID:
INSERT INTO users(uid, name) VALUES(uuid(), 'my name');
| Cassandra | 17,945,341 | 53 |
What is the difference between UPDATE and INSERT when executing CQL against Cassandra?
It looks like there used to be no difference, but now the documentation says that INSERT does not support counters while UPDATE does.
Is there a "preferred" method to use? Or are there cases where one should be used over the other?
T... | There is a subtle difference. Inserted records via INSERT remain if you set all non-key fields to null. Records inserted via UPDATE go away if you set all non-key fields to null.
Try this:
CREATE TABLE T (
pk int,
f1 int,
PRIMARY KEY (pk)
);
INSERT INTO T (pk, f1) VALUES (1, 1);
UPDATE T SET f1=2 where pk=2;
S... | Cassandra | 16,532,227 | 50 |
Would like to populate some static test data via a CQLsh script.
This doesn't work: (device_id is UUID)
insert into devices (device_id, geohash,name, external_identifier, measures, tags)
values ('c37d661d-7e61-49ea-96a5-68c34e83db3a','9q9p3yyrn1', 'Acme1', '936', {'aparPower','actPower','actEnergy'},{'make':'Acme'});... | You shouldn't put the quotes around the UUID to stop it being interpreted as a string i.e.
insert into devices (device_id, geohash,name, external_identifier, measures, tags)
values
(c37d661d-7e61-49ea-96a5-68c34e83db3a,'9q9p3yyrn1', 'Acme1', '936', {'aparPower','actPower','actEnergy'},{'make':'Acme'});
| Cassandra | 19,055,630 | 50 |
There is a big database, 1,000,000,000 rows, called threads (these threads actually exist, I'm not making things harder just because of I enjoy it). Threads has only a few stuff in it, to make things faster: (int id, string hash, int replycount, int dateline (timestamp), int forumid, string title)
Query:
select * from ... | You should read the following and learn a little bit about the advantages of a well designed innodb table and how best to use clustered indexes - only available with innodb !
http://dev.mysql.com/doc/refman/5.0/en/innodb-index-types.html
http://www.xaprb.com/blog/2006/07/04/how-to-exploit-mysql-index-optimizations/
the... | Cassandra | 4,419,499 | 48 |
I have recently started working with Cassandra Database. Now I am in the process of evaluating which Cassandra client we should go forward with.
I have seen various post on stackoverflow about which client to use for Cassandra but none has very definitive answer.
My team has asked me to do some research on this and c... | Thrift is becoming more of a legacy API:
First, you should be aware that the Thrift API is not going to be getting new features ; it's there for backwards compatibility, and not recommended for new projects.
- the paul
So I'd avoid Thrift based APIs (thrift is only kept for backwards compatibility).
In saying that ... | Cassandra | 15,983,190 | 48 |
Please some one clarify for me to understand Commit Log and its use.
In Cassandra, while writing to Disk is the commit log the first entry point or MemTables.
If Memtables is what is getting flushed to disk, what is the use of Commit log, is the only purpose of commit log is to server sync issues if a data node is down... | You can think of the commit log as an optimization, but Cassandra would be unusably slow without it. When MemTables get written to disk we call them SSTables. SSTables are immutable, meaning once Cassandra writes them to disk it does not update them. So when a column changes Cassandra needs to write a new SSTable to di... | Cassandra | 34,592,948 | 48 |
Is there any robust way of implementing Cassandra back end to a web application developed using Django web framework?
| http://github.com/twissandra/twissandra is a django app with a Cassandra backend. It uses https://github.com/datastax/python-driver to talk to Cassandra.
| Cassandra | 2,369,793 | 47 |
What cqlsh command can I use to quickly see the keyspaces in a cluster? cqlsh does not provide show keyspaces and describe cluster isn't as concise as I want.
I'm working using the following specifications:
cqlsh 2.2.0, Cassandra 1.1.10, CQL spec 2.0.0, Thrift protocol 19.33.0
| Very simple. Just enter this command in your cqlsh shell and enjoy
select * from system.schema_keyspaces;
In C*3.x, we can simply use
describe keyspaces
| Cassandra | 16,612,463 | 47 |
Using two databases to illustrate this example: CouchDB and Cassandra.
CouchDB
CouchDB uses a B+ Tree for document indexes (using a clever modification to work in their append-only environment) - more specifically as documents are modified (insert/update/delete) they are appended to the running database file as well as... | When comparing a BTree index to an SSTable index, you should consider the write complexity:
When writing randomly to a copy-on-write BTree, you will incur random reads (to do the copy of the leaf node and path). So while the writes my be sequential on disk, for datasets larger than RAM, these random reads will quic... | Cassandra | 8,651,346 | 46 |
What's the meaning of the frozen keyword in Cassandra?
I'm trying to read this documentation page: Using a user-defined type, but their explanation for the frozen keyword (which they use in their examples) is not clear enough for me:
To support future capabilities, a column definition of a user-defined
or tuple type... | In Cassandra if you define UDT or Collection as frozen, you can't update UDT's or collection's individual item, you have to reinsert with full value.
A frozen value serializes multiple components into a single value. Non-frozen types allow updates to individual fields. Cassandra treats the value of a frozen type as a ... | Cassandra | 42,532,743 | 46 |
Dynamo-like databases (e.g. Cassandra) can enforce consistency by means of quorum, i.e. a number of synchronously written replicas (W) and a number of replicas to read (R) should be chosen in such a way that W+R>N where N is a replication factor. On the other hand, PAXOS-based systems like Zookeeper are also used as a ... | Yes, Paxos provides guarantees that are not provided by the Dynamo-like systems and their read-write quorums. The difference is how failures are handled and what happens during a write. After a successful write, both kind of systems behave similarly. The data will be saved and available for reading afterwards (until ov... | Cassandra | 12,156,517 | 45 |
I have a Cassandra cluster with three nodes, two of which are up. They are all in the same DC. When my Java application goes to write to the cluster, I get an error in my application that seems to be caused by some problem with Cassandra:
Caused by: com.datastax.driver.core.exceptions.UnavailableException: Not enough r... | You are likely getting this error because the Replication Factor of the keyspace the table you are querying belongs to has a Replication Factor of one, is that correct?
If the partition you are reading / updating does not have enough available replicas (nodes with that data) to meet the consistency level, you will get ... | Cassandra | 27,974,911 | 45 |
I am wondering how can I achieve pagination using Cassandra.
Let us say that I have a blog. The blog lists max 10 posts per page. To access next posts a user must click on pagination menu to access page 2 (posts 11-20), page 3 (posts 21-30), etc.
Using SQL under MySQL, I could do the following:
SELECT * FROM posts LIMI... | You don't need to use tokens, if you are using Cassandra 2.0+.
Cassandra 2.0 has auto paging.
Instead of using token function to create paging, it is now a built-in feature.
Now developers can iterate over the entire result set, without having to care that it’s size is larger than the memory. As the client code iterat... | Cassandra | 26,757,287 | 44 |
I get the following message when executing cqlsh.bat on the command line
Connection error: ('Unable to connect to any servers', {'127.0.0.1': ProtocolError("cql_version '3.3.0' is not supported by remote (w/ native protocol). Supported versions: [u'3.2.0']",)})
I'm running Python version 2.7.10 along with Cassandra ve... | You can force cqlsh to use a specific cql version using the flag
--cqlversion="#.#.#"
Example cqlsh usage (and key/values):
cqlsh 12.34.56.78 1234 -u username -p password --cqlversion="3.2.0"
cqlsh (IP ADDR) (PORT) (DB_USERN) (DB_PASS) (VER)
| Cassandra | 33,002,404 | 44 |
How can I get the name of the datacenter in cqlsh?
It's required for the constructor of DCAwareRoundRobinPolicy.
| cqlsh> use system;
cqlsh:system> select data_center from local;
data_center
-------------
datacenter1
| Cassandra | 19,489,498 | 43 |
Both Aerospike and Cassandra says they are better than the other in their own respective benchmarks.
Reference : http://java.dzone.com/articles/benchmarking-cassandra-right and a few others.
Has anyone used both of them?
Is Aerospike as good as claimed?
Finally is it advisable to replace Cassandra with Aerospike?
| Choosing between Cassandra and Aerospike really depends on your use case more than anything. I have personally used both as a production system for the same project and for me Aerospike was the clear winner but that's because our use case is to have highly concurrent, low latency, transactional, small updates to billio... | Cassandra | 25,443,933 | 43 |
How does Voldemort compare to Cassandra?
I'm not talking about size of community and only want to hear from people who have actually used both.
Especially I'm interested in:
How they dynamically scale when adding and removing nodes
Query performance
How they scale when adding nodes (linear)?
Write speed
| Voldemort's support for adding nodes was just added recently (this month). So I would expect Cassandra's to be more robust given the longer time to cook and a larger community testing.
Both are fast (> 10k ops/s per machine). Because of their storage designs, I would expect Cassandra to be faster at writes, and Volde... | Cassandra | 2,252,163 | 42 |
What are the strengths and weaknesses of the various NoSQL databases available?
In particular, it seems like Redis is weak when it comes to distributing write load over multiple servers. Is that the case? Is it a big problem? How big does a service have to grow before that could be a significant problem?
| The strengths and weaknesses of the NoSQL databases (and also SQL databases) is highly dependent on your use case. For very large projects, performance is king; but for brand new projects, or projects where time and money are limited, simplicity and time-to-market are probably the most important. For teaching yourself ... | Cassandra | 4,720,508 | 42 |
Why is using HBase a better choice than using Cassandra with Hadoop?
Can anyone please give a detailed explanation on this?
Thanks
| I don't think either is better than the others, it's not just one or the other. These are very different systems, each with their strengths and weaknesses, so it really depends on your use cases. They can definitely be used in complement of one another in the same infrastructure.
To explain the difference better I'd li... | Cassandra | 14,950,728 | 42 |
Question about Cassandra
Why the hell on earth would anybody write a database ENGINE in Java ?
I can understand why you would want to have a Java interface, but the engine...
I was under the impression that there's nothing faster than C/C++, and that a database engine shouldn't be any slower than max speed, and cert... | What do you mean, C++? Hand coded assembly would be faster if you have a few decades to spare.
| Cassandra | 2,341,866 | 41 |
While doing a bulk load of data, incrementing counters based on log data, I am encountering a timeout exception. Im using the Datastax 2.0-rc2 java driver.
Is this an issue with the server not being able to keep up (ie server side config issue), or is this an issue with the client getting bored waiting for the server t... | While I don't understand the root cause of this issue, I was able to solve the problem by increasing the timeout value in the conf/cassandra.yaml file.
write_request_timeout_in_ms: 20000
| Cassandra | 21,819,035 | 41 |
I am trying to insert a simple row into the table. Can someone point out what is happening here ?
CREATE TABLE recommendation_engine_poc.user_by_category (
game_category text,
customer_id text,
amount double,
game_date timestamp,
PRIMARY KEY (game_category, customer_id)
... | Wrong syntax. Here you are:
insert into user_by_category (game_category,customer_id) VALUES
('Goku','12');
or:
insert into user_by_category ("game_category","customer_id") VALUES
('Kakarot','12');
The second one is normally used for case-sensitive column names.
| Cassandra | 32,117,170 | 41 |
I am trying to figure out exactly what these new fangled data stores such as bigtable, hbase and cassandra really are.
I work with massive amounts of stock market data, billions of rows of price/quote data that can add up to 100s of gigabytes every day (although these text files often compress by at least an order of m... | I am not an expert yet, but I've been playing with Cassandra for a few days now, and I have some answers for you:
Don't worry about amount of data, it's irrelevant with systems like Cassandra, if you have $$$ for a large hardware cluster.
Some of these systems (Cassandra, for example) claims to be able to do range q... | Cassandra | 1,623,399 | 39 |
Is there a paper/blog-post on when to use Cassandra or Membase or Hadoop or plain old relational databases ? Is there a paper discussing the strengths/weaknesses of each, and on what scenarios either of these technologies should be chosen ?
I am thinking of writing a new webservice which will have about a million hits ... | EDIT The NoSQL Ecosystem by Adam Marcus (from the book The Architecture of open source applications): http://www.aosabook.org/en/nosql.html
general thoughts and comparison http://www.thoughtworks.com/articles/nosql-comparison
technical comparison http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis
a Master's The... | Cassandra | 8,120,036 | 39 |
I am going through apache cassandra and working on sample data insertion, retrieving etc.
The documentation is very limited.
I am interested in knowing
can we completely replace relation db like mysql/ oracle with cassandra?
does cassandra support rollback/ commit?
does cassandra clients (thrift/ hector) support fetch... | Short answer: No.
By design, Cassandra values availability and partition tolerance over consistency1. Basically, it's not possible to get acceptable latency while maintaining all three of qualities: one has to be sacrificed. This is called CAP theorem.
The amount of consistency is configurable in Cassandra using consis... | Cassandra | 2,976,932 | 37 |
I'm a little confused about Cassandra seed nodes and how clients are meant to connect to the cluster. I can't seem to find this bit of information in the documentation.
Do the clients only contain a list of the seed node and each node delegates a new host for the client to connect to? Are seed nodes only really for nod... | Answering my own question:
Seeds
From the FAQ:
Seeds are used during startup to discover the cluster.
Also from the DataStax documentation on "Gossip":
The seed node designation has no purpose other than bootstrapping the gossip process
for new nodes joining the cluster. Seed nodes are not a single
point of fail... | Cassandra | 10,407,072 | 37 |
I have to work with a column family that has (user_id, timestamp) as key. In my query I would like to fetch all records in a given time range independent of the user_id. This is the exact table schema:
CREATE TABLE userlog (
user_id text,
ts timestamp,
action text,
app_type text,
channel_name text,
channel_... | The timeout is because Cassandra is taking longer than the timeout (default is 10 seconds) to return the data. For your query, Cassandra will attempt to fetch the entire dataset before returning. For more than a few records this can easily take longer than the timeout.
For queries that are producing lots of data you ne... | Cassandra | 18,697,725 | 37 |
I was loading a large CSV into Cassandra using cassandra-loader.
The VM ran out of disk space during this process and crashed. I allocated more disk space to the VM and tried starting cassandra but it refused to start due to problems with SSTables and commit log.
I could not run nodetool repair as it is only works when... | Since you don't care about the data, removing files from \data\commitlogs should be easiest solution.
| Cassandra | 33,304,367 | 37 |
I'm studying distributed systems and referring to this old question: stackoverflow link
I really can't understand the difference between exactly-once, at-least-once and at-most-once guarantees, I read these concepts in Kafka, Flink and Storm and Cassandra also. For instance someone says that Flink is better because has... | Below definitions are quoted from Akka Documentation
at-most-once delivery
means that for each message handed to the mechanism, that message is
delivered zero or one times; in more casual terms it means that
messages may be lost.
at-least-once delivery
means that for each message handed to the mechanism potent... | Cassandra | 44,204,973 | 37 |
In Cassandra Wiki, it is said that there is a limit of 2 billion cells (rows x columns) per partition. But it is unclear to me what is a partition?
Do we have one partition per node per column family, which would mean that the max size of a column family would be 2 billion cells * number of nodes in the cluster.
Or wil... | With the advent of CQL3 the terminology has changed slightly from the old thrift terms.
Basically
Create Table foo (a int , b int, c int, d int, PRIMARY KEY ((a,b),c))
Will make a CQL3 table. The information in a and b is used to make the partition key, this describes which node the information will reside on. This is... | Cassandra | 20,512,710 | 36 |
How do you check which cql version is currently being used in cqlsh?
In sql, you do this:
Select @@version
| There are a couple of ways to go about this.
From within cqlsh, you can simply show version.
aploetz@cqlsh> show version
[cqlsh 5.0.1 | Cassandra 2.1.8 | CQL spec 3.2.0 | Native protocol v3]
However, that only works from within cqlsh. Fortunately, you can also query system.local for that information as well.
aploetz@... | Cassandra | 31,502,442 | 36 |
The LIKE condition allows us to use wildcards in the where clause of an SQL statement. This allows us to perform pattern matching. The LIKE condition can be used in any valid SQL statement - select, insert, update, or delete. Like this
SELECT * FROM users
WHERE user_name like 'babu%';
like the same above operation any... | Since Cassandra 3.4 (3.5 recommended), LIKE queries can be achieved using a SSTable Attached Secondary Index (SASI).
For example:
CREATE TABLE cycling.cyclist_name (
id UUID PRIMARY KEY,
lastname text,
firstname text
);
Creating the SASI as follows:
CREATE CUSTOM INDEX fn_prefix ON cyclist_name (firstname)
U... | Cassandra | 9,905,795 | 35 |
I'm working on a distributed data base. I'm trying to generate a unique ID that will serve as a column family primary key in cassandra.
I read some articles about doing this with Java using UUID but it seems like there is a probability for collision (even if it's very low).
I wonder if there is a way to generate a un... | You can use the TimeUUID type in Cassandra, which backs a Type 1 UUID. This uses the current time and the creator's MAC address and a sequence number. If the TimeUUID number is generated correctly this can be done with zero collisions (you can use the CQL now() method or insert your own, the java SDK's provide some th... | Cassandra | 16,084,573 | 35 |
I am having trouble getting Cassandra up and running.
I have downloaded Cassandra 2.0.1 and Python 3.3.2.
Upon starting the CLI for cassandra I get an error:
C:\Dev\ApacheCassandra\apache-cassandra-2.0.1\bin>python cqlsh
File "cqlsh", line 95
except ImportError, e:
^
SyntaxError: invalid syn... | The version of Cassandra that you are using is only compatible with Python 2.x.
The following syntax:
except ImportError, e:
was deprecated in Python 2.7 and removed in Python 3.x. Nowadays, you use the as keyword:
except ImportError as e:
This means that you need to either downgrade to Python 2.x or get a version... | Cassandra | 19,142,231 | 35 |
I'm working on a project that is considering using Cassandra as a database. We would like to eventually migrate to Cassandra even if we use MySQL to start with, given its scalability. I know that big companies like Facebook, Digg, and recently Twitter is using Cassandra, but I don't believe any of those sites run off... | Twitter is running rails on most of their front end. Fauna's client is actually built and released by twitter, so you can be pretty certain that it's up to date and stable on large workloads. Looking at the history of commits shows that there are frequent improvements being pushed to it, which is great.
Most likely Aut... | Cassandra | 2,382,436 | 34 |
This introduction to Cassandra Replication and Consistency (slides 14-15) boldly asserts:
R+W>N guarantees overlap of read and write quorums.
Please imagine this inequality has huge fangs, dripping with the blood
of innocent, enterprise developers so you can best appreciate the
terror it inspires.
I understand ha... | The basic problem we are trying to solve is this:
Can a situation occur in which a read doesn't return the most up-to-date value?
Obviously, this is best avoided if possible!
If R+W <= N, then this situation can occur.
A write could send a new value to one group of nodes, while a subsequent read could read from a com... | Cassandra | 7,817,513 | 34 |
I am doing this to connect cassandra.But my code is returning an error.. Here is my code
public class CassandraConnection {
public static void main(String[] args) {
String serverIp = "166.78.10.41";
String keyspace = "gamma";
CassandraConnection connection;
Cluster cluster = Cluster.builder()
... | Did you do any research on the matter?
Picking a driver
You need a way to communicate with cassandra, best option is to use a high level API. You have a wide range of choices here but when we look at it from a high level prespective there are really two choices.
CQL based drivers - Higher level abstraction of what thr... | Cassandra | 16,870,502 | 34 |
Very recently I installed JDK 9 and Apache Cassandra from the official site. But now when I start cassandra in foreground, I get this message:
apache-cassandra-3.11.1/bin$ ./cassandra -f
[0.000s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/home/mmatak/monero/apache-cassandra-3.11.1/logs/gc.log instead.
intx... | I had exactly the same issue:
Can't start Cassandra (Single-Node Cluster on CentOS7)
If it is an option for you, using Java 8, instead of 9, is the simplest way to solve the issue.
| Cassandra | 46,936,170 | 34 |
I'm in a situation where I need to change the the composite primary key as follows:
Old Primary Key: (id, source, attribute_name, updated_at);
New Primary Key I want: (source, id, attribute_name, updated_at);
I issued the following (mysql like) command:
ALTER TABLE general_trend_table
DROP PRIMARY KEY,
ADD PRIMARY KE... | There is no way to change a primary key, as it defines how your data is physically stored.
You can create a new table with the new primary key, copy data from the old one, and then drop the old table.
| Cassandra | 22,139,747 | 32 |
I've read quite a few articles and a lot of question/answers on SO about Cassandra but I still can't figure out how Cassandra decides which node(s) to go to when it's reading the data.
First, some assumptions about an imaginary cluster:
Replication Strategy = simple
Using Random Partitioner
Cluster of 10 nodes
Replica... |
Client sends the data to a random node
It might seem that way, but there is actually a non-random way that your driver picks a node to talk to. This node is called a "coordinator node" and is typically chosen based-on having the least (closest) "network distance." Client requests can really be sent to any node, and... | Cassandra | 31,669,991 | 32 |
I have read in the latest release that super columns are not desirable due to "performance issues", but no where is this explained.
Then I read articles such as this one that give wonderful indexing patterns using super columns.
This leave me with no idea of what is currently the best way to do indexing in Cassandra.
... | Super columns suffer from a number of problems, not least of which is that it is necessary for Cassandra to deserialze all of the sub-columns of a super column when querying (even if the result will only return a small subset). As a result, there is a practical limit to the number of sub-columns per super column that ... | Cassandra | 11,915,255 | 31 |
During the creation of a table, like in SQL we have DEFAULT to insert a defualt value for a column.
type tinyint(1) NOT NULL DEFAULT '0'
Is there anything to achieve the same in Cassandra .
| No, there is no default value in Cassandra. Further more, setting a column value to null means removing it
| Cassandra | 19,155,691 | 31 |
I have a Java client that pushes (INSERT) records in batch to Cassandra cluster. The elements in the batch all have the same row key, so they all will be placed in the same node. Also I don't need the transaction to be atomic so I've been using unlogged batch.
The number of INSERT commands in each batch depends on diff... | I would recommend not increasing the cap, and just splitting into multiple requests. Putting everything in a giant single request will negatively impact the coordinator significantly. Having everything in one partition can improve the throughput in some sized batches by reducing some latency, but batches are never mean... | Cassandra | 34,699,841 | 31 |
I'm trying to rename table created via CQLSH.
E.g. rename table "AAA" to "BBB". Can't find any command to do so. Any ideas?
Using [cqlsh 3.1.6 | Cassandra 1.2.8 | CQL spec 3.0.0 | Thrift protocol 19.36.0]
| I don't believe you can rename tables or keyspaces, there's no CQL3 operation to do it, and nothing in the old Thirft interfaces either, if I remember correctly.
One reason why you can't is that it would be an extremely hard thing for Cassandra to do due to its distributed nature, the change can't be done atomically so... | Cassandra | 18,112,384 | 30 |
It could be kind of lame but in cassandra has the primary key to be unique?
For example in the following table:
CREATE TABLE users (
name text,
surname text,
age int,
adress text,
PRIMARY KEY(name, surname)
);
So if is it possible in my database to have 2 persons in my database with the same name and surname... | Yes the primary key has to be unique. Otherwise there would be no way to know which row to return when you query with a duplicate key.
In your case you can have 2 rows with the same name or with the same surname but not both.
| Cassandra | 21,762,599 | 30 |
Can someone explain the differences between --packages and --jars in a spark-submit script?
nohup ./bin/spark-submit --jars ./xxx/extrajars/stanford-corenlp-3.8.0.jar,./xxx/extrajars/stanford-parser-3.8.0.jar \
--packages datastax:spark-cassandra-connector_2.11:2.0.7 \
--class xxx.mlserver.Application \
--conf spark.... | if you do spark-submit --help it will show:
--jars JARS Comma-separated list of jars to include on the driver
and executor classpaths.
--packages Comma-separated list of maven coordinates of jars to include
on the driver and e... | Cassandra | 51,434,808 | 30 |
I download apache-cassandra-0.8.5 for ubuntu and extract it.I read the readme file.
I try bellow command in shell:
bin/cassandra -f
But it said:
Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name
unknown: java.net.UnknownHostException: node24.nise.local: node24.nise.local
what shou... | What does your /etc/hosts file contain? Maybe add localhost and node24.nise.local as a name at the 127.0.0.1 line.
| Cassandra | 7,496,640 | 28 |
I'm undecided whether it's better, performance-wise, to use a very commonly shared column value (like Country) as partition key for a compound primary key or a rather unique column value (like Last_Name).
Looking at Cassandra 1.2's documentation about indexes I get this:
"When to use an index:
Cassandra's built-i... | Indexing in the documentation you wrote up refers to secondary indexes. In cassandra there is a difference between the primary and secondary indexes. For a secondary index it would indeed be bad to have very unique values, however for the components in a primary key this depends on what component we are focusing on. In... | Cassandra | 18,168,379 | 28 |
I am trying to use Spark Cassandra Connector in Spark 1.1.0.
I have successfully built the jar file from the master branch on GitHub and have gotten the included demos to work. However, when I try to load the jar files into the spark-shell I can't import any of the classes from the com.datastax.spark.connector package... | I got it. Below is what I did:
$ git clone https://github.com/datastax/spark-cassandra-connector.git
$ cd spark-cassandra-connector
$ sbt/sbt assembly
$ $SPARK_HOME/bin/spark-shell --jars ~/spark-cassandra-connector/spark-cassandra-connector/target/scala-2.10/connector-assembly-1.2.0-SNAPSHOT.jar
In scala prompt,
sca... | Cassandra | 25,837,436 | 28 |
I'm doing a student project involving building and querying a Cassandra data cluster.
When my cluster load was light ( around 30GB ) my queries ran without a problem, but now that it's quite a bit bigger (1/2TB) my queries are timing out.
I thought that this problem might arise, so before I began generating and loadin... | If you are using Datastax cqlsh then you can specify client timeout seconds as a command line argument. The default is 10.
$ cqlsh --request-timeout=3600
Datastax Documentation
| Cassandra | 29,437,517 | 28 |
I am using Cassandra for the first time in a web app and I got a query problem.
Here is my tab :
CREATE TABLE vote (
doodle_id uuid,
user_id uuid,
schedule_id uuid,
vote int,
PRIMARY KEY ((doodle_id), user_id, schedule_id)
);
On every request, I indicate my partition key, doodle_id.
For example I ... | In Cassandra, you should design your data model to suit your queries. Therefore the proper way to support your second query (queries by doodle_id and schedule_id, but not necessarilly with user_id), is to create a new table to handle that specific query. This table will be pretty much the same, except the PRIMARY KEY... | Cassandra | 28,565,470 | 27 |
I've tried all the measures from this post and Cassandra doc.
I've tried running all the versions of Cassandra including the latest release 3.7 from tarball and Debian package, but I keep getting errors when I execute cqlsh.
Error:
Connection error: ('Unable to connect to any servers', {'127.0.0.1': TypeError('ref() ... | You are running into CASSANDRA-11850, where cqlsh breaks with Python 2.7.11+. This ticket has been marked as "Resolved" and a patch has been applied to Cassandra 3.9 which has not been released yet.
I believe I installed all the necessary packages such as java 8 and python 2.7.12.
In the interim (until 3.9 is releas... | Cassandra | 38,616,858 | 27 |
I want to use Docker to start my application and Cassandra database, and I would like to use Docker Compose for that. Unfortunately, Cassandra starts much slower than my application, and since my application eagerly initializes the Cluster object, I get the following exception:
com.datastax.driver.core.exceptions.NoHos... | You should be able to write some try/catch logic on the NoHostAvailableException to retry the connection after a 5-10 second wait. I would recommend only doing this a few times before throwing the exception after a certain time period where you know that it should have started by that point.
Example pseudocode
Connect... | Cassandra | 38,723,896 | 27 |
I am wondering because I searched the pdf "[noSql] the definitive guide" and "beginning [noSql]" for the word "inheritance" but I didn't find anything? am I missing something? because I'm doing a tablePerHierarchy inheritance with hibernate and mysql, does that become deprecated for some reason in [noSql]?
(replace [no... | I know this answer is a little late, but for MongoDB, you're probably looking at something slightly different.
Mongo is schemaless, so the concept of "tablePerHierarchy" is not necessarily useful.
Assume the following
class A
property X
property Y
property Z
class B inherits from A
property W
In an RDMS you w... | Cassandra | 3,040,584 | 26 |
Does Apache Cassandra support sharding?
Apologize that this question must seem trivial, but I cannot seem to find the answer. I have read that Cassandra was partially modeled after GAE's Big Table which shards on a massive scale. But most of the documentation I'm currently finding on Cassandra seems to imply that Cassa... | Cassandra does partition across nodes (because if you can't split it you can't scale it). All of the data for a Cassandra cluster is divided up onto "the ring" and each node on the ring is responsible for one or more key ranges. You have control over the Partitioner (e.g. Random, Ordered) and how many nodes on the ri... | Cassandra | 16,428,008 | 26 |
I have a table/column family which I am inserting rows that expire after a certain amount of time. Is it possible to then query the table to check which rows are going to expire soon (for diagnostic purposes, ie something like this:
select subject, ?ttl? from discussions;
| You can do
select subject, TTL(subject) from discussions;
to return the remaining TTL in seconds for subject.
E.g.
> insert into discussions (uid, subject) VALUES (now(), 'hello') using ttl 100;
> select subject, TTL(subject) from discussions;
subject | ttl(subject)
---------+--------------
hello | 84
... | Cassandra | 19,067,220 | 26 |
According to cassandra's log (see below) queries are getting aborted due to too many tombstones being present. This is happening because once a week I cleanup (delete) rows with a counter that is too low. This 'deletes' hundreds of thousands of rows (marks them as such with a tombstone.)
It is not at all a problem if, ... | When a query that returns a range of rows (or columns) is issued to Cassandra, it has to scan the table to collect the result set (this is called a slice). Now, deleted data is stored in the same manner as regular data, except that it's marked as tombstoned until compacted away. But the table reader has to scan throu... | Cassandra | 21,755,286 | 26 |
I'm trying to understand the difference between these two and the scenarios in which you would prefer to use one over the other.
My specific use case is using cassandra as an event ingestion system backed by an analytics engine that interprets the event.
My model includes
event id (the partition key)
event time (a clu... | A secondary index is pretty similar to what we know from regular relational databases. If you have a query with a where clause that uses column values that are not part of the primary key, lookup would be slow because a full row search has to be performed. Secondary indexes make it possible to service such queries effi... | Cassandra | 24,622,511 | 26 |
Columnar database should store group of columns together. But Cassandra stores data row-wise.
SS Table will hold multiple rows of data mapped to their corresponding partition key. So I feel like Cassandra is a row wise data store like MySQL but has other benefits like "wide rows" and every columns are not necessarily ... | If you go to the Apache Cassandra project on GitHub, and scroll down to the "Executive Summary," you will get your answer:
Cassandra is a partitioned row store. Rows are organized into tables
with a required primary key.
Partitioning means that Cassandra can distribute your data across
multiple machines in an appl... | Cassandra | 25,441,921 | 26 |
I want to khnow what is the size of a table in Cassandra.
Is there a query in cqlsh similar to show dbs in mongodb?
If not is there another way to get the size of tables?
| nodetool cfstats -- <keyspace>.<table>
will give you the 'Space used' by a table.
| Cassandra | 27,702,883 | 26 |
I am trying to configure spring data with cassandra.
But I am getting bellow error , when my app is deploying in tomcat.
When I check the connection, it is available to the given port. (127.0.0.1:9042). I have include stack trace and spring configuration bellow.
Does anyone having idea on this error?
Full stack trace ... | The problem is that Spring Data Cassandra (as of December 2015 when I write this) does not provide support for Cassandra 3.x. Here's an excerpt from a conversation with one of the developers in the #spring channel on freenode:
[13:49] <_amicable> Hi all, does anybody know if spring data cassandra supports cassandra 3.... | Cassandra | 34,117,374 | 26 |
I have huge database (kinda wordnet) and want to know if it's easier to use Cassandra instead of MySQL|PostrgreSQL
All my life I was using MySQL and PostrgreSQL and I could easily think in terms of relational algebra, but several weeks ago I learned about Cassandra and that it's used in Facebook and Twitter.
Is it more... | There is nothing like a Silver bullet solution, everything is built to solve specific problem and has its own pros and cons. It is up to you to decide - what problem statement you have and what is best solution that fits your problem. Whether you use Cassandra (NoSQL) or MySQL(RDBMS), it is all driven from your system'... | Cassandra | 2,529,871 | 25 |
I have been hearing a lot about document oriented data stores like CouchDB. I understand the uses of BigTable like stores such as Cassandra. After reading this question, I was wondering what the conditions would be to merit using a document store?
| Column-family stores such as Bigtable and Cassandra have very limited querying capabilities. The application is responsible for maintaining indexes in order to query a more complex data model.
Document databases allow you to query the content, not just the key. It will also manage the indexes for you, reducing the comp... | Cassandra | 3,376,636 | 25 |
We are using Cassandra as the data historian for our fleet management solution. We have a table in Cassandra , which stores the details of journey made by the vehicle. The table structure is as given below
CREATE TABLE journeydetails(
bucketid text,
vehicleid text,
starttime timestamp,
stoptime timestamp,
traveldurati... | select * from journeydetails where bucketid in('2015-12') and vehicleid in('1234567')
and starttime > '2015-12-1 00:00:00' and starttime < '2015-12-3 23:59:59'
and travelduration > 1800000;
That's not going to work. The reason goes back to how Cassandra stores data on-disk. The idea with Cassandra is that it is... | Cassandra | 34,422,515 | 25 |
Cassandra newbie question. I'm collecting some data from a social networking site using REST calls. So I end up with the data coming back in JSON format.
The JSON is only one of the columns in my table. I'm trying to figure out what the "best practice" is for storing the JSON string.
First I thought of using the map ... | In the Cassandra Storage engine there's really not a big difference between a blob and a text, since Cassandra stores text as blobs essentially. And yes the "native" JSON support you speak of is only for when your data model matches your JSON model, and it's only in Cassandra 2.2+.
I would store it as a text type, and ... | Cassandra | 36,342,531 | 25 |
Sorry if this question is somewhat subjective. I am new to 'could store', 'distributed store' or some concepts like this. I really wonder what do they have in common and want to get an overview on all of them. What do I need to prepare if I want to write a product similar to this?
| The NoSQL Database site summarizes the concept like this:
Next Generation Databases mostly
address some of the points: being
non-relational, distributed,
open-source and horizontal scalable.
The original intention has been modern
web-scale databases. The movement
began early 2009 and is growing
rapidly. ... | Cassandra | 2,437,005 | 24 |
I am planning on using ElasticSearch to index my Cassandra database. I am wondering if anyone has seen the practical limits of ElasticSearch. Do things get slow in the petabyte range? Also, has anyone has any problems using ElasticSearch to index Cassandra?
| See this thread from 2011, which mentions ElasticSearch configurations with 1700 shards each of 200GB, which would be in the 1/3 petabyte range. I would expect that the architecture of ElasticSearch would support almost limitless horizontal scalability, because each shard index works separately from all other shards.
T... | Cassandra | 6,359,382 | 24 |
I want to run www.example.com and api.example.com on same port 80.
This is what I have. All my googles ping lead to the below code. But, this is not working.
server {
listen 80 default_server;
# listen [::]:80 default_server ipv6only=on;
root /var/www/example.com/html/example/app;
index i... | Create separately two files (you don't have to, but it will be much clearer) in /etc/nginx/sites-available/www.example.com and /etc/nginx/sites-available/api.example.com
The api.example.com file's content:
server {
listen 80;
server_name api.example.com;
root /var/www/api.example.com/html/exampl... | NGINX | 33,055,212 | 53 |
I'm trying to get Gunicorn to use Python3 for a Django app I want to make. I'm using Digital Ocean's Django image to get started. It comes with Django, Gunicorn, and Nginx installed and configured. The default Django project that comes with this image seems to work fine for Python 2.
I've apt-get'ed these packages.
py... | It seems that there's a package for this called gunicorn3 (this was tested on ubuntu)
sudo apt-get install gunicorn3
then running the following command should work and run gunicorn with python3:
gunicorn3 --log-level debug --bind 0.0.0.0:30443 server:app
| NGINX | 23,928,213 | 53 |
Let's say I have a URL like this: www.example.com/a/b/sth, and I write a location block in Nginx config:
location ^~ /a/b/(?<myvar>[a-zA-Z]+) {
# use variable $myvar here
if ($myvar = "sth") { ... }
}
I hope to be able to use variable $myvar captured from the URL inside the block, however, Nginx keeps telling ... | Old thread but I had the same problem...
I think the error isn't related to the PCRE version installed
NGINX doesn't parse your regex if your location tag doesn't start with ~
You need to use something like this
location ~ ^/a/b/(?<myvar>[a-zA-Z]+) {
# use variable $myvar here
if ($myvar = "sth") { ... }
}
| NGINX | 13,706,658 | 53 |
I Have an Angular application. I run the command ng build --prod --aot to generate the dist folder.
In the dist folder I created a file named Staticfile then I uploaded the dist folder to pivotal.io with the following commands:
cf push name-app --no-start
cf start name-app
The app runs well. I have a nav bar, so whe... | for those not using a Staticfile might wanna try this.
I had the same problem with nginx serving angular.
The following is the default config file, probably found somewhere in /etc/nginx/sites-available/yoursite
location / {
# First attempt to serve request as file, then
# as directory, th... | NGINX | 45,858,957 | 52 |
I am deploying a Rails 4 app to a Fedora 19 x64 server using Nginx and Unicorn. The problem is that I get an error when visiting the address: "We're sorry, but something went wrong."
My Nginx error log (/var/log/nginx/error.log) shows:
2014/03/08 03:50:12 [warn] 23934#0: conflicting server name "localhost" on 0.0.0.0:8... | After many hours and a grand total of 3 beers, I've managed to figure out the problem. After hours of digging, I finally came across this Server Fault answer
In layman terms, it appears that programs that create files in /tmp (or /var/tmp as I have discovered) are the only programs that are able to see the files in tha... | NGINX | 22,272,943 | 52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.