Programming language for choosing distributed messaging algorithms

In principle, I would like to implement the following algorithms and analyze how a system built using these algorithms behaves under different conditions.

  • Gossip protocol
  • Several paxos
  • Consistent Hashing

My interest here is in these algorithms. I am mainly looking for a programming language that allows me to quickly write down these algorithms and understand these algorithms.

Which language to choose? Java, Scala, Erlang or something else.

I currently know Java and C ++.

+6
source share
4 answers

You can try to run protocols in Erlang.

  • Process communication is very elegantly baked in language and virtual machine. An asynchronous message passing between two elrang processes, either in the same virtual machine or through virtual machines in semantic equivalent.
  • Coding in aspects of fault tolerance / retry logic, etc. an algorithm is a breeze in erlang. Encapsulate everything in lightweight processes and use special processes called supervisors to restart them.
  • Serializing Erlang objects is very simple. You do not need to explicitly code the Serialization logic (e.g. implement Serializable in Java).
  • Distribution Erlang comes with an rpc module that allows you to call functions on remote virtual machines.
  • The Elrang rocket is a true divine premise. You can attach the shell to any remote virtual machine. The shell allows you to view internal tables / data structures. The VM also has extremely sophisticated debugging and tracking features that are available to you through the shell.
  • You can take a look at Riak , the open source NoSQL data warehouse written in Erlang, modeled on Amazon Dynamo. It implements the Consistent Hashing protocol and the Gossip protocol.
+8
source

Oh yeah! you can start programming Erlang by looking at them:

Those links above will provide you with resources for all the Erlang programs you may need. However, I suggest starting with the Joe Armstrongs Programming Erlang Text Book , and after reading it, use the website: Learn you some erlang for great good (link No. 1 above) as a link for further understanding of data structures.

You can download Erlang from here: Erlang Download the official page .

You may need other links and resources (applications, libraries, etc.), most of which are indexed here: Erlang / OTP.com website .

Sometimes you can always ask any question on Stackoverflow here, or you can search for tools and libraries from sourceforge.

+4
source

All these protocols have already been implemented in various Erlang projects. See Mnesia , Riak , CouchDB , Scalaris for more information (not all protocols in each project). I cannot imagine a friendlier environment for such protocol experiments besides Erlang.

+2
source

Have you decided on your messaging library? If you are interested in MPI, both java and C ++ versions are available.

MPI performs many tasks for you, such as broadcasting a message and receiving responses, which is essential for your algorithms. As a result, I recommend that you find the appropriate MPI version for C ++ or Java and get started.

Take a look at:

0
source

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


All Articles