Could the Clojure STM model work on multiple JVMs?

I know that Clojure works well on a multi-core machine, but I was wondering if it makes sense to work on a JVM cluster common on many machines?

+6
source share
4 answers

Runa reviewed the use of Terracotta for this and finished publishing swarmiji as a library of distributed agents.

One of the real differences between an SMP system and a cluster is shared memory. In a cluster, code must request data, while in SMP, it can simply read it directly. This has some good advantages and some (scalable) disadvantages.

Clojure STM, which differs significantly from many other STM systems, is based on the concept of relative time , measured by the generation counter for each transaction. Without general access to the counter of this generation, he cannot give events an order and cannot carry out this work (I apologize for this overly simple explanation).

One of the main motives of STM was to create a system that really used shared memory concurrency , ensuring, for example, that readers never wait for writers and readers to always see reliable data. Since it was built to use shared memory, it loses a lot of its appeal without shared memory.

The actor model (ala Erlang) is better suited for distributed computing.

Or, in other words: perhaps we should not try to put a square snap in a distributed parallel hole.

+6
source

Not really. I mean, it can be made to work; things like Terracotta claim to be able to distribute a logical JVM across multiple nodes, but clojure STM / Collection semantics relies heavily on cross-thread sharing to be time and time efficient.

You are probably better off taking care of the parts of the <- w630> system of your system using a transfer-oriented or packet-oriented architecture.

+6
source

I could do it, but this is not a good idea. The reason is that NoSql is big right now because the transaction is not working well on the network.

+3
source

The Avout project allows you to distribute STM state across multiple machines:

+1
source

Source: https://habr.com/ru/post/886409/


All Articles