1 comment

[ 5.1 ms ] story [ 7.5 ms ] thread
There's a really neat pattern for building stateful apps on Postgres that can handle millions of entities concurrently.

Traditionally you'd need Kafka / RabbitMQ / other external components. But FOR UPDATE SKIP LOCKED basically make these redundant for some types of applications.

I found it particularly useful for building LLM-based agents that can transition between different states.

I created a short video to demonstrate the concept: https://youtu.be/VvDHi-H0Jck?si=WuUhUyIOuZ6jj8BO

Hope you find it useful!