"매 database bottleneck 의 제거 — 매 in-memory data grid (tuple space) + 매 processing units 의 horizontal scale". Linda tuple space (1985) 의 후예. 매 Gigaspaces, Hazelcast, Apache Ignite 가 매 commercial 구현. 매 high-volume, low-latency 의 trading, gaming, real-time bidding.
매 핵심
매 components
Processing Unit (PU): 매 stateless application + 매 local in-memory data partition.
Virtualized Middleware:
Messaging Grid: load balancer.
Data Grid: 매 distributed in-memory cache (replicated/partitioned).
Processing Grid: 매 orchestrate distributed work.
Deployment Manager: 매 PU lifecycle.
Data Pumps: 매 data grid → DB async write-behind.
Data Writers / Readers: 매 eventual persistence.
매 trade-off
장점: 매 elastic horizontal scale, 매 DB 의 single point of bottleneck X, 매 sub-ms latency.
단점: 매 eventual consistency, 매 complexity 의 폭발, 매 in-memory cost 의 high, 매 split-brain risk.
매 응용
Online ticketing (Ticketmaster).
Real-time bidding (ad exchange).
MMO game state (player position grid).
💻 패턴
Hazelcast IMDG — distributed map (Java 21)
HazelcastInstancehz=Hazelcast.newHazelcastInstance();IMap<String,Order>orders=hz.getMap("orders");orders.put("o-123",newOrder("sku-1",99));Ordero=orders.get("o-123");// 매 local or remote partition
EntryProcessor — 매 data-local computation
orders.executeOnKey("o-123",(EntryProcessor<String,Order,Void>)entry->{varo=entry.getValue();o.markPaid();entry.setValue(o);// 매 in-place mutation, 매 network round-trip 1회returnnull;});
IgniteCache<Long,Order>cache=ignite.cache("orders");SqlFieldsQueryq=newSqlFieldsQuery("SELECT customerId, SUM(amount) FROM Order GROUP BY customerId");cache.query(q).forEach(row->System.out.println(row));
Affinity colocation — 매 join-friendly partition
@AffinityKeyMappedLongcustomerId;// 매 same partition 의 customer + orders
언제: extreme write throughput, DB bottleneck, latency budget < 10ms.
언제 X: 매 일반 CRUD, 매 strong consistency 의 필요, 매 small team — 매 complexity 의 cost 의 huge.
❌ 안티패턴
SBA for CRUD: 매 over-engineering. Postgres 의 sufficient.
Sync write-through to DB: 매 SBA 의 point 의 lost — async write-behind 의 의도.
Single PU instance: 매 distributed grid 의 X — 매 SPOF.