Howard
Howard

Reputation: 19805

akka or similar alternative for golang to support distributed concurrency?

I know golang is very good at concurrency with its built-in support, but seems to me they are not distributed, so what would be the framework/library allow us to write producers/consumers applications, in a distributed environment.

Upvotes: 32

Views: 27757

Answers (6)

robcxyz
robcxyz

Reputation: 641

Such an old question but I would check out dapr and protoactor.

dapr is more flexible but carries overhead from employing a sidecar pattern.

protoactor is more like akka having been written by the same guy who made akka.net.

Both are good depending on your use case. This blog does a good comparison of the performance.

Upvotes: 0

Ismail H
Ismail H

Reputation: 4479

Akka is based on the Actor Model. For that, there is a nice Go framework I invite you to test : https://github.com/AsynkronIT/protoactor-go

It is said to have great performance since it claims to be passing between nodes:

two million messages per second

While Go is already implementing using CSP, Protoactor adds :

  • Decoupled Concurrency
  • Distributed by default
  • Fault tolerance

Upvotes: 6

Kaveh Shahbazian
Kaveh Shahbazian

Reputation: 13513

Just for the record NATS is a high performance solution for distributed systems. It's open source and under MIT license. "The core NATS Server acts as a central nervous system for building distributed applications." and it has official clients for Go, C#, Java, Ruby, Python, Node.js and much more provided by the community.

Upvotes: 4

Roger Johansson
Roger Johansson

Reputation: 23214

Two years late but if anyone else is looking. https://github.com/AsynkronIT/gam

GAM (Go Actor Model) supports both Akka like actors, and Ms Orleans like Virtual Grains. The Ms Orleans like Virtual Grains are supported via Protobuf code generation to give you typed messages and typed grain types. See https://github.com/AsynkronIT/gam/blob/dev/examples/cluster/member/main.go https://github.com/AsynkronIT/gam/blob/dev/examples/cluster/shared/protos.proto

It's also extremely fast, 1 mil+ remote messages per sec.

Upvotes: 7

Caleb
Caleb

Reputation: 9458

No need to reinvent the wheel here... producer/Consumer applications are usually built using a message queue.

With this approach you should try to break up your problem into small (and ideally idempotent) tasks, build an application which can enqueue these tasks, and then have another worker application which can dequeue these tasks and execute them. Scaling is easy: just add more workers.

There are lots of queuing solutions out there, for a very good one written in Go take a look at NSQ.

Upvotes: 10

James Henstridge
James Henstridge

Reputation: 43899

If you want to use Go's channel concepts in a distributed program, perhaps check out the Go Circuit framework.

It provides a framework for running multi-process programs (possibly spread over multiple machines), allowing you to use channels to communicate between those processes.

Upvotes: 23

Related Questions