Introduction
Redis is an open source (BSD licensed), in-memory data structure store used as a database, cache, message broker, and streaming engine. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing an element to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set.
To achieve top performance, Redis works with an in-memory dataset. Depending on your use case, Redis can persist your data either by periodically dumping the dataset to disk or by appending each command to a disk-based log. You can also disable persistence if you just need a feature-rich, networked, in-memory cache.
Redis supports asynchronous replication, with fast non-blocking synchronization and auto-reconnection with partial resynchronization on net split.
Redis also includes:
- Transactions
- Pub/Sub
- Lua scripting
- Keys with a limited time-to-live
- LRU eviction of keys
- Automatic failover
Prerequisites
- The Redis Client installed on the system.
- A running Redis instance with well-known topics.
- If running ESF < 7.2.0, an
org.eclipse.kura.cloud.CloudService
needs to be instantiated in order to use Kura Protobuf payload encoding (see Endpoint Configuration).
General concepts
Redis client includes a RedisCloudConnectionEndpoint
component suitable for publishing and retrieving data from a remote and a RedisDbService
that provider a MessageStoreProvider
usable for storing data coming from the default Kura DataService
implementation. This bundle also offers a WireRecordStoreProvider
which can be used to store Kura Wire Graph. QueryableWireRecordStoreProvider
support, needed to retrieve data, will be added later in a future versions.
The two component share the same configuration options listed in the Cloud Connector section.
The provided RedisCloudConnectionEndpoint
uses the Redis command PSUBSCRIBE
and PUBSLISH
to deal with Redis TOPIC
. The command PUNSUBSCRIBE
is used to unsubscribe from topics.
The RedisCloudConnectionEndpoint
and the RedisDbService
share most of the configuration and behaviors.
Attention
Redis doesn't support transactions by design. Before using it as a MessageStore
take into account the fact that data loss may occur in case of errors or problems.
Redis Topics syntax
The RedisClientCloudEndpoint
supports topic with wildcards. More information on redis wildcard can be found on the official website.