docker build -t nahwu2/cassandra-4-exploration:0.0.1 .
docker compose up -d
docker compose down
docker exec -it cassandra-4-exploration-cassandra-db-1 /bin/bash
cqlsh
CREATE KEYSPACE testKeySpace WITH replication = {'class' : 'SimpleStrategy', 'replication_factor' : 1};
DROP TABLE testkeyspace.testdbobject;
CREATE TABLE testkeyspace.testdbobject (
id UUID, date timestamp, item text, category text, payer text, receiver text, amount double, imageUrl text,
PRIMARY KEY ((id), date)
)
WITH CLUSTERING ORDER BY (date DESC);
INSERT INTO testkeyspace.testdbobject (id, date, item, category, payer, receiver, amount, imageUrl)
VALUES (e027962a-3226-4ea3-83e4-57230a457436, dateof(now()), 'myitem', 'NEW_CATEGORY','payer1','receiver2', 123.45, 'http://abc.com');
SELECT * FROM testkeyspace.testdbobject LIMIT 10;
PS: This operation is highly inefficient as it's basically an SELECT * operation
SELECT COUNT(*) FROM testkeyspace.testdbobject;
CREATE CUSTOM INDEX cyclist_contains ON testkeyspace.testdbobject (item) USING 'org.apache.cassandra.index.sasi.SASIIndex'
WITH OPTIONS = { 'mode': 'CONTAINS' };
-
SSTable Attached Secondary Indexes (SASI) SASI supports prefix and contains queries on strings (similar to SQL’s LIKE = "foo*" or LIKE = "foo"').
https://cassandra.apache.org/doc/latest/cassandra/cql/SASI.html -
Pagination In most Web UIs and REST services, you need paginated results with random access, for example: “given a page size of 20 elements, fetch page 5”.
Cassandra does not support this natively (see CASSANDRA-6511), because such queries are inherently linear: the database would have to restart from the beginning every time, and skip unwanted rows until it reaches the desired offset.
https://docs.datastax.com/en/developer/java-driver/4.14/manual/core/paging/#offset-queries -
Counter table
https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useCountersConcept.html
- Apache Cassandra SASI
https://cassandra.apache.org/doc/latest/cassandra/cql/SASI.html - DataStax SASI
https://docs.datastax.com/en/cql-oss/3.x/cql/cql_using/useSASIIndex.html - Enable SASI in Cassandra
https://medium.com/featurepreneur/enabling-sasi-index-86604c37d31b - NodeJS + Cassandra
https://www.instaclustr.com/support/documentation/cassandra/using-cassandra/connect-to-cassandra-with-node-js/ - Elassandra - Guide
https://medium.com/rahasak/elassandra-936ab46a6516 - Discussion - ElasticSearch vs. ElasticSearch+Cassandra - (2020)
https://stackoverflow.com/questions/61224168/elasticsearch-vs-elasticsearchcassandra/
.\jmeter -n -t createTransactionAPICall.jmx -l testResults.csv
-
Open testResults.csv with Excel.
-
Create new column after col A.
-
Use this formula in the newly created col B.
=(A2/86400/1000)+25569
-
Format col B to
d/m/yyyy h:mm:ss.000