Cassandra for MySQL Folks 
Solomon Chang 
skevin521@yahoo.com
Cassandra as a NoSQL platform 
NoSQL has been retroactively re-acronymed as 
“Not Only SQL”. 
Cassandra uses its own query language, CQL. 
CQL has many aspects of SQL, but could be 
considered a scaled down version of Structured 
Query Language.
Cassandra sorta looks like MySQL 
except... 
● Databases are called “Keyspaces” 
● Tables are called “Column Families” 
● Port 9160 instead of 3306 
● Client prompt called with cqlsh instead of 
mysql
And CQL looks kinda like SQL 
except... 
SQL CQL 
SHOW DATABASES DESCRIBE KEYSPACES 
CREATE DATABASE... CREATE KEYSPACE... 
CREATE TABLE... CREATE COLUMNFAMILY... 
SHOW CREATE TABLE... DESCRIBE COLUMNFAMILY...
And CREATE looks kinda similar 
except... 
CREATE COLUMNFAMILY... 
● Never uses auto_increment 
● Never uses NOT NULL 
● Never uses DEFAULT 
● Never uses array qualifiers [e.g. varchar(8)] 
● Indexes “kludged” to a separate space
Getting used to new data types 
MySQL 
TEXT 
BIGINT 
BLOB 
BIT 
DECIMAL 
DOUBLE 
FLOAT 
INT 
ENUM 
TEXT 
TIMESTAMP 
VARCHAR 
CQL 
ASCII 
BIGINT 
BLOB 
BOOLEAN 
COUNTER 
DECIMAL 
DOUBLE 
FLOAT 
INET 
INT 
LIST 
MAP 
SET 
TEXT 
TIMESTAMP 
UUID 
TIMEUUID 
VARCHAR
Not all Data Types have a partner 
● ENUM(x,y,z,etc.) 
● DATE() 
● DATETIME() 
● TIME() 
● YEAR()
CQL SELECTs do not: 
● Support Joins 
● Support aggregate functions (AVG, SUM, etc) 
● Support expressions 
● Seem to be satisfied with Double Quotes
But at least WHERE is still the same 
SELECT * FROM users WHERE fname = 'Solomon'; 
^^^^^^^^^^^^^^^^^^ 
● Except all fields referenced by WHERE must be 
indexed or primary key 
● ...And all comparisons are strictly by EQ, not 
GT or LT
Inserts 
INSERT syntax is almost the same, except: 
● A conflicting PK will replace the matching entry! 
● You have to specify your own PK value. 
● No SELECT statements for large groups of 
inserts. VALUE statements only!
Updates/Deletes 
UPDATE and DELETE are pretty much the same, 
except: 
● No performing Joins on an UPDATE or 
DELETE 
● WHERE clauses must reference a PK field
However, this frees up memory that 
might have been used on: 
● A Join buffer 
● A Sort buffer 
Or heaven forbid 
● A query cache
Missing functionality offloaded to 
client side 
● Sorts: large data sets cannot use ORDER BY. 
They must be sorted on the client. 
● Aggregates: the client side will have to parse 
the data for records matching a certain criteria 
and perform the aggregate function on it. 
● Joins: the client side will simply have to make 
additional calls to the database for records 
matching FKs.
So why use Cassandra? 
(Or any other NoSQL solution for that matter?) 
● Speed 
● Scalability
Cassandra for MySQL Folks 
Solomon Chang 
skevin521@yahoo.com

More Related Content

PDF
PostgreSQL v9.4features
PPT
How to leave the ORM at home and write SQL
PDF
Improving the Performance of PL/SQL function calls from SQL
PPTX
TSQL in SQL Server 2012
PDF
CakePHP 3
PPTX
Mule dataweave
PPTX
Integrate with database by groovy
PPTX
Stored procedure in sql server
PostgreSQL v9.4features
How to leave the ORM at home and write SQL
Improving the Performance of PL/SQL function calls from SQL
TSQL in SQL Server 2012
CakePHP 3
Mule dataweave
Integrate with database by groovy
Stored procedure in sql server

