Log for concurrent workloads, with support for atomic batches and in-order recovery

Related tags

Logging sharded-log
Overview

sharded-log

A batch-oriented multi-threaded sharded log for workloads that occasionally flush logs into some other system. All batches have a 32-bit CRC written with them. Even though writes may happen to different log shards concurrently, recovery is single-threaded and will recover batches in the order that a monotonic ID was written to them during the write process. See the concurrent tests for examples of how this may be reasoned about.

Built specifically to complement the marble on-disk garbage-collecting object store by buffering updates before flushing them to storage. Intended to be used in a "rolling" manner where you create a new ShardedLog instance and swap it out while serving concurrent write requests, so that flushing to secondary storage can happen in the background, followed by a removal of the sharded log directory after it's stable.

use sharded_log::Config;

let config = Config {
    path: "path/to/logs".into(),
    ..Default::default()
};

// purge
config.purge().unwrap();

// logs must be created in fresh directories (after a purge)
let sharded_log = config.create().unwrap();

sharded_log.write_batch(&[b"a", b"b", b"c", b"d"]).unwrap();

for write_batch in config.recover().unwrap() {
  // recover contents to secondary storage
  assert_eq!(write_batch, vec![b"a", b"b", b"c", b"d"]);
}

// purge contents when important data is safe elsewhere
sharded_log.purge().unwrap()
You might also like...
Cloud native log storage and management for Kubernetes, containerised workloads
Cloud native log storage and management for Kubernetes, containerised workloads

Live Demo | Website | API Workspace on Postman Parseable is an open source, cloud native, log storage and management platform. Parseable helps you ing

Fill Apache Arrow record batches from an ODBC data source in Rust.

arrow-odbc Fill Apache Arrow arrays from ODBC data sources. This crate is build on top of the arrow and odbc-api crate and enables you to read the dat

Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

Log agent to replay time-stamped log stream

replayman Log agent to replay time-stamped log stream. Getting started Installation cargo install replayman Prepare for your data TSV with a header li

Run your Rust CLI programs as state machines with persistence and recovery abilities

step-machine Run your CLI programs as state machines with persistence and recovery abilities. When such a program breaks you'll have opportunity to ch

Crash recovery for Darktide. There's heresy to be smote and no time to waste.
Crash recovery for Darktide. There's heresy to be smote and no time to waste.

Darktide Rebooter 🥾 ↪️ 🥾 Automatically boot the game up again (and bypass the launcher) immediately after a crash. There's heresy to be smote and no

A WIP svelte parser written in rust. Designed with error recovery and reporting in mind

Svelte(rs) A WIP parser for svelte files that is designed with error recovery and reporting in mind. This is mostly a toy project for now, with some v

The rust client for CeresDB. CeresDB is a high-performance, distributed, schema-less, cloud native time-series database that can handle both time-series and analytics workloads.

The rust client for CeresDB. CeresDB is a high-performance, distributed, schema-less, cloud native time-series database that can handle both time-series and analytics workloads.

A crate to implement leader election for Kubernetes workloads in Rust.

Kubernetes Leader Election in Rust This library provides simple leader election for Kubernetes workloads.

A Zincati lock backend for stateful workloads.

This repository is deprecated. We realized CoreOS is probably not a good fit for us. The repository will be kept up on the off chance that this is use

Fast, concurrent, arena-based allocator with drop support

blink-alloc Blink-alloc is extremely fast allocator based on the common idea of allocating linearly zipping a cursor through memory chunk and reset ev

Sharded, concurrent mini redis that support http interface implemented in rust

Rudis A mini version of redis server that provides http interface implemented in Rust. The in-memorry kv-storage is sharded and concurrent safe. Inspi

Create, share, fetch and model Atomic Data! This project consists of a graph database + server, a CLI and a rust library.

Create, share, fetch and model Atomic Data! This repo consists of three components: A library, a server and a CLI. atomic-server Status: Beta. Breakin

Cross-platform atomic wait and wake (aka futex) functionality for Rust.

Cross platform atomic wait and wake (aka futex) functionality. This crate only supports functionality that's available on all of Linux, Windows, and m

An intent-centric, privacy-preserving protocol for decentralized counterparty discovery, solving, and multi-chain atomic settlement.

Anoma Blockchain prototye This prototype aims to reproduce the following topology: ┌────────┐ ┌───────────┐ │ ┌───────┐ │Sol

Mirroring remote repositories to s3 storage, with atomic updates and periodic garbage collection.

rsync-sjtug WIP: This project is still under development, and is not ready for production use. rsync-sjtug is an open-source project designed to provi

Atomic Physics Library

Iridium Atomic Physics Library Attempt at making a atomic database. Uses Nubase2020, ENSDF for decay chains, atomic masses, and half-lives. Nubase2020

Arduino Nano frequency counter with atomic clock accuracy
Arduino Nano frequency counter with atomic clock accuracy

Arduino Nano frequency counter with atomic clock accuracy Project description and test setup With this project you can measure a frequency from less t

Portable atomic types.

portable-atomic Portable atomic types. Provide all atomic integer types (Atomic{I,U}{8,16,32,64}) for all targets that can use atomic CAS. (i.e., all

Owner
Komora
Komora
A nginx log explorer

Rhit reads your nginx log files in their standard location(even gzipped), does some analysis and tells you about it in pretty tables in your console,

Canop 700 Dec 27, 2022
A loki logger for the log facade

Loki Logger A loki logger for the log facade. Examples extern crate log; extern crate loki_logger; use log::LevelFilter; #[tokio::main] async fn main

Thomas Nicollet 11 Dec 24, 2022
rt-history: An RT-safe history log with error checking

rt-history: An RT-safe history log with error checking This is a bounded wait-free thread synchronization primitive which allows you to record the tim

Hadrien G. 3 Oct 11, 2022
A cool log library built using rust-lang

RustLog A cool log library built using rust-lang Installation: Cargo.toml rustlog = { git = "https://github.com/krishpranav/rustlog" } log = "0.4.17"

Krisna Pranav 2 Jul 21, 2022
Firecracker takes your HTTP logs and uses them to map your API flows and to detect anomalies in them.

Who is BLST and what do we do? BLST (Business Logic Security Testing) is a startup company that's developing an automatic penetration tester, replacin

BLST 692 Jan 2, 2023
A pretty, sensible logger for Rust - ideal for running examples and tests on a crate of choice

sensible-env-logger A pretty, sensible logger for Rust - ideal for running examples and tests on a crate of choice. This is a thin wrapper around pret

Ritvik Nag 3 Aug 9, 2022
SWC Transform to prefix logs. Useful for adding file and line number to logs

SWC Transform to prefix logs. Useful for adding file and line number to logs

William Tetlow 12 Jan 1, 2023
A rust library for creating and managing logs of arbitrary binary data

A rust library for creating and managing logs of arbitrary binary data. Presently it's used to collect sensor data. But it should generally be helpful in cases where you need to store timeseries data, in a nearly (but not strictly) append-only fashion.

Yusuf Simonson 1 May 9, 2022
Rall is an incredibly simple and intuitive logger

Really...? Another Logging Library? Yes! :P rall is an incredibly simple and intuitive logger, consider this crate a failure if you can't get setup wi

Hamothy 4 Sep 5, 2022
A dead simple logger that works globally and across threads.

Woody A logger for Rust that's *actually* easy to use. Features Easy to use: Just import the macros and you're good to go. No need to configure anythi

Travis A. Wagner 11 Apr 13, 2023