"매 write-optimized · 매 masterless · 매 AP 의 매 wide-column store". 매 Apache Cassandra 5.0 (2026) 은 매 Dynamo-style replication + 매 BigTable-style data model 의 매 합 — 매 single-region 1M+ writes/sec 의 매 linear scale, 매 multi-DC active-active, 매 tunable consistency. 매 partition key 설계 가 매 흥망 — 매 잘못된 model 은 매 hotspot · 매 large partition 의 매 재앙.
매 핵심
매 architecture
매 Masterless: 매 모든 node 가 매 동등 — 매 single point of failure 부재.
매 Consistent hashing: 매 token ring + 매 vnode (default 16) — 매 even distribution.
매 Replication: 매 RF=3 의 매 typical, 매 NetworkTopologyStrategy 로 매 multi-DC.
매 Gossip: 매 peer-to-peer cluster state.
매 LSM tree storage: 매 memtable → SSTable, 매 compaction (STCS / LCS / TWCS).
매 consistency
매 Tunable: ANY, ONE, QUORUM, LOCAL_QUORUM, EACH_QUORUM, ALL.
매 Strong: R+W > N (e.g., RF=3, R=QUORUM, W=QUORUM).
매 Eventual: ONE/ANY — 매 fast 하지만 매 stale read 가능.
매 LWT (Paxos): 매 conditional write — 매 비싸지만 매 linearizable.
매 응용
매 time-series (IoT, metrics, logs).
매 messaging / 매 feed (Discord 의 매 trillion+ msgs).
매 session / 매 cart store.
매 GenAI 의 매 vector + Cassandra 5 의 매 SAI vector index.
💻 패턴
Pattern 1: 매 Schema Design (query-first)
-- 매 BAD: 매 hotspot — 매 single partition
CREATETABLEmessages(channel_iduuidPRIMARYKEY,msg_idtimeuuid,bodytext);-- 매 GOOD: 매 bucketed time partition
CREATETABLEmessages(channel_iduuid,buckettext,-- 매 'YYYY-MM-DD'
msg_idtimeuuid,bodytext,PRIMARYKEY((channel_id,bucket),msg_id))WITHCLUSTERINGORDERBY(msg_idDESC);
Pattern 2: 매 Vector Search (Cassandra 5 SAI)
CREATETABLEproducts(iduuidPRIMARYKEY,nametext,embeddingvector<float,1536>);CREATECUSTOMINDEXONproducts(embedding)USING'StorageAttachedIndex'WITHOPTIONS={'similarity_function':'cosine'};-- 매 ANN search
SELECTid,nameFROMproductsORDERBYembeddingANNOF[0.1,0.2,...]LIMIT10;
-- 매 time-series → TWCS
ALTERTABLEmetricsWITHcompaction={'class':'TimeWindowCompactionStrategy','compaction_window_size':'1','compaction_window_unit':'DAYS'};-- 매 read-heavy → LCS
ALTERTABLEusersWITHcompaction={'class':'LeveledCompactionStrategy','sstable_size_in_mb':'160'};-- 매 write-heavy general → STCS (default)
-- 매 unique constraint
INSERTINTOusers(email,id)VALUES('a@b.com',uuid())IFNOTEXISTS;-- 매 비쌈 — 매 4 round trip Paxos. 매 hot path 회피.
Pattern 7: 매 Anti-pattern 진단
-- 매 nodetool tablestats 로 매 large partition 확인
-- nodetool tablestats keyspace.table | grep "Compacted partition maximum"
-- 매 100MB+ partition = 매 redesign signal
매 결정 기준
상황
Approach
매 write 1M+/sec
Cassandra (자연 fit)
매 strong consistency 필수
LWT or 매 다른 DB (CockroachDB, Spanner)
매 ad-hoc query / JOIN
Postgres / Trino — 매 Cassandra 부적합
매 time-series
Cassandra + TWCS or ScyllaDB
매 vector + scale
Cassandra 5 SAI or Milvus/Qdrant
매 small data (< 1TB)
Postgres — 매 Cassandra overkill
기본값: 매 query-first schema, 매 LOCAL_QUORUM, 매 RF=3, 매 partition < 100MB.
언제: 매 large-scale write workload 의 매 design, 매 multi-DC active-active 요건, 매 time-series storage, 매 schema review.
언제 X: 매 transactional / OLTP / JOIN 매 heavy — 매 RDBMS 가 매 적합. 매 small data — 매 over-engineering.
❌ 안티패턴
매 Large partition (>100MB): 매 OOM, 매 compaction failure, 매 read latency 폭발.
매 Hotspot key: 매 single-channel 모든 msg → 매 partition 폭발.
매 ALLOW FILTERING: 매 full scan — 매 production X.
매 Secondary index 의 매 high cardinality: 매 매번 매 fanout — 매 SAI 사용.
매 LWT 의 매 hot path: 매 4× latency.
매 SQL mindset (JOIN, GROUP BY): 매 denormalize 의 매 의무.