jackluo923
jackluo923

Reputation: 205

Apache Ignite Cache - get key from value

Problem

Need to implement a bi-directional key value store. Cache entry is populated into the cache using a key (String) mapping to a value(Long). However, the the cache needs to handle both key->value and value->key lookup. What is the most efficient way to do this?

Note: value->key mapping does not need to be synchronized with key->value in real time, but cannot fall behind key->value mapping for too long (10-15 seconds max).

Naive Ignite Implementation

  1. Use ignite continuous query to monitor changes, upon modification, update another (value->key) cache

Are there better way of achieving this goal? Is ignite the wrong tool to use?

Upvotes: 0

Views: 441

Answers (1)

alamar
alamar

Reputation: 19313

You can use SQL queries and have secondary index on value. Your proposed approach should also work.

Upvotes: 1

Related Questions