created_at2023-06-16 21:11:53.023785
updated_at2023-06-16 21:14:40.833642
descriptionTransparent object persistence with predefined operations and state containers.
Jonathan E. Magen (yonkeltron)



Hi, I'm Madeleine

WARNING: I am very early alpha and not even feature-complete yet! Do not use me, but feel free to chip in to lend a hand.

I'm a Rust library for building stateful applications with persistent state containers. My inspiration comes from Ruby's madeleine gem and, transitively, the earlier Java Prevalayer library.


Using Madeleine, you model applications purely as predefined operations on a protected data structure. These operations are called commands and which may mutate the state of a protected data structure called a system. Using this model, every command which gets executed is transparently serialized and added to an append-only log in which their order is retained. Since the commands are the only things capable of altering the system, this constitutes a complete history of how the application's current state came to be. As every command log is persisted to disk, an application can exit or crash with the understanding that it may replay the command log on resumption without apparent effect. In other words, it could conceivably pick back up right where it left off.


To see it in action, check out the examples directory for sample code.


This installation method requires a recent version of Cargo which supports cargo-add:

cargo add madeleine

For older installations of Rust, you can either use cargo-edit or simply add the dependency to you Cargo.toml manually:

madeleine = "0.2.0" # Or latest version

Feature Roadmap

  • Main, top-level Madeleine interface
  • Example code
  • Snapshot logic
  • Command logging
  • Persistence
    • Commands
    • Snapshots
  • Resumption/rehydration from
    • Command log
    • Snapshots
    • Mixed scenarios involving commands following a snapshot
  • Garbage collection
  • Benchmarks
  • Integration tests

Wish list

  • Concurrency/parallelism support
  • Async interfaces
  • Background processing
  • Storage compression
  • Additional and pluggable storage formats, possibly through features:
    • JSON
    • TOML
    • CBOR

Getting help

If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.

Getting involved

Please see the file for info on how to get involved.


Madeleine is Open Source Software released under the Apache 2.0 license.

Commit count: 10

cargo fmt