Skip to content

Class CassandraEventSourcingConfiguration

Namespace: Cephalon.EventSourcing.Cassandra
Assembly: Cephalon.EventSourcing.Cassandra.dll

Holds the CQL DDL template for bootstrapping the Cassandra event-store table.

public static class CassandraEventSourcingConfiguration

objectCassandraEventSourcingConfiguration

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

CQL DDL template for creating the event streams table. The {0} placeholder must be substituted with the fully qualified table name (optionally including keyspace prefix).

public const string CreateTableCql = "\n CREATE TABLE IF NOT EXISTS {0} (\n stream_id text,\n stream_version bigint,\n event_type text,\n payload text,\n occurred_at_utc timestamp,\n appended_at_utc timestamp,\n PRIMARY KEY (stream_id, stream_version)\n ) WITH CLUSTERING ORDER BY (stream_version ASC)"

string

The composite primary key (stream_id, stream_version) with clustering order ASC on stream_version makes per-stream range scans efficient and enforces uniqueness at the partition/clustering-key level. LWT INSERT IF NOT EXISTS uses this same uniqueness constraint to detect concurrent-write conflicts.