-
Notifications
You must be signed in to change notification settings - Fork 49
Transaction Log
==== Before applying any update to the in-memory state it is first written to some persistent storage, then applied to memory asynchronously. It is important to note that this persistent storage must implement an ordering of the updates so that the updates can be read from the persistent storage in the order they are applied to the in-memory state. The transaction log is a replaceable component in the system.
At a basic level the transaction log needs to implement a function to write to the transaction log in order, perform an ordered traversal of entries in the log over a range of entries, compact the log, return the next sequece number, and the size of the transaction log.
Updates to the in-memory state are written to persistent storage via the transaction log via invocation of the writeEntry(...)
method. Without any method to shrink the size of the log the updates take up increasing amounts of the storage. As updates are no longer needed to be tracked as a result of a subsequent update, Sirius attempts to keep just the last update stored persistently. This is implemented by periodically invoking the compact()
function. This allows the storage space used by Sirius to grow as updates are added to the state, then shrink by discarding the older updates that have been superseded by later updates.
Sirius includes an implementation of a transaction log that is fully featured and designed to work at a high level of performance. This implementation utilizes files on disk to store the transaction log events. The included transaction log implements live compaction of these events to keep the size of the log files from growing unchecked.
####SiriusLog Interface The interface for the transaction log is defined as a Scala trait named SiriusLog.
SiriusLog defines the following functions:
- writeEntry
- foreach
- foldLeft
- foldLeftRange
- compact
SiriusLog defines the following fields
- getNextSeq
- size
The functions foreach and foldLeft have implementeations and do not need to be reimplemented by the the class implementing the log.
Copyright 2013-2017 Comcast Cable Communications Management, LLC
Using Sirius
Getting started with Sirius
Configuring Sirius
How to Deploy Sirius
Reference Applications
Migrations and Release Notes
Migration Guide 1.1.x to 1.2.x
Release Notes 2.0.0
Migration Guide 1.2.x to 2.0.x
Developing Sirius
Getting Started
Contributing Guildelines
License
Releasing Sirius
Scaladocs
Test Timeout Failures
Transaction Log
Implementation
Live Compaction
waltool
Other