CassandraJournalOptions
Defined in: src/persistence/journals/CassandraJournal.ts:14
Extends
Section titled “Extends”Properties
Section titled “Properties”allIdsTable?
Section titled “allIdsTable?”
readonlyoptionalallIdsTable?:string
Defined in: src/persistence/journals/CassandraJournal.ts:20
Lookup table for persistenceIds(). Default: all_persistence_ids.
autoCreateKeyspace?
Section titled “autoCreateKeyspace?”
readonlyoptionalautoCreateKeyspace?:boolean
Defined in: src/persistence/journals/CassandraClient.ts:42
If true, create the keyspace on startup (simple strategy, rf=1). Dev-friendly default.
Inherited from
Section titled “Inherited from”CassandraConnection.autoCreateKeyspace
autoCreateTables?
Section titled “autoCreateTables?”
readonlyoptionalautoCreateTables?:boolean
Defined in: src/persistence/journals/CassandraJournal.ts:30
Auto-create the events/metadata/all-ids tables on first connect.
client?
Section titled “client?”
readonlyoptionalclient?:CassandraClientLike
Defined in: src/persistence/journals/CassandraJournal.ts:59
Inject a pre-built client instead of letting the journal instantiate
cassandra-driver itself — useful for tests and when the host already
owns the client lifecycle.
consistency?
Section titled “consistency?”
readonlyoptionalconsistency?:number
Defined in: src/persistence/journals/CassandraClient.ts:55
CQL consistency level to use for all reads and writes. Default:
LOCAL_QUORUM (value 6 in the driver). Pass the numeric value from
cassandra-driver’s types.consistencies.
Inherited from
Section titled “Inherited from”CassandraConnection.consistency
contactPoints
Section titled “contactPoints”
readonlycontactPoints: readonlystring[]
Defined in: src/persistence/journals/CassandraClient.ts:32
Node(s) to seed the cluster topology from.
Inherited from
Section titled “Inherited from”CassandraConnection.contactPoints
credentials?
Section titled “credentials?”
readonlyoptionalcredentials?:object
Defined in: src/persistence/journals/CassandraClient.ts:38
Optional username/password for PLAIN auth.
password
Section titled “password”password:
string
username
Section titled “username”username:
string
Inherited from
Section titled “Inherited from”CassandraConnection.credentials
eventsTable?
Section titled “eventsTable?”
readonlyoptionaleventsTable?:string
Defined in: src/persistence/journals/CassandraJournal.ts:16
Table name for events. Default: events.
keyspace
Section titled “keyspace”
readonlykeyspace:string
Defined in: src/persistence/journals/CassandraClient.ts:36
Keyspace to USE after connect. Must already exist, or pass autoCreateKeyspace: true.
Inherited from
Section titled “Inherited from”localDataCenter?
Section titled “localDataCenter?”
readonlyoptionallocalDataCenter?:string
Defined in: src/persistence/journals/CassandraClient.ts:34
Local DC — required for DCAwareRoundRobinPolicy. Defaults to datacenter1.
Inherited from
Section titled “Inherited from”CassandraConnection.localDataCenter
metadataTable?
Section titled “metadataTable?”
readonlyoptionalmetadataTable?:string
Defined in: src/persistence/journals/CassandraJournal.ts:18
Table tracking the highest sequence number per pid. Default: metadata.
partitionSize?
Section titled “partitionSize?”
readonlyoptionalpartitionSize?:number
Defined in: src/persistence/journals/CassandraJournal.ts:28
Rows per partition before rolling over to a new one. Keeps Cassandra partitions bounded. Default: 500_000 — a good balance between write amplification and read-scan cost for long-lived streams.
readonlyoptionalport?:number
Defined in: src/persistence/journals/CassandraClient.ts:40
Port — defaults to 9042.
Inherited from
Section titled “Inherited from”replication?
Section titled “replication?”
readonlyoptionalreplication?:object
Defined in: src/persistence/journals/CassandraClient.ts:44
Replication settings used by autoCreateKeyspace. Ignored otherwise.
class?
Section titled “class?”
readonlyoptionalclass?:"SimpleStrategy"|"NetworkTopologyStrategy"
dataCenters?
Section titled “dataCenters?”
readonlyoptionaldataCenters?:Readonly<Record<string,number>>
For NetworkTopologyStrategy, map of DC → replication factor.
replicationFactor?
Section titled “replicationFactor?”
readonlyoptionalreplicationFactor?:number
Inherited from
Section titled “Inherited from”CassandraConnection.replication
tagIndexTable?
Section titled “tagIndexTable?”
readonlyoptionaltagIndexTable?:string
Defined in: src/persistence/journals/CassandraJournal.ts:22
Tag-index side table populated when useTagIndex is set. Default: events_by_tag.
useTagIndex?
Section titled “useTagIndex?”
readonlyoptionaluseTagIndex?:boolean
Defined in: src/persistence/journals/CassandraJournal.ts:53
Opt in to maintaining an events_by_tag side table for indexed
eventsByTag queries (#44). When set, every append writes one
extra row per (event, tag) pair to the side table inside the same
batch as the primary events insert; CassandraQuery.currentEventsBy Tag then walks a single tag-partition instead of scanning the
whole journal client-side.
Off by default to keep existing schemas compatible — operators
opting in must run the side-table DDL on their cluster (the journal
issues CREATE TABLE IF NOT EXISTS when autoCreateTables is also
true; otherwise the DDL in CassandraClient.tagIndexDdl can
be applied manually).
Caveat: delete(toSeq) does NOT propagate to the side table —
deleting from events_by_tag would require either a secondary
index on persistence_id or pre-reading the event’s tags (extra
round-trips on the hot path). Operators with delete-heavy
workloads should rely on Cassandra TTLs or accept stale tag
entries (queries dedupe via the primary key, so they’re harmless
— just storage overhead).