HarperDB offers two options for logging transactions executed against a table. The options are similar but utilize different storage layers.
The first option is read_transaction_log
. The transaction log is built upon clustering streams. Clustering streams are per-table message stores that enable data to be propagated across a cluster. HarperDB leverages streams for use with the transaction log. When clustering is enabled all transactions that occur against a table are pushed to its stream, and thus make up the transaction log.
If you would like to use the transaction log, but have not set up clustering yet, please see "How to Cluster".
The read_transaction_log
operation returns a prescribed set of records, based on given parameters. The example below will give a maximum of 2 records within the timestamps provided.
See example response below.
See example request above.
The delete_transaction_logs_before
operation will delete transaction log data according to the given parameters. The example below will delete records older than the timestamp provided.
Note: Streams are used for catchup if a node goes down. If you delete messages from a stream there is a chance catchup won't work.
Read on for read_audit_log
, the second option, for logging transactions executed against a table.