SQL Server Storage
For operational reasons, you should familiarize yourself with the underlying
database schema. The schema is implemented as two tables, Streams
and
Messages
, and a number of indexes.
The Streams
table contains the collection of unique streams in the store. As
stream Ids are strings there are a number of optimisations applied:
-
The original stream Id is stored in column
IdOriginal
and limited to 1000 characters. -
When a stream is appended for first time is it checked to see if it is parsable as a
Guid
. If so, then that is stored in theId
column. If not then aSha1
hash of the Id is generated and used. This helps with stream lookups and the Id unique index constraint. -
An
IdInternal
identity column is used for joins with the messages table.
Please refer to CreateSchema.sql
for full schema details.
Initializing the Database
TODO
Using
TODO
Migrating from V2 Schema to V3
TODO