Scala or Clojure Functional Programming best practices

clojurefunctional programmingscala

I did a lot of self-study coding, got some experience with Parallel Programming Models: Actors, Software Transactional Memory, Data Flow.

When I am trying to apply these architectures to real life – into high load web application – any model doesn't support durability and persistence for data. Real life tasks requires to save data at the end. This means that still I have to use DB and trapping DB syncs, possible scalability bottle necks etc.

Does anybody knows good example of architecture (src or text or diagram or blueprints) that uses Akka Actors or Software Transaction Memory and implement persistence at the end?

Any good example/idea for Transactional Memory, Actors, Dataflow, Tuple spaces in real life applications is welcome.

Best Answer

Actor / STM models and database persistence are somewhat orthogonal - you can easily have one without the other, and I think there is a danger of confusing the two.

Achieving Durability (the D in ACID) is extremely complex in a transactional setting, and particularly in a distributed setting where you have actors / processes being co-ordinated by message passing. You get into thorny issues like the Byzantine Generals Problem.

As a result, I think there is always going to be some degree of tailoring the solution to meet your specififc persistence requirements. There are no "one size fits all" solutions.

Worth looking at (Clojure perspective):