Get the latest tech news

Versioned finite-state machines with Postgres (2019)


Inspired by Felix Geisendorfer blog post I implemented a database FSM (Finite-State Machine) with Postgresql. I brought some improvements to Felix’s implementation but before reading the following I recommend you to read carefully the original post.

Inspired by Felix Geisendorfer blog post I implemented a database FSM (Finite-State Machine) with Postgresql. To keep it simple I’ll use exactly the same FSM graph than Felix: an ordering process with payment and shipment steps. If I change my transition function and table without taking care of past order_events, I will completly break my FSM.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of PostgreSQL

PostgreSQL

Photo of state machines

state machines

Related news:

News photo

PostgreSQL and UUID as Primary Key

News photo

Waiting for PostgreSQL 14: SEARCH and CYCLE clauses

News photo

Dblab: Interactive Terminal Client for PostgreSQL, MySQL, SQLite3 and Oracle