Expand description

Akka Persistence adapter for Streambed commit logs

This crate adapts Streambed’s CommitLog and SecretStore traits for the purposes of it being used with Akka Persistence of akka-edge-rs.

A u64 “key” field is used with Streambed’s abstraction of commit logs as modelled off Kafka. Keys are used to distinguish and entity and its record type. Therefore, you must have an entity id that can be represented directly in 64 bits, along with some bits reserved for the record type. Devices at the edge are often represented with a 32 bit address, and so this should not present a problem at the edge in general. Hashes are to be avoided due to their potential for collisions.

Streambed provides an implementation of a commit log named “Logged”. Logged is a library focused on conserving storage and is particularly suited for use at the edge that uses flash based storage. Other forms of commit log are also supported by Streabmed, including a Kafka-like HTTP interface.

The encryption/decryption of records stored in a commit log are also handled through Streambed’s SecretStore. Streambed also provides an implementation of a file-based secret store named “Confidant”. Confidant is also particularly suited for use at the edge where flash storage is also used. Other forms of the secret store are supported, including Hashicorp’s Vault.

Structs

  • This describes an error when there has been some run-time issue in attempting to consume records.
  • This describes an error when there has been some run-time issue in attempting to produce records.
  • Adapts a Streambed CommitLog for use with Akka Persistence. This adapter retains an instance of a CommitLog and is associated with a specific topic. A topic maps one-to-one with a entity type i.e. many entity instances are held within one topic.
  • An envelope wraps a commit log event associated with a specific entity. Tags are not presently considered useful at the edge. A remote consumer would be interested in all events from the edge in most cases, and the edge itself decides what to publish (producer defined filter).

Traits

  • Provides the ability to transform the the memory representation of Akka Persistence events from and to the records that a CommitLog expects.
  • Provides the ability to transform the the memory representation of Akka Persistence events from and to the records that a CommitLog expects. Given the “cbor” feature, we use CBOR for serialization. Encryption/decryption to commit log records is also applied. Therefore a secret store is expected.