Skip to content

A Stream implementation with a journal that tracks changes. Allows Commit, Rollback and Replay to provide guaranteed writes.

Notifications You must be signed in to change notification settings

LordMike/MBW.Utilities.Journal

Repository files navigation

MBW.Utilities.Journal Generic Build NuGet

An implementation of a generic transactional stream for .NET, with support for writing changes to a journal file. The journal can then be committed, rolled back or replayed to ensure consistent writes.

Packages

Package Nuget Alpha
MBW.Utilities.Journal NuGet Alpha

How to use

Refer to this example in the tests: JournaledStreamExamples.cs.

Features

  • Turn any read/write stream into a journaled stream which guarantees that writes complete fully, or can be retried
  • Easy codepath for using a file as the journal
  • Exchangeable journal file implementation, so the journal can be written other places than in files

Notes

  • If you have a database file or similar you want to protect, it is important to always wrap streams for that in JournalStreams. The reason being that if a write happens that isn't fully written to the file, it will not be noticed by future readers, if they don't also use JournalStreams
    • It is recommended to create a producer in your app, that produces the stream (wrapped in JournalStreams) for your datafile centrally, so all users get the same behavior
    • JournalStreams does not create the journal, until a write happens, so the cost of creating a JournalStreams is a file exists check (to see if a past journal existed)
  • This is not thread safe in any manner, like all other streams

About

A Stream implementation with a journal that tracks changes. Allows Commit, Rollback and Replay to provide guaranteed writes.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages