anonymous23801
Joined 4 years ago
Joined 4 years ago
In postgres that would be trivial with revision schemas and a clever usage of the SEARCH_PATH.
It's true that as a beginner you can simply do web development with Phoenix and that feels similar to Rails (Or Django / Laravel / Spring / whatever web framework ). But OTP requires a different way of approaching problems.
It's not that it's functional (that's completely secondary in Erlang) but its fault tolerance primitives (processes, pids, mailboxes, monitors and links) and the OTP abstractions (GenServers, Supervisors, etc).
You learn to think in terms of distributed systems and think about fault tolerance in a way you cannot in other languages as they don't provide the primitives. It's quite a big leap and it takes time to sink in.
Toon Koppelaars shows that in a few experiments done with Oracle ( https://www.youtube.com/watch?v=8jiJDflpw4Y&ab_channel=Oracl... )
Also very often doing the work in the DB means a simpler solution, fewer race-condition issues, and less work overall.
When talking about this particular case, the CHECK constraint, it is probably matter of measuring the impact and understanding at which point this might be relevant, and considering the cost of the alternative implementation at the application layer