docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거

Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
Antigravity Agent
2026-07-05 00:33:48 +09:00
parent 1cfd3bbb56
commit 9148c358d0
6455 changed files with 1 additions and 86875 deletions
@@ -0,0 +1,181 @@
---
id: wiki-2026-0508-카산드라-cassandra
title: 카산드라(Cassandra)
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Apache Cassandra, Cassandra, C*]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [database, nosql, distributed, wide-column, ap-system]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: Java/CQL
framework: Apache Cassandra 5.0
---
# 카산드라 (Cassandra)
## 매 한 줄
> **"매 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.
### 매 응용
1. 매 time-series (IoT, metrics, logs).
2. 매 messaging / 매 feed (Discord 의 매 trillion+ msgs).
3. 매 session / 매 cart store.
4. 매 GenAI 의 매 vector + Cassandra 5 의 매 SAI vector index.
## 💻 패턴
### Pattern 1: 매 Schema Design (query-first)
```sql
-- 매 BAD: 매 hotspot — 매 single partition
CREATE TABLE messages (
channel_id uuid PRIMARY KEY,
msg_id timeuuid,
body text
);
-- 매 GOOD: 매 bucketed time partition
CREATE TABLE messages (
channel_id uuid,
bucket text, -- 매 'YYYY-MM-DD'
msg_id timeuuid,
body text,
PRIMARY KEY ((channel_id, bucket), msg_id)
) WITH CLUSTERING ORDER BY (msg_id DESC);
```
### Pattern 2: 매 Vector Search (Cassandra 5 SAI)
```sql
CREATE TABLE products (
id uuid PRIMARY KEY,
name text,
embedding vector<float, 1536>
);
CREATE CUSTOM INDEX ON products(embedding)
USING 'StorageAttachedIndex'
WITH OPTIONS = { 'similarity_function' : 'cosine' };
-- 매 ANN search
SELECT id, name FROM products
ORDER BY embedding ANN OF [0.1, 0.2, ...]
LIMIT 10;
```
### Pattern 3: 매 Driver Async (Java)
```java
CqlSession session = CqlSession.builder().build();
PreparedStatement ps = session.prepare(
"INSERT INTO messages (channel_id, bucket, msg_id, body) VALUES (?, ?, ?, ?)"
);
CompletionStage<AsyncResultSet> f = session.executeAsync(
ps.bind(channelId, bucket, msgId, body)
.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM)
);
```
### Pattern 4: 매 Compaction Strategy 선택
```sql
-- 매 time-series → TWCS
ALTER TABLE metrics WITH compaction = {
'class': 'TimeWindowCompactionStrategy',
'compaction_window_size': '1',
'compaction_window_unit': 'DAYS'
};
-- 매 read-heavy → LCS
ALTER TABLE users WITH compaction = {
'class': 'LeveledCompactionStrategy',
'sstable_size_in_mb': '160'
};
-- 매 write-heavy general → STCS (default)
```
### Pattern 5: 매 Multi-DC Replication
```sql
CREATE KEYSPACE app
WITH replication = {
'class': 'NetworkTopologyStrategy',
'us-east': 3,
'eu-west': 3,
'ap-northeast': 2
} AND durable_writes = true;
```
### Pattern 6: 매 LWT (conditional)
```sql
-- 매 unique constraint
INSERT INTO users (email, id) VALUES ('a@b.com', uuid())
IF NOT EXISTS;
-- 매 비쌈 — 매 4 round trip Paxos. 매 hot path 회피.
```
### Pattern 7: 매 Anti-pattern 진단
```sql
-- 매 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.
## 🔗 Graph
- 부모: [[NoSQL]]
- Adjacent: [[CAP Theorem & PACELC]]
## 🤖 LLM 활용
**언제**: 매 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 의 매 의무.
## 🧪 검증 / 중복
- Verified (Apache Cassandra 5.0 docs, DataStax docs, Discord engineering blog 2026).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — Cassandra 5.0 (SAI vector) full 정리 |