Migrating SQL applications to Cassandra – Pattern #4

Pattern #4: Get rid of all OR operators from sql where clauses. For example, consider an SQL requirement to authenticate user by comparing the string entered by the user with either username or email or phone: select u1.* from user u1 where (u1.username = ?1 or u1.email = ?1 or u1.phone = ?1) and u1.password = … Continue reading Migrating SQL applications to Cassandra – Pattern #4

Cassandra Migration Tips

#1. Cassandra allows creating a composite primary key (primary key consisting of more than one columns - first part being partition key and rest being clustering keys) For any queries using a composite pk column without including all of its partitioning key columns will require an index for lookup. For example: CREATE TABLE test.groupmechanism ( … Continue reading Cassandra Migration Tips

Migrating SQL applications to Cassandra – Strategy

Today's typical Java application consists of SQL statements defined either using Data Access Object pattern or Java Persistence Query Language (JPQL). These SQLs can be categorized into three categories: Simple SQL: These are one table SQLs like select * from Employee where employeeID=1 Simple multi-table SQL: These are simple SQLs but involve more than one … Continue reading Migrating SQL applications to Cassandra – Strategy