Discover our quick start guide and build your first application in 5-10 minutes
Quick Start GuideKey-value access is a major pattern in Ignite 2 (Cache API) and a supporting pattern in Ignite 3 (Table API with KeyValueView). Both versions provide direct key-based access without SQL overhead, but use different APIs reflecting their architectural evolution.
Ignite 2 provides the Cache API (IgniteCache) as the primary interface for key-value operations. Ignite 3 provides the Table API with RecordView and KeyValueView for key-value access patterns. Both support partition-aware routing for low-latency operations.
Simple Get/Put Operations
// Get cache instance
IgniteCache<Integer, Person> cache =
ignite.cache("person");
// Put operation
cache.put(1, new Person("John", 30));
// Get operation
Person person = cache.get(1);
// Remove operation
cache.remove(1);// Get KeyValueView from table
KeyValueView<Integer, Person> kvView =
table.keyValueView(Integer.class, Person.class);
// Put operation
kvView.put(null, 1, new Person("John", 30));
// Get operation
Person person = kvView.get(null, 1);
// Remove operation
kvView.remove(null, 1);Batch Operations
// Batch put
Map<Integer, Person> batch = new HashMap<>();
batch.put(1, new Person("John", 30));
batch.put(2, new Person("Jane", 25));
cache.putAll(batch);
// Batch get
Set<Integer> keys = Set.of(1, 2);
Map<Integer, Person> results = cache.getAll(keys);// Batch put
Map<Integer, Person> batch = Map.of(
1, new Person("John", 30),
2, new Person("Jane", 25)
);
kvView.putAll(null, batch);
// Batch get
Collection<Integer> keys = List.of(1, 2);
Map<Integer, Person> results = kvView.getAll(null, keys);Store user session data with direct key-based access. Both versions support partition-aware routing for low-latency session retrieval. Any-node access eliminates sticky sessions. ACID guarantees ensure consistency across replicas.
Cache frequently accessed reference data (product catalogs, configuration settings) with key-value patterns. Direct partition access delivers low-latency lookups. Colocation support enables local joins with related data.
Store user profiles with userId as key for direct access patterns. Partition-aware routing ensures consistent latency across cluster. Both versions support atomic updates to profile data. Memory-first architecture delivers low-latency reads.
Maintain shopping cart state with sessionId as key. Direct key-based access for cart operations without SQL overhead. ACID guarantees ensure cart consistency during checkout. Automatic failover prevents cart data loss.
Ignite 2 Cache API provides a simpler interface focused on key-value operations. Ignite 3 Table API requires table schema definition upfront but provides compile-time type safety. RecordView offers tuple-based access while KeyValueView provides key-value patterns. Both support same performance characteristics.
Ignite 2 Cache API supports dynamic cache creation without schema definition. Ignite 3 requires table schema definition using SQL DDL before accessing KeyValueView. Schema evolution supported in both versions. Ignite 3 schema-driven design enables better query optimization.
Discover our quick start guide and build your first application in 5-10 minutes
Quick Start GuideLearn about other Ignite use cases
Use Cases Overview