SQL Server Storage
For operational reasons, you should familiarize yourself with the underlying
database schema. The schema is implemented as two tables,
Messages, and a number of indexes.
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
IdOriginaland 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 the
Idcolumn. If not then a
Sha1hash of the Id is generated and used. This helps with stream lookups and the Id unique index constraint.
IdInternalidentity column is used for joins with the messages table.
Please refer to
CreateSchema.sql for full schema details.
Initializing the Database
Migrating from V2 Schema to V3