Skip to content

Event Stream on AppendBlob

Duncan Jones edited this page Sep 23, 2019 · 1 revision

In the AppendBlob based implementation, each event stream is contained in its own unique blob with the path and blob name made from the combination of the domain, the entity type and the entity instance key.

For example the path for the first bank account would be:-

Bank/eventstreams/Account/A123456789.events

If the domain name, entity type or entity instance key contain characters that are not valid for an Azure blob name they are replaced with a dash (-) and the original values are stored in the named attributes of that Azure blob.

An example of that data in the blob would look something like:

[
  {
    "$type": "EventSourcingOnAzureFunctions.Common.EventSourcing.Implementation.AzureStorage.AppendBlob.BlobBlockJsonWrappedEvent, EventSourcingOnAzureFunctions.Common",
    "EventTypeName": "EventSourcingOnAzureFunctions.Common.EventSourcing.Implementation.EventInstance",
    "VersionNumber": 1,
    "SequenceNumber": 1,
    "EventInstanceAsJson": {
      "EventTypeName": "Account Opened",
      "EventPayload": {
        "LoggedOpeningDate": "2019-05-29T20:41:49.4357208Z",
        "Commentary": "Initial open account testing "
      }
    },
    "WriteTime": "2019-05-29T21:00:00"
  },
  {
    "$type": "EventSourcingOnAzureFunctions.Common.EventSourcing.Implementation.AzureStorage.AppendBlob.BlobBlockJsonWrappedEvent, EventSourcingOnAzureFunctions.Common",
    "EventTypeName": "EventSourcingOnAzureFunctions.Common.EventSourcing.Implementation.EventInstance",
    "VersionNumber": 1,
    "SequenceNumber": 2,
    "EventInstanceAsJson": {
      "EventTypeName": "Money Deposited",
      "EventPayload": {
        "AmountDeposited": 1200.00,
        "Commentary": "Opening deposit",
        "Source": null,
        "TransactionCorrelationIdentifier": null,
        "LoggedDepositDate": "2019-05-29T21:41:49.4357208Z",
        "ExpectedFundsClearedDate": "2019-06-04T00:00:00"
      }
    },
    "WriteTime": "2019-05-29T21:41:49"
  },
  {
    "$type": "EventSourcingOnAzureFunctions.Common.EventSourcing.Implementation.AzureStorage.AppendBlob.BlobBlockJsonWrappedEvent, EventSourcingOnAzureFunctions.Common",
    "EventTypeName": "EventSourcingOnAzureFunctions.Common.EventSourcing.Implementation.EventInstance",
    "VersionNumber": 1,
    "SequenceNumber": 3,
    "EventInstanceAsJson": {
      "EventTypeName": "Designated Benificiary Set",
      "EventPayload": {
        "BeneficiaryName": "Mr Duncan Jones",
        "CountryOfResidence": null,
        "ExistingCustomerIdentifier": null
      }
    },
    "WriteTime": "2019-05-29T22:01:49"
  }
]
Clone this wiki locally