Storages

Storages #

The Proxima Platform abstracts away implementation details of physical storage systems and exposes a uniform set of capabilities—streaming, random access, batch scans, and cached views—driven purely by configuration.

Types of Storages #

Proxima categorizes physical storages into three primary archetypes:

  1. Commit log — append-only, partitioned event stream
  2. Random-access storage — online key-value / wide-column database
  3. Batch storage — time-partitioned immutable files / blobs for historical reprocessing

Commit Log #

A commit log is a write-once, read-many (append-only) partitioned stream of immutable StreamElement events. Every event carries (entity, key, attribute, stamp, value/delete) and is routed to a partition by a Partitioner.

By stream-table duality, a commit log can be reduced into a table. When the commit log retains the latest update for every (key, attribute) pair (for example, an Apache Kafka log-compacted topic), it is called a state commit log (state-commit-log) and can also power a locally materialized CachedView.

The primary role of a commit log is to durably persist writes first (as the primary attribute family) before the Replication controller propagates updates to all replica storages.

Random-Access Storage #

A random-access storage (typically a NoSQL wide-column store or relational database) materializes the latest table state for low-latency serving:

  • Point lookups by (entity, key, attribute)
  • Prefix scans of wildcard attributes ordered lexicographically (scanWildcard)
  • Optional primary-key listing (list-primary-key) and full-table batch snapshot scans (batch-snapshot)

Typical backends include Apache Cassandra, Apache HBase, Google Cloud Bigtable, and JDBC.

Batch Storage #

A batch storage persists the commit log durably as immutable, time-windowed files (binary blobs, JSON, or Parquet). Because commit logs typically rotate or compact old records, batch storage enables full or time-bounded historical reprocessing (batch-updates) for analytics, backfills, and ML training.

Typical backends include Google Cloud Storage, Amazon S3 / MinIO, and Apache Hadoop HDFS.

Mapping Attributes to Storages (attributeFamilies) #

Attributes are bound to physical storages via attribute families. Each attribute family belongs to a single entity, covers one or more of its attributes (or ["*"] for all attributes), points to a physical storage URI, and declares a type (primary or replica) and access capabilities.

attributeFamilies {

  user-commit-log {
    entity: user
    attributes: [ "*" ]
    type: primary
    storage: "kafka://kafka-broker:9092/user-topic"
    access: [ commit-log, state-commit-log, cached-view ]
  }

  user-random-access {
    entity: user
    attributes: [ "details", "preferences" ]
    type: replica
    storage: "cassandra://cassandra-seed:9042/eshop.user_table?primary=user"
    access: random-access
  }

  user-events-random-access {
    entity: user
    attributes: [ "event.*" ]
    type: replica
    storage: "cassandra://cassandra-seed:9042/eshop.user_event_table?primary=user&secondary=stamp"
    access: random-access
  }

  event-commit-log {
    entity: event
    attributes: [ "*" ]
    type: primary
    storage: "kafka://kafka-broker:9092/event-topic"
    access: commit-log
  }

  event-batch-storage {
    entity: event
    attributes: [ "*" ]
    type: replica
    storage: "gs://my-bucket/proxima/events"
    access: batch-updates
    format: parquet
    log-roll-interval: 3600000
  }

}

Primary vs. Replica Families #

typeSemantics
primaryThe authoritative family that receives application writes first and acknowledges them to the caller. Every non-disabled attribute must belong to exactly one writable primary family. If an attribute also has one or more replica families, its primary family must support commit-log access so ReplicationController can consume it.
replicaA derived storage asynchronously populated from the primary commit log by ReplicationController. Multiple replicas can coexist independently for the same attribute (e.g., Cassandra for serving + GCS Parquet for batch analytics + Elasticsearch for search).

Access Tags (access) #

The access field accepts a single string, a comma-separated string, or a HOCON array combining any of the following tags (parsed by AccessType):

