mudasobwa

mudasobwa

Creator of Cure

Wrote some rant on Business Process Driven Development with Finite Automata (and Finitomata library in particular.)

Showing Posts 1 to 6

D4no0

D4no0

It would be interesting to see a real world example with ecto, because while using FSM seems like a great idea, in the real world we have to deal with server restart, migrations and other things, and a FSM doesn’t seem to be most flexible approach in this case.

In general we kind of use this concept in practice with phoenix by using the contexts pattern, having some well defined functions that interact with database in a controlled manner, and we use them to abstract actions that might change data across multiple tables with respect to business logic, the only thing of course is to enforce the developer to use them instead of direct operations to database.

mudasobwa

mudasobwa OP

Creator of Cure

Technically, there is a [contrived] real-world example mentioned in the post, but it might be treated as a proof of concept only.

Server restarts are handled with loading all the entities in the intermediate states (in the middle of their lifecycle) as processes upon server restarts, and the migrations are handled in the same way as hot code upgrades in OTP itself.

This sounds as a great step towards data consistency, the only difference would be FSM does indeed prove the data is consistent.

That would not be so hard once using them is simpler and cleaner compared to direct calls, and our experience shows Finitomata gives that to developers. Also, a couple of weeks of using it makes people feel why it makes total sense, it reminds me of a mind shift required when one start using OTP (actor model) instead of, say, JDK (pure OOP.)


And yes, of course, I am working on the real-world example to be published.

D4no0

D4no0

Definitely sounds very interesting, I will give it a try when I will have some time.

ChrisYammine

ChrisYammine

There is even the brand new wording invented by people who had most likely never been to the university.

Taken from the blog post you shared. I’m sure you have lots of insightful things to say, but I don’t think you need to try and negatively characterize a group of people to say them.

RudManusachi

RudManusachi

Instead of random requests, modifying the internal data of the application directly (as every single protocol known to me allows in a nutshell,) the endpoints in the web application should expose transition handlers only. The outmost world should not be allowed (and therefore even have an access) to modify data directly. It should be permitted to initiate transitions only.

This reminded me of CQRS pattern, where “commands” are used to create/modify data (usually not directly to the DB schema but to some sort of an “event store”) and queries are “read only”.

mudasobwa

mudasobwa OP

Creator of Cure

Yes, it is somewhat similar, oldie but goldie, and FSM are proven to keep a consistent state.

— All posts loaded —

Where Next? Top

Trending in Blog Posts Top

pckrishnadas88
Hey everyone! :waving_hand: I’ve published Part 7 of the Building Distributed Systems in Elixir series, where we build core distributed ...
New
mudasobwa
So, instead of wasting my afternoon arguing with anonymous handles on X, I turned to my trusty, soulless assistant and said: “Listen, ple...
New
abreujp
New article: Elixir Project Structure — From mix new to a Growing Codebase I’ve published a new article in my Elixir learning series on d...
New
zorn
An educational side project in Elixir, Phoenix, and Tauri. I share what I learned while wiring Automerge into the BEAM, including how I s...
New
jola
Wrote about how to safely run a globally unique process in an Elixir cluster, and a scary story from the past! Learn about :global for r...
New
jola
The way Phoenix is set up adding a CDN sub-domain for serving static assets, without worrying about the main dynamic content, is incredib...
New
UlfAnger
What happens when an AI agent reaches its limit because the required tool isn’t in its catalog? Normally, you get a polite refusal. I wa...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews