Files
2nd/10_Wiki/Topics/Domain_Programming/Architecture/Apache Ignite.md
T
Antigravity Agent c24165b8bc refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게
[공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류.
문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인).

- Topic_Programming → Domain_Programming (내부 구조 보존)
- Topic_Graphic → Domain_Design
- Topic_Business → Domain_Product
- Topic_General → Domain_General
- _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning),
  Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing)
- 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서)
- 빈 폴더 정리 (memory/procedures)
- 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 11:05:56 +09:00

178 lines
6.2 KiB
Markdown

---
id: wiki-2026-0508-apache-ignite
title: Apache Ignite
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Ignite, In-memory data grid, GridGain]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [in-memory, data-grid, distributed-cache, sql, compute-grid]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: java
framework: Apache Ignite 2.16
---
# Apache Ignite
## 매 한 줄
> **"매 distributed in-memory data grid + compute grid + ANSI SQL"**. 매 GridGain (2007) → Apache Ignite (2014, donated). 매 2026 modern stack 은 Ignite 2.16 (GA mid-2025) / Ignite 3.x (preview, 매 new architecture: RAFT-based, ANSI SQL-first, 매 GridGain 9 commercial). 매 Hazelcast / Redis 의 alternative — 매 SQL + ACID transactions 의 differentiator.
## 매 핵심
### 매 features
- **In-memory key-value cache** — partitioned (sharded) or replicated.
- **Distributed ANSI-99 SQL** — collocated joins, indexes, JDBC/ODBC.
- **ACID transactions** — pessimistic / optimistic, distributed two-phase commit.
- **Compute grid** — send code to data (Java/.NET/C++).
- **Service grid** — deploy stateful services across cluster.
- **Native persistence** — durable on-disk (since 2.1, 2017).
- **Streaming** — continuous queries, data streamer.
### 매 architecture
- **Topology**: server nodes + client/thin clients.
- **Affinity**: rendezvous hashing, partition-to-node assignment.
- **Backup**: synchronous/async backups per cache (RF=N).
- **Discovery**: TcpDiscoverySpi (multicast / static / Kubernetes / ZooKeeper).
- **Communication**: TcpCommunicationSpi.
### 매 응용
1. **Hot cache layer** — in front of Postgres/Oracle, sub-ms reads.
2. **Distributed SQL** — operational analytics across shards.
3. **Compute grid** — financial risk calc, ML feature scoring at data.
4. **Session storage** — JCache (JSR-107) compliant.
## 💻 패턴
### Cache config (Java)
```java
IgniteConfiguration cfg = new IgniteConfiguration();
CacheConfiguration<Long, Order> cc = new CacheConfiguration<>("orders");
cc.setCacheMode(CacheMode.PARTITIONED);
cc.setBackups(1);
cc.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
cc.setIndexedTypes(Long.class, Order.class);
cfg.setCacheConfiguration(cc);
Ignite ignite = Ignition.start(cfg);
IgniteCache<Long, Order> orders = ignite.cache("orders");
orders.put(1L, new Order(...));
```
### Distributed SQL
```java
SqlFieldsQuery q = new SqlFieldsQuery(
"SELECT o.id, c.name FROM \"orders\".Order o " +
"JOIN \"customers\".Customer c ON o.customerId = c.id " +
"WHERE o.status = ?")
.setArgs("paid");
try (var cur = orders.query(q)) {
for (List<?> row : cur) System.out.println(row);
}
```
### Affinity collocation (cross-cache JOIN performance)
```java
@QuerySqlField(index = true)
private Long customerId;
// Affinity key — rows with same customerId on same node
@AffinityKeyMapped
private Long customerId;
// Now JOIN orders ↔ customers stays node-local
```
### Transaction (pessimistic, repeatable read)
```java
try (Transaction tx = ignite.transactions().txStart(
TransactionConcurrency.PESSIMISTIC,
TransactionIsolation.REPEATABLE_READ)) {
Account from = accounts.get(fromId);
Account to = accounts.get(toId);
if (from.balance < amount) throw new RuntimeException("INSUFFICIENT");
from.balance -= amount; to.balance += amount;
accounts.put(fromId, from);
accounts.put(toId, to);
tx.commit();
}
```
### Compute grid (broadcast)
```java
ignite.compute().broadcast(() -> {
System.out.println("Hello from " + ignite.cluster().localNode().id());
});
// Send Lambda — Ignite peer-class-loads to all nodes
```
### Continuous query (CDC-like)
```java
ContinuousQuery<Long, Order> qry = new ContinuousQuery<>();
qry.setLocalListener(events -> {
for (CacheEntryEvent<? extends Long, ? extends Order> e : events)
System.out.println("Updated: " + e.getKey() + "" + e.getValue());
});
qry.setRemoteFilterFactory(() -> e -> e.getValue().getStatus().equals("paid"));
orders.query(qry);
```
### Native persistence
```java
DataStorageConfiguration ds = new DataStorageConfiguration();
ds.getDefaultDataRegionConfiguration().setPersistenceEnabled(true);
ds.setStoragePath("/var/ignite/persistence");
cfg.setDataStorageConfiguration(ds);
// Restart-safe; in-memory speed + durability
ignite.cluster().state(ClusterState.ACTIVE);
```
### Thin client (lightweight, no peer-class-loading)
```java
ClientConfiguration cc = new ClientConfiguration().setAddresses("ignite:10800");
try (IgniteClient c = Ignition.startClient(cc)) {
ClientCache<Long, Order> orders = c.getOrCreateCache("orders");
orders.put(1L, new Order(...));
}
```
## 매 결정 기준
| 상황 | Tool |
|---|---|
| Pure key-value cache, simple | Redis |
| K-V + distributed events, JVM | Hazelcast |
| K-V + ANSI SQL + ACID + compute grid | Ignite |
| In-process cache | Caffeine |
| Cloud-native managed | ElastiCache / Memorystore / GridGain Cloud |
**기본값**: 매 Redis 매 simple cache, 매 Ignite 매 SQL+ACID+compute integrated, 매 Hazelcast 매 JVM-native event-driven.
## 🔗 Graph
- 부모: [[In-Memory Data Grid]] · [[Distributed Cache]]
- 변형: [[GridGain]]
## 🤖 LLM 활용
**언제**: 매 sub-ms latency + SQL + ACID 의 simultaneous requirement, 매 compute-near-data, 매 JVM ecosystem.
**언제 X**: 매 simple cache only (Redis cheaper), 매 non-JVM stack (limited tooling), 매 small data (<10GB, single node fine).
## ❌ 안티패턴
- **No backups**: 매 node loss → data loss. 매 setBackups(≥1).
- **Cross-cache JOIN without affinity**: 매 network shuffle, 매 query 의 slow.
- **Synchronous replication everywhere**: 매 latency. 매 PRIMARY_SYNC + async backup balance.
- **Mixing partitioned + replicated joins carelessly**: 매 broadcast amplification.
## 🧪 검증 / 중복
- Verified (Apache Ignite docs 2.16, GridGain documentation, ASF Ignite 3.x roadmap).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — full content (Ignite cache, SQL, transactions, compute grid) |