TagMeaning
commit-logSupports streaming observation via CommitLogReader / BeamDataOperator.getStream.
state-commit-logImplies commit-log; indicates the log retains full compacted state suitable for reconstructing a table snapshot.
random-accessSupports point get and wildcard prefix scans via RandomAccessReader.
list-primary-keySupports enumerating entity keys via RandomAccessReader.listEntities.
batch-updatesSupports reading historical time-partitioned update logs via BatchLogReader / BeamDataOperator.getBatchUpdates.
batch-snapshotSupports reading a full compacted snapshot via BatchLogReader / BeamDataOperator.getBatchSnapshot.
cached-viewSupports materializing an in-memory partitioned CachedView over the commit log.
read-onlyPrevents writes to this family (e.g., external Kafka topic regexes or read-only views populated by another pipeline).
write-onlyPrevents reads from this family (e.g., export sinks like Elasticsearch or audit tables).

See Supported IO modules for the exact URI syntax and configuration options of every built-in storage backend.

Filtering Replicated Updates (filter) #

A replica attribute family can define an optional filter implementing StorageFilter so only matching elements are replicated to that storage:

attributeFamilies {
  user-event-history-store {
    entity: event
    attributes: [ "data" ]
    storage: "cassandra://cassandra-seed:9042/eshop.user_event/"
    filter: cz.o2.proxima.example.EventHistoryFilter
    type: replica
    access: write-only
  }
}
public class EventHistoryFilter implements StorageFilter {
  private static final long serialVersionUID = 1L;

  @Override
  public boolean apply(StreamElement ingest) {
    // Only replicate non-delete events that match business criteria
    return !ingest.isDelete();
  }
}

Disabling a Family (disabled) #

Any attribute family can be temporarily excluded from loading by setting disabled: true. This is handy when overriding a shared reference.conf in environment-specific application.conf files (for example, disabling an archive replica in a staging environment).

Partitioners #

Commit logs route each StreamElement to a partition using a Partitioner configured via the partitioner property:

event-commit-log {
  entity: event
  attributes: [ "*" ]
  storage: "kafka://kafka-broker:9092/event-topic"
  type: primary
  access: commit-log
  partitioner: cz.o2.proxima.core.storage.commitlog.KeyAttributePartitioner
}

Built-in partitioners in proxima-core:

  • KeyPartitioner (default) — hashes element.getKey() so all attributes of the same entity key land in the same partition.
  • KeyAttributePartitioner — hashes (key, attribute) to spread high-cardinality wildcard attributes of a single entity key across partitions.
  • FirstPartitionPartitioner — routes all elements to partition 0 (useful for single-partition control topics).

Watermarks and Throughput Limiters #

Streaming commit log readers (CommitLogReader) track event-time progress using pluggable watermarks configured under the watermark. prefix inside the attribute family:

  • watermark.estimator-factory: Class implementing WatermarkEstimatorFactory. Built-in options in proxima-direct-core:
    • BoundedOutOfOrdernessWatermarkEstimator.Factory
    • UnboundedOutOfOrdernessWatermarkEstimator.Factory
    • ProcessingTimeWatermarkEstimator.Factory
    • MinimalPartitionWatermarkEstimator.Factory
  • watermark.idle-policy-factory: Class implementing WatermarkIdlePolicyFactory to advance watermarks on idle partitions:
    • NotProgressingWatermarkIdlePolicy.Factory
    • ProcessingTimeShiftingWatermarkIdlePolicy.Factory
    • SkewedProcessingTimeIdlePolicy.Factory

To throttle consumption rates (for example, aligning replay speed with a downstream watermark), configure a ThroughputLimiter under direct.throughput-limiter.<family-name> with class set to a ThroughputLimiter implementation (such as GlobalWatermarkThroughputLimiter paired with FlinkGlobalWatermarkTracker or ZKGlobalWatermarkTracker).

With entities and attribute families defined, proceed to Supported IO modules for connector details, or Replication to see how Proxima maintains eventual consistency across families.