{"id":4719,"date":"2025-08-22T09:40:21","date_gmt":"2025-08-22T09:40:21","guid":{"rendered":"https:\/\/uplatz.com\/blog\/?p=4719"},"modified":"2025-08-30T11:56:41","modified_gmt":"2025-08-30T11:56:41","slug":"cassandra-pocket-book","status":"publish","type":"post","link":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/","title":{"rendered":"Cassandra Pocket Book"},"content":{"rendered":"<p><!-- Cassandra Pocket Book \u2014 Uplatz (50 Cards, Wide Layout, Readable Code, Scoped Styles) --><\/p>\n<div style=\"margin: 16px 0;\">\n<style>\n    .wp-nodejs-pb { font-family: Arial, sans-serif; max-width: 1320px; margin:0 auto; }<br \/>\n    .wp-nodejs-pb .heading{<br \/>\n      background: linear-gradient(135deg, #e0f2fe, #ccfbf1); \/* lighter gradient *\/<br \/>\n      color:#0f172a; padding:22px 24px; border-radius:14px;<br \/>\n      text-align:center; margin-bottom:18px; box-shadow:0 8px 20px rgba(0,0,0,.08);<br \/>\n      border:1px solid #cbd5e1;<br \/>\n    }<br \/>\n    .wp-nodejs-pb .heading h2{ margin:0; font-size:2.1rem; letter-spacing:.2px; }<br \/>\n    .wp-nodejs-pb .heading p{ margin:6px 0 0; font-size:1.02rem; opacity:.9; }<\/p>\n<p>    \/* Wide, dense grid *\/<br \/>\n    .wp-nodejs-pb .grid{<br \/>\n      display:grid; gap:14px;<br \/>\n      grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));<br \/>\n    }<br \/>\n    @media (min-width:1200px){<br \/>\n      .wp-nodejs-pb .grid{ grid-template-columns: repeat(3, 1fr); }<br \/>\n    }<\/p>\n<p>    .wp-nodejs-pb .section-title{<br \/>\n      grid-column:1\/-1; background:#f8fafc; border-left:8px solid #0ea5e9;<br \/>\n      padding:12px 16px; border-radius:10px; font-weight:700; color:#0f172a; font-size:1.08rem;<br \/>\n      box-shadow:0 2px 8px rgba(0,0,0,.05); border:1px solid #e2e8f0;<br \/>\n    }<br \/>\n    .wp-nodejs-pb .card{<br \/>\n      background:#ffffff; border-left:6px solid #0ea5e9;<br \/>\n      padding:18px; border-radius:12px;<br \/>\n      box-shadow:0 6px 14px rgba(0,0,0,.06);<br \/>\n      transition:transform .12s ease, box-shadow .12s ease;<br \/>\n      border:1px solid #e5e7eb;<br \/>\n    }<br \/>\n    .wp-nodejs-pb .card:hover{ transform: translateY(-3px); box-shadow:0 10px 22px rgba(0,0,0,.08); }<br \/>\n    .wp-nodejs-pb .card h3{ margin:0 0 10px; font-size:1.12rem; color:#0f172a; }<br \/>\n    .wp-nodejs-pb .card p{ margin:0; font-size:.96rem; color:#334155; line-height:1.62; }<\/p>\n<p>    \/* Color helpers *\/<br \/>\n    .bg-blue { border-left-color:#0ea5e9 !important; background:#f0f9ff !important; }<br \/>\n    .bg-green{ border-left-color:#10b981 !important; background:#f0fdf4 !important; }<br \/>\n    .bg-amber{ border-left-color:#f59e0b !important; background:#fffbeb !important; }<br \/>\n    .bg-violet{ border-left-color:#8b5cf6 !important; background:#f5f3ff !important; }<br \/>\n    .bg-rose{ border-left-color:#ef4444 !important; background:#fff1f2 !important; }<br \/>\n    .bg-cyan{ border-left-color:#06b6d4 !important; background:#ecfeff !important; }<br \/>\n    .bg-lime{ border-left-color:#16a34a !important; background:#f0fdf4 !important; }<br \/>\n    .bg-orange{ border-left-color:#f97316 !important; background:#fff7ed !important; }<br \/>\n    .bg-indigo{ border-left-color:#6366f1 !important; background:#eef2ff !important; }<br \/>\n    .bg-emerald{ border-left-color:#22c55e !important; background:#ecfdf5 !important; }<br \/>\n    .bg-slate{ border-left-color:#334155 !important; background:#f8fafc !important; }<\/p>\n<p>    \/* Utilities *\/<br \/>\n    .tight ul{ margin:0; padding-left:18px; }<br \/>\n    .tight li{ margin:4px 0; }<br \/>\n    .mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }<br \/>\n    .kbd{ background:#e5e7eb; border:1px solid #cbd5e1; padding:1px 6px; border-radius:6px; font-family:ui-monospace,monospace; font-size:.88em; }<br \/>\n    .muted{ color:#64748b; }<br \/>\n    .wp-nodejs-pb code{ background:#f1f5f9; padding:0 4px; border-radius:4px; border:1px solid #e2e8f0; }<br \/>\n    .wp-nodejs-pb pre{<br \/>\n      background:#f5f5f5; color:#111827; border:1px solid #e5e7eb;<br \/>\n      padding:12px; border-radius:8px; overflow:auto; font-size:.92rem; line-height:1.55;<br \/>\n    }<br \/>\n    .q{font-weight:700;}<\/p>\n<p>    \/* Make long Q&A easier to scan inside a card *\/<br \/>\n    .qa p{ margin:8px 0; }<br \/>\n    .qa b{ color:#0f172a; }<br \/>\n  <\/style>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-5074\" src=\"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra-1024x576.jpg\" alt=\"\" width=\"840\" height=\"473\" srcset=\"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra-1024x576.jpg 1024w, https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra-300x169.jpg 300w, https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra-768x432.jpg 768w, https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra.jpg 1280w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/p>\n<div class=\"wp-nodejs-pb\">\n<div class=\"heading\">\n<h2>Cassandra Pocket Book \u2014 Uplatz<\/h2>\n<p>50 deep-dive flashcards \u2022 Wide layout \u2022 Fewer scrolls \u2022 20+ Interview Q&amp;A \u2022 Readable code examples<\/p>\n<\/div>\n<div class=\"grid\"><!-- ===================== SECTION 1 ===================== --><\/p>\n<div class=\"section-title\">Section 1 \u2014 Fundamentals<\/div>\n<div class=\"card bg-blue\">\n<h3>1) What is Cassandra?<\/h3>\n<p>Apache Cassandra is a distributed, wide-column database designed for high write throughput, linear horizontal scaling, and fault tolerance with no single point of failure. It uses a masterless <em>peer-to-peer<\/em> architecture where any node can accept reads\/writes, replicating data across nodes and data centers. Cassandra excels at time\u2011series, event logging, IoT, user activity feeds, and workloads that favor write-heavy, append\u2011style operations with predictable low latency.<\/p>\n<pre><code class=\"mono\"># Quick feel: run cqlsh in a test cluster\r\ncqlsh -e \"SHOW VERSION;\"\r\n# or with Docker (example)\r\ndocker run -d --name cass -p 9042:9042 cassandra:latest<\/code><\/pre>\n<\/div>\n<div class=\"card bg-green\">\n<h3>2) Why Cassandra? Core Strengths &amp; Tradeoffs<\/h3>\n<p><b>Strengths:<\/b> Always\u2011on availability, tunable consistency per operation, massive write scalability, and data distribution via consistent hashing. <b>Tradeoffs:<\/b> Query patterns must be modeled up front (no ad\u2011hoc joins), secondary indexes are limited, and large partitions\/tombstones can hurt performance. Design \u201cquery\u2011first,\u201d keep partitions bounded, and use <code>replication_factor<\/code> with quorum reads\/writes for strong guarantees.<\/p>\n<pre><code class=\"mono\"># Create a project keyspace quickly (example replication)\r\nCREATE KEYSPACE app WITH replication = {\r\n  'class':'NetworkTopologyStrategy','dc1':3,'dc2':3\r\n} AND durable_writes = true;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-amber\">\n<h3>3) Data Model: Mental Model<\/h3>\n<p>Think in <b>partitions<\/b> and <b>clustering<\/b>. The <b>partition key<\/b> decides which nodes store the data (via token ring), and <b>clustering columns<\/b> define on\u2011disk order inside a partition. Primary key = <code>(partition_key[, clustering...])<\/code>. Model tables by access pattern: one table per query shape, denormalize, and <em>avoid unbounded partitions<\/em> with time bucketing.<\/p>\n<pre><code class=\"mono\">CREATE TABLE events (\r\n  user_id uuid,\r\n  day text,                 -- partition bucket (e.g., '2025-08-22')\r\n  ts timeuuid,              -- clustering for ordering\r\n  type text,\r\n  payload text,\r\n  PRIMARY KEY ((user_id, day), ts)\r\n) WITH CLUSTERING ORDER BY (ts DESC);\r\n-- Query pattern: by user &amp; day, latest first<\/code><\/pre>\n<p class=\"muted\">Rule of thumb: bound partitions (e.g., by day\/month) and pre\u2011compute query shapes.<\/p>\n<\/div>\n<div class=\"card bg-violet\">\n<h3>4) Storage Engine &amp; Compaction<\/h3>\n<p>Writes go to the <b>commit log<\/b> and an in\u2011memory <b>memtable<\/b>; when flushed, they become immutable <b>SSTables<\/b>. Background <b>compaction<\/b> merges SSTables, purges tombstones past <code>gc_grace_seconds<\/code>, and reduces read amplification. Pick a compaction strategy by workload: <b>STCS<\/b> (general), <b>LCS<\/b> (read\u2011heavy, small SSTables), <b>TWCS<\/b> (time\u2011series with TTL).<\/p>\n<pre><code class=\"mono\">ALTER TABLE events WITH compaction = {\r\n  'class':'TimeWindowCompactionStrategy',\r\n  'compaction_window_unit':'DAYS',\r\n  'compaction_window_size':'1'\r\n};<\/code><\/pre>\n<\/div>\n<div class=\"card bg-rose\">\n<h3>5) Cassandra vs RDBMS<\/h3>\n<p>RDBMS favor normalized schemas, joins, and strong consistency; Cassandra favors denormalization, query\u2011specific tables, and horizontal scale with tunable consistency. You trade ad\u2011hoc flexibility for predictable, low\u2011latency operations at scale. Use analytics engines (Spark\/Presto) for heavy joins over snapshots, not the OLTP cluster.<\/p>\n<pre><code class=\"mono\">-- No joins; pre\u2011compute\r\nCREATE TABLE user_by_email (email text PRIMARY KEY, user_id uuid);\r\nCREATE TABLE user_profile (\r\n  user_id uuid PRIMARY KEY, email text, name text\r\n);<\/code><\/pre>\n<\/div>\n<div class=\"card bg-cyan\">\n<h3>6) CQL, Drivers &amp; Tooling<\/h3>\n<p><b>CQL<\/b> is SQL\u2011like for DDL\/DML; use official drivers (Java\/Python\/Node\/Go). <b>cqlsh<\/b> for queries, <b>nodetool<\/b> for operations. Always use prepared statements and token\u2011aware load balancing.<\/p>\n<pre><code class=\"mono\"># cqlsh helpers\r\nDESCRIBE KEYSPACES;\r\nCONSISTENCY QUORUM;\r\nCONSISTENCY LOCAL_QUORUM;  -- multi\u2011DC best practice<\/code><\/pre>\n<\/div>\n<div class=\"card bg-lime\">\n<h3>7) Keyspaces &amp; Replication<\/h3>\n<p>A keyspace groups tables and defines <b>replication<\/b>. Use <code>NetworkTopologyStrategy<\/code> in production to specify per\u2011DC replication factors. <b>Quorum<\/b> (\u2308RF\/2\u2309+1) reads\/writes ensure no stale data when one replica is down. Keep RF \u2265 3 per DC for resilience.<\/p>\n<pre><code class=\"mono\">CREATE KEYSPACE auth WITH replication = {\r\n  'class':'NetworkTopologyStrategy','dc1':3\r\n};<\/code><\/pre>\n<\/div>\n<div class=\"card bg-orange\">\n<h3>8) Releases &amp; Compatibility<\/h3>\n<p>Run a stable GA release for production, test upgrades thoroughly in staging, and roll out per rack\/DC. Stick to supported drivers matching your server version. Pin configs in code and infrastructure for reproducible clusters.<\/p>\n<pre><code class=\"mono\"># Pin Docker image in infra code\r\ncassandra:4.x\r\n# Keep server &amp; driver versions compatible<\/code><\/pre>\n<\/div>\n<div class=\"card bg-indigo\">\n<h3>9) n\u2011node Clusters &amp; Multi\u2011DC<\/h3>\n<p>Any node can serve requests. For multi\u2011DC, use <b>LOCAL_QUORUM<\/b> to avoid cross\u2011DC latency, and <b>LOCAL_ONE<\/b> for low\u2011latency reads when staleness is acceptable. Use rack\u2011aware snitches to spread replicas.<\/p>\n<pre><code class=\"mono\"># Driver setting (pseudo)\r\nloadBalancingPolicy: tokenAware(localDc=\"dc1\")<\/code><\/pre>\n<\/div>\n<div class=\"card bg-emerald\">\n<h3>10) Q&amp;A \u2014 \u201cIf there\u2019s no primary leader, how does Cassandra stay consistent?\u201d<\/h3>\n<p><span class=\"q\">Answer:<\/span> Replicas coordinate via quorum reads\/writes and hinted handoff. Read paths can <em>repair on read<\/em> to fix divergence. With RF\u22653 and QUORUM\/LOCAL_QUORUM, overlapping replica sets ensure the latest write is seen even with node failures.<\/p>\n<\/div>\n<p><!-- ===================== SECTION 2 ===================== --><\/p>\n<div class=\"section-title\">Section 2 \u2014 Core CQL &amp; Architecture<\/div>\n<div class=\"card bg-blue\">\n<h3>11) Tables &amp; Primary Keys<\/h3>\n<p>Primary key defines distribution and sort. Use composite keys to group related rows in the same partition and order them by clustering columns. Avoid large static columns unless needed for metadata.<\/p>\n<pre><code class=\"mono\">CREATE TABLE orders (\r\n  shop_id text,\r\n  yyyymm text,\r\n  created_at timeuuid,\r\n  order_id uuid,\r\n  amount decimal,\r\n  PRIMARY KEY ((shop_id, yyyymm), created_at)\r\n) WITH CLUSTERING ORDER BY (created_at DESC);<\/code><\/pre>\n<\/div>\n<div class=\"card bg-green\">\n<h3>12) Read\/Write Path<\/h3>\n<p><b>Write:<\/b> coordinator \u2192 replicas (based on partitioner tokens) \u2192 commit log + memtable \u2192 flush to SSTable. <b>Read:<\/b> coordinator queries replicas (per CL), merges results using <em>bloom filters<\/em>, <em>indexes<\/em>, and <em>summary<\/em>, then returns the latest value by timestamp.<\/p>\n<pre><code class=\"mono\">CONSISTENCY LOCAL_QUORUM;\r\nINSERT INTO orders (shop_id, yyyymm, created_at, order_id, amount)\r\nVALUES ('s1','202508','NOW()', uuid(), 19.99);<\/code><\/pre>\n<\/div>\n<div class=\"card bg-amber\">\n<h3>13) Consistency Levels<\/h3>\n<p>Per operation you pick CL: <b>ALL<\/b>, <b>QUORUM<\/b>, <b>LOCAL_QUORUM<\/b>, <b>ONE<\/b>, etc. For multi\u2011DC apps, use <b>LOCAL_QUORUM<\/b>. Mix <b>LOCAL_QUORUM<\/b> writes with <b>LOCAL_QUORUM<\/b> reads for strong guarantees; use <b>ONE<\/b> for latency\u2011critical but possibly stale reads.<\/p>\n<pre><code class=\"mono\">CONSISTENCY ONE;           -- fastest\r\nCONSISTENCY QUORUM;        -- stronger\r\nCONSISTENCY LOCAL_QUORUM;  -- multi\u2011DC safe default<\/code><\/pre>\n<\/div>\n<div class=\"card bg-violet\">\n<h3>14) Compaction Strategies<\/h3>\n<p><b>STCS<\/b> merges similarly\u2011sized SSTables; <b>LCS<\/b> organizes levels for read\u2011heavy workloads; <b>TWCS<\/b> uses time windows for TTL\u2019d data. Choose per table; compaction is CPU\/IO heavy \u2014 monitor and tune.<\/p>\n<pre><code class=\"mono\">ALTER TABLE orders WITH compaction = {\r\n  'class':'LeveledCompactionStrategy',\r\n  'sstable_size_in_mb':'160'\r\n};<\/code><\/pre>\n<\/div>\n<div class=\"card bg-rose\">\n<h3>15) Tombstones &amp; GC Grace<\/h3>\n<p>Deletes create <b>tombstones<\/b> which are purged after compaction past <code>gc_grace_seconds<\/code>. Premature purging can resurrect data during repair; too many tombstones slow reads. Prefer <code>TTL<\/code> for expiry and avoid wide\u2011range deletes.<\/p>\n<pre><code class=\"mono\">ALTER TABLE events WITH gc_grace_seconds = 86400; -- 1 day\r\nDELETE FROM events WHERE user_id=? AND day=? AND ts=?;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-cyan\">\n<h3>16) Partitioner &amp; Token Ring<\/h3>\n<p>Consistent hashing assigns token ranges to nodes (virtual nodes split ownership). The partition key\u2019s hash decides placement; hot partitions overload specific nodes \u2014 prevent by adding a bucketing field or random salt.<\/p>\n<pre><code class=\"mono\">-- Bucketing to avoid hot partition\r\nPRIMARY KEY ((tenant_id, day_bucket), ts)<\/code><\/pre>\n<\/div>\n<div class=\"card bg-lime\">\n<h3>17) Gossip, Snitches &amp; Topology<\/h3>\n<p><b>Gossip<\/b> shares node liveness; <b>snitches<\/b> tell Cassandra about racks\/DCs to place replicas. Use a rack\u2011aware snitch and consistent rack labels in config\/infra. Topology drives RF and request routing.<\/p>\n<pre><code class=\"mono\"># cassandra.yaml (snippet)\r\nendpoint_snitch: GossipingPropertyFileSnitch<\/code><\/pre>\n<\/div>\n<div class=\"card bg-orange\">\n<h3>18) Hinted Handoff &amp; Read Repair<\/h3>\n<p><b>Hints<\/b> store missed writes when a replica is down, replayed on recovery. <b>Read repair<\/b> (coordinator\u2011driven) fixes divergent replicas during reads. Run <b>anti\u2011entropy repair<\/b> regularly for full consistency.<\/p>\n<pre><code class=\"mono\">nodetool repair keyspace_name --full\r\nnodetool status<\/code><\/pre>\n<\/div>\n<div class=\"card bg-indigo\">\n<h3>19) RF, Quorum Math &amp; Locality<\/h3>\n<p>With RF=3 per DC: QUORUM=2, so overlapping quorums guarantee the latest write is returned. Prefer LOCAL_* CLs to keep traffic inside a DC; cross\u2011DC is for replication, not read paths.<\/p>\n<pre><code class=\"mono\">-- Example per\u2011DC RF\r\n{'class':'NetworkTopologyStrategy','dc1':3,'dc2':3}<\/code><\/pre>\n<\/div>\n<div class=\"card bg-emerald\">\n<h3>20) Q&amp;A \u2014 \u201cHow do I choose a primary key?\u201d<\/h3>\n<p><span class=\"q\">Answer:<\/span> Start from queries. Group rows that you read together into the same partition (partition key) and order them via clustering columns that match your sort\/filters. Keep partitions bounded (time buckets) and avoid high\u2011cardinality clustering that causes read amplification.<\/p>\n<\/div>\n<p><!-- ===================== SECTION 3 ===================== --><\/p>\n<div class=\"section-title\">Section 3 \u2014 Consistency, Patterns &amp; Operations<\/div>\n<div class=\"card bg-blue\">\n<h3>21) Query\u2011First Modeling<\/h3>\n<p>List each API screen\/report and design tables for those exact access patterns. Denormalize across tables to serve different queries. Embrace duplication; storage is cheap, cross\u2011partition joins are not.<\/p>\n<pre><code class=\"mono\">-- Feed by user\r\nCREATE TABLE feed_by_user (\r\n  user_id uuid, day text, ts timeuuid, item text,\r\n  PRIMARY KEY ((user_id, day), ts)\r\n);\r\n-- Global feed (sharded)\r\nCREATE TABLE feed_global (\r\n  shard int, day text, ts timeuuid, item text,\r\n  PRIMARY KEY ((shard, day), ts)\r\n);<\/code><\/pre>\n<\/div>\n<div class=\"card bg-green\">\n<h3>22) Materialized Views &amp; Alternatives<\/h3>\n<p>Materialized Views can mirror data with a different primary key, but come with operational caveats. Many teams prefer <b>manual fan\u2011out<\/b> to multiple tables using batches for atomicity per partition, or <b>CDC + stream processors<\/b> to maintain derived views.<\/p>\n<pre><code class=\"mono\">-- Alternative to MV: write to multiple tables in one go\r\nBEGIN BATCH\r\n  INSERT INTO feed_by_user ...;\r\n  INSERT INTO feed_global ...;\r\nAPPLY BATCH;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-amber\">\n<h3>23) Lightweight Transactions (LWT)<\/h3>\n<p>LWT (Paxos) provide <b>compare\u2011and\u2011set<\/b> semantics for rare conditional updates (idempotent upserts, uniqueness). They are slower than normal writes; use sparingly and keep partitions small.<\/p>\n<pre><code class=\"mono\">-- Ensure unique username\r\nINSERT INTO users (username, id) VALUES ('alice', uuid()) IF NOT EXISTS;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-violet\">\n<h3>24) Batches: Logged vs Unlogged<\/h3>\n<p><b>Logged<\/b> batches ensure atomicity across <em>partitions<\/em> at higher cost; <b>unlogged<\/b> batches are just a network optimization for same\u2011partition writes. Prefer small batches; don\u2019t use as a bulk\u2011loader.<\/p>\n<pre><code class=\"mono\">BEGIN UNLOGGED BATCH\r\n  INSERT INTO events ...;\r\n  INSERT INTO events ...;\r\nAPPLY BATCH;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-rose\">\n<h3>25) Repairs<\/h3>\n<p>Run <b>incremental repairs<\/b> regularly to reconcile replicas; do <b>full repairs<\/b> after topology changes. Stagger by keyspace\/table and monitor throughput. Repairs prevent tombstone resurrection and ensure durability.<\/p>\n<pre><code class=\"mono\">nodetool repair ks_name --incremental\r\nnodetool compactionstats<\/code><\/pre>\n<\/div>\n<div class=\"card bg-cyan\">\n<h3>26) Scaling: Bootstrap &amp; Decommission<\/h3>\n<p>Add nodes by <b>bootstrapping<\/b>, which streams data for token ranges; remove with <b>decommission<\/b>. In Kubernetes, use StatefulSets with proper seeds and rack labels; in VMs, automate with config management.<\/p>\n<pre><code class=\"mono\">nodetool bootstrap\r\nnodetool decommission\r\nnodetool rebuild -- dc2<\/code><\/pre>\n<\/div>\n<div class=\"card bg-lime\">\n<h3>27) TTL &amp; Expiration<\/h3>\n<p>Use <code>TTL<\/code> to auto\u2011expire rows (great for time\u2011series). Combine with <b>TWCS<\/b> for efficient compaction. Beware that expiring data creates tombstones until purged.<\/p>\n<pre><code class=\"mono\">INSERT INTO sessions (user_id, id, created_at)\r\nVALUES (uuid(), uuid(), toTimestamp(now())) USING TTL 86400;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-orange\">\n<h3>28) Denormalization &amp; Bucketing<\/h3>\n<p>Denormalize by writing to multiple tables and bucket by time to bound partitions. For ultra\u2011hot keys, add a <b>shard<\/b> or <b>salt<\/b> to the partition key and keep routing logic in the application.<\/p>\n<pre><code class=\"mono\">PRIMARY KEY ((user_id, shard, yyyymmdd), ts)<\/code><\/pre>\n<\/div>\n<div class=\"card bg-indigo\">\n<h3>29) Timeouts, Retries &amp; Idempotency<\/h3>\n<p>Set driver timeouts, use exponential backoff with jitter, and ensure operations are idempotent. For writes, use <b>idempotency keys<\/b> (e.g., natural keys or timestamps) to avoid duplicates during retries.<\/p>\n<pre><code class=\"mono\"># Pseudocode driver config\r\nrequestTimeout: 2000\r\nretryPolicy: DefaultRetry (idempotent=true)<\/code><\/pre>\n<\/div>\n<div class=\"card bg-emerald\">\n<h3>30) Q&amp;A \u2014 \u201cLWT or redesign?\u201d<\/h3>\n<p><span class=\"q\">Answer:<\/span> If the operation is rare and correctness requires uniqueness, LWT is fine. If it\u2019s frequent or high\u2011throughput, redesign the data model (e.g., reservation tokens, time\u2011bucketed uniqueness) to avoid per\u2011write consensus.<\/p>\n<\/div>\n<p><!-- ===================== SECTION 4 ===================== --><\/p>\n<div class=\"section-title\">Section 4 \u2014 Clients, Data &amp; Integrations<\/div>\n<div class=\"card bg-blue\">\n<h3>31) Java Driver (DataStax)<\/h3>\n<p>Type\u2011safe, token\u2011aware, and DC\u2011aware by default. Use prepared statements, reuse sessions, and expose metrics. Configure local DC and pooling carefully.<\/p>\n<pre><code class=\"mono\">\/\/ Java (pseudo)\r\nCqlSession session = CqlSession.builder()\r\n  .withKeyspace(\"app\").withLocalDatacenter(\"dc1\").build();\r\nPreparedStatement ps = session.prepare(\"INSERT INTO t (k,v) VALUES (?,?)\");\r\nsession.execute(ps.bind(k, v));<\/code><\/pre>\n<\/div>\n<div class=\"card bg-green\">\n<h3>32) Python Driver<\/h3>\n<p>Simple and powerful. Set <code>consistency_level<\/code>, reuse <code>Cluster<\/code>\/<code>Session<\/code>, and prefer prepared statements. Enable execution profiles for different CLs\/timeouts.<\/p>\n<pre><code class=\"mono\">from cassandra.cluster import Cluster, ExecutionProfile\r\nfrom cassandra.policies import DCAwareRoundRobinPolicy\r\ncluster = Cluster(['127.0.0.1'], load_balancing_policy=DCAwareRoundRobinPolicy(\"dc1\"))\r\nsession = cluster.connect('app')\r\nsession.execute(\"INSERT INTO t (k,v) VALUES (%s,%s)\", (1,'a'))<\/code><\/pre>\n<\/div>\n<div class=\"card bg-amber\">\n<h3>33) Node.js Driver<\/h3>\n<p>Use token\u2011aware load balancing and <code>LOCAL_QUORUM<\/code>. Reuse the client, prepare your statements, and batch only for small, related writes.<\/p>\n<pre><code class=\"mono\">import cassandra from 'cassandra-driver';\r\nconst client = new cassandra.Client({ contactPoints:['127.0.0.1'], localDataCenter:'dc1', keyspace:'app' });\r\nawait client.execute('INSERT INTO t (k,v) VALUES (?,?)', [1,'a'], { prepare:true });<\/code><\/pre>\n<\/div>\n<div class=\"card bg-violet\">\n<h3>34) API Layers &amp; GraphQL<\/h3>\n<p>Expose Cassandra via REST\/GraphQL through a service layer. Enforce schema validation, idempotent writes, and pagination. For flexible queries, consider an API gateway that maps approved query shapes to prepared statements.<\/p>\n<pre><code class=\"mono\">\/\/ Example pagination\r\nSELECT * FROM events WHERE user_id=? AND day=? LIMIT 50;\r\n-- Use paging state from driver for next page<\/code><\/pre>\n<\/div>\n<div class=\"card bg-rose\">\n<h3>35) CDC &amp; Streaming<\/h3>\n<p>Enable <b>CDC<\/b> to capture row changes and stream them to Kafka\/Flink for downstream processing (caches, search indexes). Keep CDC volumes manageable; filter at source and compact topics.<\/p>\n<pre><code class=\"mono\"># cassandra.yaml (snippet)\r\ncdc_enabled: true\r\n# Stream CDC directory with an agent to Kafka<\/code><\/pre>\n<\/div>\n<div class=\"card bg-cyan\">\n<h3>36) Time\u2011Series &amp; IoT<\/h3>\n<p>Partition by device\/site + time bucket; cluster by timestamp descending. Use <b>TWCS<\/b> and TTL for lifecycle. Keep wide partitions bounded (e.g., per day) to avoid hotspots and long repairs.<\/p>\n<pre><code class=\"mono\">PRIMARY KEY ((device_id, yyyymmdd), ts)<\/code><\/pre>\n<\/div>\n<div class=\"card bg-lime\">\n<h3>37) Spark &amp; Analytics<\/h3>\n<p>For analytical joins\/aggregations, use the Spark\u2011Cassandra connector to read snapshots with proper split sizes. Do not overload the OLTP cluster; use a separate analytics cluster or schedule off\u2011peak.<\/p>\n<pre><code class=\"mono\">spark.read\r\n  .format(\"org.apache.spark.sql.cassandra\")\r\n  .options(table=\"events\", keyspace=\"app\")\r\n  .load()<\/code><\/pre>\n<\/div>\n<div class=\"card bg-orange\">\n<h3>38) Caching Strategy<\/h3>\n<p>Use client\u2011side caches for hot keys and Redis for derived views. Tune Cassandra\u2019s row\/key caches cautiously; most workloads benefit more from OS page cache and query redesign.<\/p>\n<pre><code class=\"mono\">-- Consider cache\u2011friendly shapes\r\nSELECT ... WHERE partition_key=? LIMIT 20;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-indigo\">\n<h3>39) Backup &amp; Restore<\/h3>\n<p>Take <b>snapshots<\/b> (hard links) and ship SSTables to durable storage. For restores or migrations, use <b>sstableloader<\/b> to stream data into a fresh cluster. Verify backups with periodic test restores.<\/p>\n<pre><code class=\"mono\">nodetool snapshot app\r\n# restore: sstableloader -d &lt;hosts&gt; data\/&lt;ks&gt;\/&lt;table&gt;\/snapshots\/&lt;id&gt;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-emerald\">\n<h3>40) Q&amp;A \u2014 \u201cCassandra vs DynamoDB\/Bigtable?\u201d<\/h3>\n<p><span class=\"q\">Answer:<\/span> All are wide\u2011column\/partitioned stores. Cassandra is open\u2011source, self\u2011managed, multi\u2011DC with tunable consistency; DynamoDB is managed with global tables and serverless ergonomics; Bigtable excels at huge throughput with a managed HBase\u2011like model. Choose based on control, latency locality, and ops preferences.<\/p>\n<\/div>\n<p><!-- ===================== SECTION 5 ===================== --><\/p>\n<div class=\"section-title\">Section 5 \u2014 Security, Testing, Deployment, Observability &amp; Interview Q&amp;A<\/div>\n<div class=\"card bg-blue\">\n<h3>41) Security Fundamentals<\/h3>\n<p>Enable <b>authentication<\/b> and <b>authorization<\/b>, enforce TLS in\u2011transit, restrict nodes via firewalls\/SGs, and rotate credentials. Use roles with least privilege and audit schema changes. Prefer private networking between app and DB.<\/p>\n<pre><code class=\"mono\">-- Role example\r\nCREATE ROLE app_rw WITH LOGIN = true AND PASSWORD = '***' AND SUPERUSER = false;\r\nGRANT MODIFY, SELECT ON KEYSPACE app TO app_rw;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-green\">\n<h3>42) Multi\u2011Tenancy<\/h3>\n<p>Isolate tenants by keyspace or by partition key. For strict isolation, separate clusters or DCs; for soft isolation, use tenant\u2011scoped partitions and role\u2011based access. Encrypt at rest and monitor per\u2011tenant quotas.<\/p>\n<pre><code class=\"mono\">PRIMARY KEY ((tenant_id, bucket), ts)<\/code><\/pre>\n<\/div>\n<div class=\"card bg-amber\">\n<h3>43) Testing Strategy<\/h3>\n<p>Use local single\u2011node clusters (Docker\/ccm) for unit\/integration tests. Seed data, run schema migrations, and verify CL\/timeout behaviors. For load tests, spin ephemeral multi\u2011node clusters to test compaction and repair under stress.<\/p>\n<pre><code class=\"mono\"># Example docker\u2011compose service\r\ncassandra:\r\n  image: cassandra:4\r\n  ports: [\"9042:9042\"]<\/code><\/pre>\n<\/div>\n<div class=\"card bg-violet\">\n<h3>44) Schema Management<\/h3>\n<p>Version DDL alongside app code. Apply forward\u2011only migrations with back\u2011compat readers to allow rolling deploys. Avoid disruptive changes (e.g., primary key changes) \u2014 create new tables and dual\u2011write, then backfill.<\/p>\n<pre><code class=\"mono\">-- Forward\u2011only: add a column\r\nALTER TABLE orders ADD currency text;<\/code><\/pre>\n<\/div>\n<div class=\"card bg-rose\">\n<h3>45) Performance &amp; Tuning<\/h3>\n<p>Measure latency percentiles, monitor pending compactions, and track GC. Tune heap, off\u2011heap, and memtable sizes; avoid swap. Use async compaction, proper disk types, and disable swap. Fix data model hot spots before scaling hardware.<\/p>\n<pre><code class=\"mono\">nodetool tpstats\r\nnodetool tablehistograms app events<\/code><\/pre>\n<\/div>\n<div class=\"card bg-cyan\">\n<h3>46) Deployment Options<\/h3>\n<p>Run on VMs\/bare metal for predictable IO, on Kubernetes with StatefulSets and local SSDs, or choose managed\/serverless variants. Implement readiness\/liveness probes, rack\/DC labels, and rolling node restarts with drain.<\/p>\n<pre><code class=\"mono\"># K8s hints\r\npodAntiAffinity: required\r\nreadinessProbe: nodetool statusbinary<\/code><\/pre>\n<\/div>\n<div class=\"card bg-lime\">\n<h3>47) Observability<\/h3>\n<p>Scrape JMX\/metrics to Prometheus, build dashboards for latency, saturation, and errors. Ship logs centrally, tag by DC\/rack\/node. Alert on repair lag, dropped mutations, and pending compactions. Expose <code>\/health<\/code> on app side and use <code>nodetool status<\/code> for DB state.<\/p>\n<pre><code class=\"mono\"># Prometheus JMX exporter sidecar (conceptually)\r\n- targets: ['cass-0:7070','cass-1:7070']<\/code><\/pre>\n<\/div>\n<div class=\"card bg-orange tight\">\n<h3>48) Prod Checklist<\/h3>\n<ul>\n<li>RF\u22653 per DC, LOCAL_QUORUM by default<\/li>\n<li>Bounded partitions &amp; time buckets<\/li>\n<li>TWCS for TTL\u2019d time\u2011series tables<\/li>\n<li>Regular incremental repairs<\/li>\n<li>Snapshots &amp; tested restores<\/li>\n<li>Dashboards &amp; runbooks for incidents<\/li>\n<\/ul>\n<\/div>\n<div class=\"card bg-indigo\">\n<h3>49) Common Pitfalls<\/h3>\n<p>Unbounded partitions, hot keys, overuse of secondary indexes, giant logged batches, skipping repairs, and deleting large ranges (tombstone storms). Avoid by query\u2011first modeling, bucketing, and steady maintenance.<\/p>\n<\/div>\n<div class=\"card bg-emerald qa\">\n<h3>50) Interview Q&amp;A \u2014 20 Practical Questions (Expanded)<\/h3>\n<p><b>1) Why Cassandra for write\u2011heavy workloads?<\/b> Peer\u2011to\u2011peer design, append\u2011optimized storage, and linear scale.<\/p>\n<p><b>2) How does tunable consistency work?<\/b> Choose CL per op (e.g., LOCAL_QUORUM) to balance latency and consistency.<\/p>\n<p><b>3) Primary vs clustering key?<\/b> Primary defines distribution; clustering defines on\u2011disk order within a partition.<\/p>\n<p><b>4) Avoiding hot partitions?<\/b> Add time buckets\/shards; distribute with salts when necessary.<\/p>\n<p><b>5) When to use LWT?<\/b> Rare uniqueness\/compare\u2011and\u2011set needs; keep payloads small.<\/p>\n<p><b>6) What are tombstones?<\/b> Markers for deletes\/expirations; too many slow reads until purged.<\/p>\n<p><b>7) Repair vs read repair?<\/b> Scheduled anti\u2011entropy vs opportunistic fixes during reads.<\/p>\n<p><b>8) Compaction choice?<\/b> STCS general, LCS read\u2011heavy, TWCS time\u2011series with TTL.<\/p>\n<p><b>9) Multi\u2011DC best practice?<\/b> LOCAL_QUORUM + per\u2011DC RF and rack\u2011aware snitches.<\/p>\n<p><b>10) Secondary indexes?<\/b> Use sparingly; prefer SASI or SAI where available, or model new tables.<\/p>\n<p><b>11) Pagination?<\/b> Use driver paging state; avoid large offsets or ALLOW FILTERING.<\/p>\n<p><b>12) Backups?<\/b> Snapshots + offsite copy; verify with test restores.<\/p>\n<p><b>13) Batch usage?<\/b> Small groups of related writes; avoid as bulk importer.<\/p>\n<p><b>14) GC &amp; memory?<\/b> Tune heap\/off\u2011heap; monitor GC pauses; avoid giant partitions.<\/p>\n<p><b>15) Read latency spikes?<\/b> Check compaction backlog, tombstones, and OS cache misses.<\/p>\n<p><b>16) Data modeling anti\u2011patterns?<\/b> Unbounded partitions, random clustering orders, ALLOW FILTERING reliance.<\/p>\n<p><b>17) Node failures?<\/b> Hinted handoff, repairs, and quorum keep service healthy.<\/p>\n<p><b>18) Observability must\u2011haves?<\/b> p99 read\/write, pending compactions, dropped mutations, repair lag.<\/p>\n<p><b>19) Rolling upgrades?<\/b> One rack\/node at a time, drain\/stop, upgrade, verify, proceed.<\/p>\n<p><b>20) When not to use Cassandra?<\/b> Heavy multi\u2011row transactions, ad\u2011hoc joins\/OLAP inside OLTP cluster.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Cassandra Pocket Book \u2014 Uplatz 50 deep-dive flashcards \u2022 Wide layout \u2022 Fewer scrolls \u2022 20+ Interview Q&amp;A \u2022 Readable code examples Section 1 \u2014 Fundamentals 1) What is Cassandra? <span class=\"readmore\"><a href=\"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/\">Read More &#8230;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2524,2462],"tags":[],"class_list":["post-4719","post","type-post","status-publish","format-standard","hentry","category-cassandra","category-pocket-book"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cassandra Pocket Book | Uplatz Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cassandra Pocket Book | Uplatz Blog\" \/>\n<meta property=\"og:description\" content=\"Cassandra Pocket Book \u2014 Uplatz 50 deep-dive flashcards \u2022 Wide layout \u2022 Fewer scrolls \u2022 20+ Interview Q&amp;A \u2022 Readable code examples Section 1 \u2014 Fundamentals 1) What is Cassandra? Read More ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/\" \/>\n<meta property=\"og:site_name\" content=\"Uplatz Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Uplatz-1077816825610769\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-22T09:40:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-30T11:56:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"uplatzblog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@uplatz_global\" \/>\n<meta name=\"twitter:site\" content=\"@uplatz_global\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"uplatzblog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/\"},\"author\":{\"name\":\"uplatzblog\",\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/#\\\/schema\\\/person\\\/8ecae69a21d0757bdb2f776e67d2645e\"},\"headline\":\"Cassandra Pocket Book\",\"datePublished\":\"2025-08-22T09:40:21+00:00\",\"dateModified\":\"2025-08-30T11:56:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/\"},\"wordCount\":2148,\"publisher\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/Cassandra-1024x576.jpg\",\"articleSection\":[\"Cassandra\",\"Pocket Book\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/\",\"url\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/\",\"name\":\"Cassandra Pocket Book | Uplatz Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/Cassandra-1024x576.jpg\",\"datePublished\":\"2025-08-22T09:40:21+00:00\",\"dateModified\":\"2025-08-30T11:56:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/#primaryimage\",\"url\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/Cassandra.jpg\",\"contentUrl\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/Cassandra.jpg\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/cassandra-pocket-book\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cassandra Pocket Book\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/\",\"name\":\"Uplatz Blog\",\"description\":\"Uplatz is a global IT Training &amp; Consulting company\",\"publisher\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/#organization\",\"name\":\"uplatz.com\",\"url\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/Uplatz-Logo-Copy-2.png\",\"contentUrl\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/Uplatz-Logo-Copy-2.png\",\"width\":1280,\"height\":800,\"caption\":\"uplatz.com\"},\"image\":{\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Uplatz-1077816825610769\\\/\",\"https:\\\/\\\/x.com\\\/uplatz_global\",\"https:\\\/\\\/www.instagram.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/7956715?trk=tyah&amp;amp;amp;amp;trkInfo=clickedVertical:company,clickedEntityId:7956715,idx:1-1-1,tarId:1464353969447,tas:uplatz\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/uplatz.com\\\/blog\\\/#\\\/schema\\\/person\\\/8ecae69a21d0757bdb2f776e67d2645e\",\"name\":\"uplatzblog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7f814c72279199f59ded4418a8653ad15f5f8904ac75e025a4e2abe24d58fa5d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7f814c72279199f59ded4418a8653ad15f5f8904ac75e025a4e2abe24d58fa5d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7f814c72279199f59ded4418a8653ad15f5f8904ac75e025a4e2abe24d58fa5d?s=96&d=mm&r=g\",\"caption\":\"uplatzblog\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cassandra Pocket Book | Uplatz Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/","og_locale":"en_US","og_type":"article","og_title":"Cassandra Pocket Book | Uplatz Blog","og_description":"Cassandra Pocket Book \u2014 Uplatz 50 deep-dive flashcards \u2022 Wide layout \u2022 Fewer scrolls \u2022 20+ Interview Q&amp;A \u2022 Readable code examples Section 1 \u2014 Fundamentals 1) What is Cassandra? Read More ...","og_url":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/","og_site_name":"Uplatz Blog","article_publisher":"https:\/\/www.facebook.com\/Uplatz-1077816825610769\/","article_published_time":"2025-08-22T09:40:21+00:00","article_modified_time":"2025-08-30T11:56:41+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra.jpg","type":"image\/jpeg"}],"author":"uplatzblog","twitter_card":"summary_large_image","twitter_creator":"@uplatz_global","twitter_site":"@uplatz_global","twitter_misc":{"Written by":"uplatzblog","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/#article","isPartOf":{"@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/"},"author":{"name":"uplatzblog","@id":"https:\/\/uplatz.com\/blog\/#\/schema\/person\/8ecae69a21d0757bdb2f776e67d2645e"},"headline":"Cassandra Pocket Book","datePublished":"2025-08-22T09:40:21+00:00","dateModified":"2025-08-30T11:56:41+00:00","mainEntityOfPage":{"@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/"},"wordCount":2148,"publisher":{"@id":"https:\/\/uplatz.com\/blog\/#organization"},"image":{"@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/#primaryimage"},"thumbnailUrl":"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra-1024x576.jpg","articleSection":["Cassandra","Pocket Book"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/","url":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/","name":"Cassandra Pocket Book | Uplatz Blog","isPartOf":{"@id":"https:\/\/uplatz.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/#primaryimage"},"image":{"@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/#primaryimage"},"thumbnailUrl":"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra-1024x576.jpg","datePublished":"2025-08-22T09:40:21+00:00","dateModified":"2025-08-30T11:56:41+00:00","breadcrumb":{"@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/#primaryimage","url":"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra.jpg","contentUrl":"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2025\/08\/Cassandra.jpg","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/uplatz.com\/blog\/cassandra-pocket-book\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/uplatz.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Cassandra Pocket Book"}]},{"@type":"WebSite","@id":"https:\/\/uplatz.com\/blog\/#website","url":"https:\/\/uplatz.com\/blog\/","name":"Uplatz Blog","description":"Uplatz is a global IT Training &amp; Consulting company","publisher":{"@id":"https:\/\/uplatz.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/uplatz.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/uplatz.com\/blog\/#organization","name":"uplatz.com","url":"https:\/\/uplatz.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/uplatz.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2016\/11\/Uplatz-Logo-Copy-2.png","contentUrl":"https:\/\/uplatz.com\/blog\/wp-content\/uploads\/2016\/11\/Uplatz-Logo-Copy-2.png","width":1280,"height":800,"caption":"uplatz.com"},"image":{"@id":"https:\/\/uplatz.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Uplatz-1077816825610769\/","https:\/\/x.com\/uplatz_global","https:\/\/www.instagram.com\/","https:\/\/www.linkedin.com\/company\/7956715?trk=tyah&amp;amp;amp;amp;trkInfo=clickedVertical:company,clickedEntityId:7956715,idx:1-1-1,tarId:1464353969447,tas:uplatz"]},{"@type":"Person","@id":"https:\/\/uplatz.com\/blog\/#\/schema\/person\/8ecae69a21d0757bdb2f776e67d2645e","name":"uplatzblog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7f814c72279199f59ded4418a8653ad15f5f8904ac75e025a4e2abe24d58fa5d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7f814c72279199f59ded4418a8653ad15f5f8904ac75e025a4e2abe24d58fa5d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7f814c72279199f59ded4418a8653ad15f5f8904ac75e025a4e2abe24d58fa5d?s=96&d=mm&r=g","caption":"uplatzblog"}}]}},"_links":{"self":[{"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/posts\/4719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/comments?post=4719"}],"version-history":[{"count":2,"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/posts\/4719\/revisions"}],"predecessor-version":[{"id":5075,"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/posts\/4719\/revisions\/5075"}],"wp:attachment":[{"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/media?parent=4719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/categories?post=4719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/uplatz.com\/blog\/wp-json\/wp\/v2\/tags?post=4719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}