gen_persistence: persist the state of your processes

Often we want to persist the state of our Erlang processes so that it can be recovered after a crash, started/restarted on demand (via a supervisor or manually) or migrated in the cluster via a storage provider. To solve it Benoit has created a new small opensource library.

With gen_perstistence all events coming to your modules are stored to the disk and replayed on restart but it’s also possible to store a snapshot of the state to reduce the recovery time. An implementation of gen_statem and gen_server with persistence is also provided.

OBJECTIVES

This talk will describe the usage of gen_persistence and how to create custom plugins to store the events and the snapshots.

TARGET AUDIENCE

Any developer interested in discovering an intuitive way to build a stateful middle-tier using Erlang.