Prevalence (Prevayler) for Rust


Recently we started to add Diesel to the RealWorld example app in Rust.

While going through the code, I recalled ages ago we used Bamboo.Prevalence when developing in .NET. I think there is definitely a space for these persistence engines and there are good use case for them.

Don’t you know about a Prevalence system for Rust? Or do you think it would bring benefits to the Rust developers?




What’s a ‘prevalence engine’?


Sorry for not mentioning it in the first post.

Prevalence engine is a very simple persistence pattern where the whole state of the system is kept in the memory (struct instances in our case with one parent system instance). To make the state survive the application shutdown, the state is regularly written to the disk and all the transactions (operations, calls whatever you want to call them) are also journaled.

Since everything is kept in the memory, getting the correct data is orders of magnitude faster than getting them from a database.