cassandra | Mirror of Apache Cassandra
kandi X-RAY | cassandra Summary
kandi X-RAY | cassandra Summary
Mirror of Apache Cassandra
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Return a proxy for a column family .
- Removes the maximum endpoint version from the gossip service .
- Returns the primary ranges for the given collection of tokens .
- Adds the table to a schema mutation .
- Apply configuration to the configuration .
- Deletes all files in the specified directory recursively .
- Initialize Cassandra server .
- Creates the trace state .
- Returns the index level for the given index .
- Log system system info .
cassandra Key Features
cassandra Examples and Code Snippets
public static void main(String... args) throws Exception {
EmbeddedCassandraServerHelper.startEmbeddedCassandra();
ColumnConfiguration configuration = new CassandraConfiguration();
try(ColumnFamilyManagerFactory entityManage
@Override
@Bean
public CassandraMappingContext cassandraMapping() throws ClassNotFoundException {
return new BasicCassandraMappingContext();
}
@Bean(destroyMethod = "close")
public Session session(CassandraProperties properties, Cluster cluster) {
log.debug("Configuring Cassandra session");
return StringUtils.hasText(properties.getKeyspaceName()) ? cluster.connect(proper
Community Discussions
Trending Discussions on cassandra
QUESTION
I red the cassandra docs about Good use of BATCH statement - single partition batch example I want to understand about multi/single partition batch.
According to the docs this is a single partition batch.
...ANSWER
Answered 2021-Jun-14 at 12:41First partition is -
'Vera ADRIAN', 2
Second partition -'Vera ADRIAN', 3
Could u explain pls why is it single partition batch?
Sure. Because the expense_id
is not part of the partition key. Therefore, Vera ADRIAN
is the same partition key value used in both INSERT
s.
For the 2nd part of your question, you're right in that the 2nd example does not appear to be a multi-partition query as the cart_id
s are the same. Following your link above, I quickly found a bad use of BATCH
(multi-partition): https://docs.datastax.com/en/dse/6.8/cql/cql/cql_using/useBatchBadExample.html
QUESTION
I have a table in Cassandra DB, with some columns, for example:
...ANSWER
Answered 2021-Jun-14 at 05:51No, it’s not possible to do only with CQL - you need to have some code or tool to do that - it should scan the whole database, read the data and put them into destination column. Besides trying to write your own code, that it’s usually hard to write correctly you can use:
- DSBulk - you can unload data into CSV or JSON file, convert the data into specific representation by using
sed
or something like, and load data into the new column. But transformation step is something that you will need to implement, and it could be hard to debug if you have data with quotes, etc. - Spark + Spark Cassandra Connector (even in the local mode) - although it's still a piece of code, it would be easier to implement from my point of view. Just start
pyspark
with options specified in the documentation, read data from Cassandra, transform, and store them back into Cassandra. Something like this (not tested):
QUESTION
What is the recommended for cassandra (apache) 3.11.9 system_auth? need to be SimpleStrategy
or NetworkTopologyStrategy
? And with how much RF?
We have cassandra with 1 dc (2-3 AWS racks with EC2_snitch + dynamic_snitch disabled). Most queries running on consistency level local_one). Today our system_auth
keyspace configured SimpleStrategy
with RF 3. In a lot of queries, we are wasting time on (tracing):
ANSWER
Answered 2021-Jun-14 at 02:51I answered this question a while ago, which is similar: Replication Factor to use for system_auth
Due to issues that can happen with larger clusters which fluctuate in size, we now treat system_auth like we do any other keyspace. That is, we set system_auth's RF to 3 in each DC.
tl;dr;, if you're using NetworkTopologyStrategy
on your non-system keyspaces, then you should also be using it for system_auth
. Same with your RF; I'd always match the RF of system_auth
with that of my "normal" keyspaces, as well.
No, the replication strategy and RF used on system_auth
does not typically cause query latency. That is of course, unless any of the Security cache settings have been altered. 10 years of working with Cassandra, I've never had to change those: https://docs.datastax.com/en/security/5.1/security/secAuthCacheSettings.html
queries wasting time on (tracing): "Executing single-partition query on roles [ReadStage-X]"
This statement got me thinking: Are you tracing queries in cqlsh while logged in as the default cassandra
user? That user does trigger some cqlsh operations to execute at QUORUM. Could also be that maybe the query consistency and connection consistency are set differently. Just a thought.
QUESTION
I am planning to use Janusgraph for building graph of different uses our team handles and I see that janus graph has option to use BigTable or Cassandra as storage backend. I am looking for any recommendation on which backend is more optimal/performant ( I am mainly talking about gremlin query performance on 2 hop neighbor of a node ) with JanusGraph.
I understand that performance is pretty subjective and varies based on datasize/graph connectivity and use case so best approach will be to try out myself, which I am planning to do. But has anyone else has done similar performance comparison ? Is there any general recommendation about storage backend here ?
...ANSWER
Answered 2021-Jun-10 at 18:14You're right in that performance is both:
- subjective
- depends largely on data size
I can tell you that I have done this exercise as well. To that end, I think it's important to share this comparison from DB-Engines.com.
In terms of performance, the biggest thing I'd be looking at is how each handles consistency. As a general rule, databases which enforce stronger levels of consistency typically have to sacrifice performance.
- BigTable == strong-consistent
- Cassandra == eventually consistent
Other factors worth considering, are the fact that BigTable limits you to Google Cloud (GCP). And if you don't want to lose performance over the network, you'll also need to pay for more (Janus) instances on GCP for data locality.
In terms of raw DB-Engine "score," Cassandra is currently at 114.112, while BigTable is at a paltry 3.582. These scores will change month-to-month, but in general this signifies that Cassandra has a much stronger community around it. Similarly, Cassandra has 18182 questions on this site, while BigTable only has 449. Bottom line, is that it'll be much easier to get support and answers to questions.
Just based on the underlying strength of the community, Cassandra is the better option here.
Having supported JanusGraph on Cassandra for the last few years, I can tell you that overall it's been solid. The difficulties tend to come into play with bulk data loading. But outside of that, things seem to run pretty well.
QUESTION
I am using Spring Boot 2.4.4
and Spring Data Cassandra dependency to connect to the Cassandra database. During the application startup, I am getting a DriverTimeout error (I am using VPN).
I have gone through all the Stack Overflow questions similar to this and none of them worked for me. I have cross-posted the same question on the Spring Boot official page here.
I used below configuration properties below -
...ANSWER
Answered 2021-Apr-23 at 08:35The DriverTimeoutException
gets thrown when the driver doesn't get a reply from the coordinator node. It uses the basic request timeout default of 2 seconds:
QUESTION
I have a spring boot application with spring web & spring data cassandra as dependencies. And I have a main method in a class annotated with @SpringBootApplication.
...ANSWER
Answered 2021-Jan-07 at 22:38The problem is the connection with the cassandra. Make sure that you've been created the keyspace-name on cassandra. After that in your project declare a Bean Configuration with the keyspace, in my case mykeyspace
. You can visit https://kayaerol84.medium.com/cassandra-cluster-management-with-docker-compose-40265d9de076 for more details about setting up the keyspace.
QUESTION
I want to know if there is a way to update the column value in cassandra but the column ttl that is present already should remain the same.
Could you please let me know if this is possible?
...ANSWER
Answered 2021-Jun-10 at 07:16You can update the ttl to desired value while updating the column. I mean you can achieve it programatically. Please go through this page ( https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useExpireExample.html ) for examples.
QUESTION
I came from SQL and switched now to CQL. I don't quite understand something yet.
In SQL this works:
...ANSWER
Answered 2021-Jun-09 at 14:23Cassandra doesn't have joins, so you can't do it - if you need to perform the join, then it should be done in your application.
Cassandra encourages the data denormalization, when you can copy necessary data into another table to avoid joining when reading data - like, for cart
table, you can copy price/description from the product
table, and then when displaying the cart you won't need to query the product
table.
I recommend to read first chapters of "Casasndra: The Definitive Guide, 3rd edition" book - it's freely available. This will help you with understanding how to model data for Cassandra
QUESTION
I read a lot of articles. Many says cassandra is fast in read many says cassandra is slow. I mean a lot of big companies uses cassandras. If it were slow, they dont would use it or i am wrong ?
Maybe I want to search an Article by id and I have 10 million rows, would it take more than 1-2 seconds ?
Whats your opinion?
...ANSWER
Answered 2021-Jun-09 at 12:27I work with hundreds of companies who use Cassandra on a daily basis and most of these companies do things on internet scale.
Most of their SLAs require ~6 millisecond read latency 95% of the time at peak app traffic. For that reason, a 2-second latency is a read timeout in Cassandra terms.
For those who say it is slow, I'll let the tech giants do the talking for Cassandra -- Apple, Netflix, Uber, Visa, FedEx, Sony, GE, Expedia and the list goes on and on and on. :)
QUESTION
I have a Cassandra cluster that contains 6 nodes which I already have in an inventory:
...ANSWER
Answered 2021-Jun-09 at 05:53You want to use the authorized_key module.
For example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cassandra
You can use cassandra like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the cassandra component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page