Skip to content
Tutorials Center
My learning

Topics

Cassandra and Neo4j (NoSQL families) Tutorial

Learn Cassandra and Neo4j (NoSQL families) step by step: 30 lessons in 10 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Wide-Column and Graph Databases

  1. 1 The NoSQL families and when to choose them Tour the four NoSQL families, learn CAP and PACELC in plain language, and see when a wide-column or graph database beats a relational one.

The Two Architectures

  1. 2 Cassandra architecture in one picture See how Cassandra spreads data over a peer-to-peer ring of nodes, how token ranges decide ownership and how the replication factor keeps copies.
  2. 3 Neo4j and the property graph model Learn the property graph model used by Neo4j: nodes, relationships, labels and properties, plus why index-free adjacency makes traversals cheap.

Cassandra Data Model

  1. 4 CQL: keyspaces, tables and basic queries Learn CQL, the Cassandra Query Language: create keyspaces and tables, then INSERT, SELECT, UPDATE and DELETE, and see how it differs from SQL.
  2. 5 Partition keys and clustering keys Understand the anatomy of a Cassandra primary key: the partition key that picks the node and the clustering columns that sort rows inside a partition.
  3. 6 Query-first data modeling Learn query-first modeling for Cassandra: list your queries, build one table per query, duplicate data on purpose, and keep the copies in step.
  4. 7 Data types, collections and UDTs Learn the Cassandra types you will use daily: uuid and timeuuid, timestamp, decimal, list, set, map, frozen values, user-defined types and counters.
  5. 8 Time-series and bucketing patterns Model sensor and event data in Cassandra: time buckets that cap partition size, clustering order DESC, TTL expiry and how to read across buckets.

How Cassandra Works Inside

  1. 9 The write path: commit log, memtable, SSTable See why Cassandra writes are fast: append to a commit log, update an in-memory memtable, flush immutable SSTables. Includes a runnable LSM stand-in.
  2. 10 The read path, bloom filters and compaction Follow a Cassandra read through the memtable and SSTables, learn how bloom filters skip files, and compare STCS, LCS and TWCS compaction strategies.
  3. 11 Replication and tunable consistency Understand replication factor and Cassandra consistency levels (ONE, QUORUM, ALL), the R+W>N rule, hinted handoff, read repair and anti-entropy repair.
  4. 12 Deletes, TTL and tombstones Learn how Cassandra deletes data with tombstones, what gc_grace_seconds protects, why zombie data returns, and how to avoid tombstone-heavy reads.

Cassandra in Practice

  1. 13 Lightweight transactions, batches and counters Learn when Cassandra's IF NOT EXISTS (lightweight transactions) is worth its cost, how logged and unlogged batches really work, and where counters bite.
  2. 14 Secondary indexes, SAI and materialized views Why Cassandra secondary indexes are risky, what Storage-Attached Indexes change, why materialized views are experimental, and when to denormalize instead.
  3. 15 Multi-datacenter setups and security Configure Cassandra across datacenters with NetworkTopologyStrategy and LOCAL_QUORUM, then lock it down with roles, permissions, TLS and audit logging.
  4. 16 Drivers, nodetool and production pitfalls Connect to Cassandra with the Python and Java drivers, use prepared statements and token-aware routing, read nodetool output and avoid common anti-patterns.

Cypher and Graph Modeling

  1. 17 Cypher: MATCH, CREATE and patterns Learn Cypher, Neo4j's query language: draw patterns with ASCII art, create nodes and relationships, match them, filter with WHERE and return properties.
  2. 18 Cypher: MERGE, SET, DELETE and constraints Change a Neo4j graph safely with Cypher: idempotent MERGE, SET and REMOVE, DELETE versus DETACH DELETE, plus uniqueness constraints and indexes.
  3. 19 Paths, aggregation and WITH Learn Cypher variable-length paths, shortestPath, count and collect, WITH pipelines, OPTIONAL MATCH, ORDER BY and LIMIT, with runnable Python stand-ins.
  4. 20 Graph data modeling Learn how to model data as a graph: when to use nodes, properties or relationships, how to name types and pick directions, and how to avoid supernodes.

Graph Algorithms and Applications

  1. 21 Query performance: indexes, EXPLAIN and PROFILE Speed up Cypher queries: range and text indexes, reading EXPLAIN and PROFILE plans, counting db hits, avoiding cartesian products and using parameters.
  2. 22 Graph algorithms: PageRank, communities, shortest paths See how Neo4j's Graph Data Science library runs PageRank, community detection, betweenness and Dijkstra, and build each idea yourself in Python.
  3. 23 Recommendations and fraud detection with graphs Use graph patterns for collaborative filtering, friend-of-friend suggestions and fraud rings built on shared identifiers, with Cypher and Python stand-ins.

Projects

  1. 24 Project: a social network on a graph Model users, follows and posts in Neo4j, then write the Cypher for a feed, mutual friends and follow suggestions, with JavaScript stand-ins you can run.
  2. 25 Project: an event and order store on Cassandra Design a Cassandra event and order store from its queries: bucketed events, order history by user, and consistency choices, with Python stand-ins.
  3. 26 Project: a knowledge graph Build a small knowledge graph: entities, typed relationships, a CSV import with LOAD CSV and MERGE, and path queries that explain how things connect.

Practice

  1. 27 Practice exercises with solutions Eight hands-on exercises for CQL and Cypher: data modeling, query rules, consistency math, friend suggestions and MERGE, with worked solutions.
  2. 28 Cassandra, Neo4j, or something else? A practical decision guide for Cassandra, Neo4j and relational databases: workloads, scaling, hybrid designs, common mistakes and migrating from SQL.

Interviews and Cheat Sheet

  1. 29 Interview questions and answers Prepare for Cassandra and Neo4j interviews: CAP, partitioning, consistency, compaction, tombstones, Cypher patterns and modeling, with model answers.
  2. 30 Cassandra and Neo4j cheat sheet A one-page reference for CQL and Cypher syntax, Cassandra consistency levels, modeling rules and common pitfalls, with a searchable stand-in.