What's hot (15)

DOC
Setting And Changing The Column Collation.Doc
PPTX
Accessing mongo DB In Mule ESB
PDF
Scaling an invoicing SaaS from zero to over 350k customers
PPTX
How to – data integrity checks in batch processing
PPTX
Xslt in mule
PDF
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
PDF
React&redux
ODP
Plproxy
PDF
Converting a naive flow to akka streams
PPTX
High Performance Plsql
PPTX
MuleSoft ESB Scripting Example
PDF
Extending Apache Spark – Beyond Spark Session Extensions
PPTX
.NetRAF 2017: Big data en Azure
PDF
PGConf.ASIA 2019 Bali - A step towards SQL/MED - DATALINK - Gilles Darold
PPTX
View, Store Procedure & Function and Trigger in MySQL - Thaipt
Setting And Changing The Column Collation.Doc
Accessing mongo DB In Mule ESB
Scaling an invoicing SaaS from zero to over 350k customers
How to – data integrity checks in batch processing
Xslt in mule
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
React&redux
Plproxy
Converting a naive flow to akka streams
High Performance Plsql
MuleSoft ESB Scripting Example
Extending Apache Spark – Beyond Spark Session Extensions
.NetRAF 2017: Big data en Azure
PGConf.ASIA 2019 Bali - A step towards SQL/MED - DATALINK - Gilles Darold
View, Store Procedure & Function and Trigger in MySQL - Thaipt
Ad

Similar to Introdcution to Cassandra for RDB Folks (20)

PDF
Cassandra Day Chicago 2015: CQL: This is not he SQL you are looking for
PDF
Sql Server Query Parameterization
PDF
Introduction to Databases - query optimizations for MySQL
PPTX
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
PPTX
CQL: This is not the SQL you are looking for.
PDF
Sql coding-standard-sqlserver
PDF
Cassandra
PPTX
Query parameterization
PPTX
SQL_for_Azure_Data_Engineer_basic_to_adv
PPTX
SQL Assessment Command Statements
PDF
Database Management Systems s-sql-ddl.pdf
PDF
DBMS_sql-ddl_V1.pdf890 ddl dml dql TCL DCL
PPT
Introduction to Threading in .Net
PDF
PPT
INTRODUCTION TO SQL QUERIES REALTED BRIEF
POTX
Oracle vs. SQL Server- War of the Indices
PDF
Really Big Elephants: PostgreSQL DW
PDF
Database development coding standards
PPTX
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Cassandra Day Chicago 2015: CQL: This is not he SQL you are looking for
Sql Server Query Parameterization
Introduction to Databases - query optimizations for MySQL
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
CQL: This is not the SQL you are looking for.
Sql coding-standard-sqlserver
Cassandra
Query parameterization
SQL_for_Azure_Data_Engineer_basic_to_adv
SQL Assessment Command Statements
Database Management Systems s-sql-ddl.pdf
DBMS_sql-ddl_V1.pdf890 ddl dml dql TCL DCL
Introduction to Threading in .Net
INTRODUCTION TO SQL QUERIES REALTED BRIEF
Oracle vs. SQL Server- War of the Indices
Really Big Elephants: PostgreSQL DW
Database development coding standards
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Ad

Recently uploaded (20)

PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
Architecture types and enterprise applications.pdf
PDF
August Patch Tuesday
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
A novel scalable deep ensemble learning framework for big data classification...
DOCX
search engine optimization ppt fir known well about this
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPT
Geologic Time for studying geology for geologist
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Getting Started with Data Integration: FME Form 101
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Architecture types and enterprise applications.pdf
August Patch Tuesday
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
A contest of sentiment analysis: k-nearest neighbor versus neural network
A novel scalable deep ensemble learning framework for big data classification...
search engine optimization ppt fir known well about this
Taming the Chaos: How to Turn Unstructured Data into Decisions
O2C Customer Invoices to Receipt V15A.pptx
1 - Historical Antecedents, Social Consideration.pdf
Geologic Time for studying geology for geologist
NewMind AI Weekly Chronicles – August ’25 Week III
Group 1 Presentation -Planning and Decision Making .pptx
observCloud-Native Containerability and monitoring.pptx
Hindi spoken digit analysis for native and non-native speakers
Benefits of Physical activity for teenagers.pptx
Getting Started with Data Integration: FME Form 101
Zenith AI: Advanced Artificial Intelligence
Getting started with AI Agents and Multi-Agent Systems
Univ-Connecticut-ChatGPT-Presentaion.pdf

Introdcution to Cassandra for RDB Folks

  • 1. Cassandra for MySQL Folks Solomon Chang skevin521@yahoo.com
  • 2. Cassandra as a NoSQL platform NoSQL has been retroactively re-acronymed as “Not Only SQL”. Cassandra uses its own query language, CQL. CQL has many aspects of SQL, but could be considered a scaled down version of Structured Query Language.
  • 3. Cassandra sorta looks like MySQL except... ● Databases are called “Keyspaces” ● Tables are called “Column Families” ● Port 9160 instead of 3306 ● Client prompt called with cqlsh instead of mysql
  • 4. And CQL looks kinda like SQL except... SQL CQL SHOW DATABASES DESCRIBE KEYSPACES CREATE DATABASE... CREATE KEYSPACE... CREATE TABLE... CREATE COLUMNFAMILY... SHOW CREATE TABLE... DESCRIBE COLUMNFAMILY...
  • 5. And CREATE looks kinda similar except... CREATE COLUMNFAMILY... ● Never uses auto_increment ● Never uses NOT NULL ● Never uses DEFAULT ● Never uses array qualifiers [e.g. varchar(8)] ● Indexes “kludged” to a separate space
  • 6. Getting used to new data types MySQL TEXT BIGINT BLOB BIT DECIMAL DOUBLE FLOAT INT ENUM TEXT TIMESTAMP VARCHAR CQL ASCII BIGINT BLOB BOOLEAN COUNTER DECIMAL DOUBLE FLOAT INET INT LIST MAP SET TEXT TIMESTAMP UUID TIMEUUID VARCHAR
  • 7. Not all Data Types have a partner ● ENUM(x,y,z,etc.) ● DATE() ● DATETIME() ● TIME() ● YEAR()
  • 8. CQL SELECTs do not: ● Support Joins ● Support aggregate functions (AVG, SUM, etc) ● Support expressions ● Seem to be satisfied with Double Quotes
  • 9. But at least WHERE is still the same SELECT * FROM users WHERE fname = 'Solomon'; ^^^^^^^^^^^^^^^^^^ ● Except all fields referenced by WHERE must be indexed or primary key ● ...And all comparisons are strictly by EQ, not GT or LT
  • 10. Inserts INSERT syntax is almost the same, except: ● A conflicting PK will replace the matching entry! ● You have to specify your own PK value. ● No SELECT statements for large groups of inserts. VALUE statements only!
  • 11. Updates/Deletes UPDATE and DELETE are pretty much the same, except: ● No performing Joins on an UPDATE or DELETE ● WHERE clauses must reference a PK field
  • 12. However, this frees up memory that might have been used on: ● A Join buffer ● A Sort buffer Or heaven forbid ● A query cache
  • 13. Missing functionality offloaded to client side ● Sorts: large data sets cannot use ORDER BY. They must be sorted on the client. ● Aggregates: the client side will have to parse the data for records matching a certain criteria and perform the aggregate function on it. ● Joins: the client side will simply have to make additional calls to the database for records matching FKs.
  • 14. So why use Cassandra? (Or any other NoSQL solution for that matter?) ● Speed ● Scalability
  • 15. Cassandra for MySQL Folks Solomon Chang skevin521@yahoo.com