1,979 karma · joined January 16, 2009
Compare: https://github.com/Microsoft/WinObjC/blob/106d8b2738101872a1... and https://github.com/steipete/PSTCollectionView/blob/master/PS...
Edit: They added the license https://github.com/Microsoft/WinObjC/commit/611e9e5a4b837360...
If you go with one GenServer per node, then that one just connects to redis and just pulls jobs (using BLPOP or whatever). When it has gotten a job it checks out a worker from poolboy and assigns it that work.
You could also just have every single worker process go directly to redis and have it pull jobs in a loop. But where's the fun in that ;)
If you want a single global coordinator instead of one per node you can use :global [2] to globally register a process in the cluster. This process is then cluster-wide reachable under its registered name. It can talk to each of your worker pools in the cluster and round-robin try to check out workers and assign them work. And if you do this you might as well ask yourself if you really need redis instead of keeping it all within your Elixir system.
Deciding on which node this process lives is still up to you, but there are libraries like locks [3] that allow you to automatically determine a leader in your cluster.
And once this is done you can start dealing with overload :)
Of course this is just a simple and naive approach, there are a lot of really useful Erlang libraries to check out. Here's a list of libs that helped me when getting started by reading their docs and sources in no particular order:
https://github.com/heroku/canal_lock - Erlang lock manager for concurrently variable resource numbers
https://github.com/jlouis/safetyvalve - queueing facilities for tasks to be executed so their concurrency and rate can be limited on a running system
https://github.com/fishcakez/sbroker - process broker for matchmaking between two groups of processes using sojourn time based active queue management to prevent congestion.
https://github.com/ferd/backoff - exponential backoffs and timers to be used within OTP processes when dealing with cyclical events, such as reconnections, or generally retrying things
https://github.com/jlouis/fuse - A Circuit Breaker for Erlang
https://github.com/basho/sidejob - Parallel worker and capacity limiting library for Erlang
https://github.com/pspdfkit-labs/sidetask - My humble Elixir wrapper for basho's sidejob
[1] https://github.com/devinus/poolboy also used in Ecto, look through the Ecto sources if you want to see how it's used in Elixir.
[2] http://erlang.org/doc/man/global.html
[3] https://github.com/uwiger/locks and then https://github.com/uwiger/locks/blob/master/doc/locks_leader...
Isn't that exactly what "every database ever" calls triggers?
From the Postgres docs: http://www.postgresql.org/docs/9.4/static/trigger-definition...
> A trigger is a specification that the database should automatically execute a particular function whenever a certain type of operation is performed. Triggers can be attached to tables, views, and foreign tables.
Even NoSQL DB's like redis or riak have the ability to execute user-supplied Lua resp. Erlang.
http://docs.basho.com/riak/latest/dev/advanced/commit-hooks/
There's a talk from Erlang Factory SF 2015 about the changes as well: https://www.youtube.com/watch?v=gfsc2MyP8p8
I think the concepts presented are applicable to all systems and not really Erlang specific, so I highly recommend it.
Can someone explain this? I don't see what this has to do with the randomness of pids.
We (bootstrapped and proud) build the leading PDF Framework for iOS and will launch an Android version soon. Dropbox and Evernote (also IBM & SAP) are just some of the companies that use our framework in their Apps.
Our headquarters is in Vienna, Austria, but our team can be found all over the world in places like Raleigh, Hamburg, Ljubljana, Kiev, Mexico City, and Berlin. We are committed to having the best developers regardless of location.
★ Android Engineer -- Help us build PSPDFKit for Android, our upcoming PDF framework for Android. PSPDFKit for iOS is the leading PDF framework on iOS, it's used by Dropbox and Evernote, and we want PSPDFKit Android to match that level.
★ Frontend Engineer -- We recently started building a customer-facing product to complement our native frameworks and are looking to hire a HTML/CSS/JS Frontend engineer with experience in React/Ember/Angular to join our team.
★ Ruby on Rails Engineer --We recently started building a customer-facing product to complement our native frameworks and are looking to hire a Ruby on Rails engineer to join our team.
Send us an email if this sounds interesting: jobs@pspdfkit.com
I think this is the actual study: http://www.cell.com/cell-stem-cell/abstract/S1934-5909(14)00...
Availability zones: Hetzner has multiple independent DCs and they are happy to place your servers in different DCs if you ask them. What Amazon calls "Elastic IP" they call "Failover IP".
Yes if you only need to host your blog yet you don't want it to go down when the HW inevitably fails, don't go to Hetzner because setting up Postgres failover and Chef and all that is complicated.
And if you're big / have enough money Hetzner's off-the-shelf HW and their unwillingness to offer an SLA will make you move away.
But there's a sweet spot for Hetzner, it's where you want good performance for a great price, have enough money/knowledge to setup proper bare metal deployments with failover yet don't yet need the guarantees of a "premium" DC or the features of AWS.
I know quite a few companies which fit that description.
I talked to some colleagues about scaling with Hetzner and their answer was to just overprovision like crazy since Hetzner's so cheap anyhow.
https://www.youtube.com/watch?v=jytJXjI0oQU https://speakerdeck.com/seancribbs/just-open-a-socket-connec...
Other talks from ricon.io and the various Erlang conferences are great too, but those are more about distributed systems and not primarily network programming. But since you mentioned the ZeroMQ patterns that should be just what you want.
http://thinkdistributed.io/ http://ricon.io/ https://www.youtube.com/user/ErlangSolutions/videos
At the heart of the French government’s campaign is the
concern that American prosecutors have created a two-tiered
system of justice: one in which American and British banks
escape criminal charges and the other that forces BNP to
plead guilty to sanctions violations and pay a record fine.Go's goroutines also somewhat approach proper user-space preemption/isolation.
Yes there are GCs for C, but is anyone successfully doing "systems programming" (whatever that may be) in C with GCs?
See also http://thoughtcrime.org/blog/telegram-crypto-challenge/ (comments: https://news.ycombinator.com/item?id=6936539 )
What am I missing? UPDATE: I transposed digits and looked at the PB278Q not the PB287Q.
[1] https://www.apple.com/displays/specs.html
[2] http://www.amazon.com/PB278Q-27-Inch-LED-lit-Professional-Gr...
For me it's not so much about bringing a nicer syntax to Erlang (Erlang's syntax is very nice once you get used to it, except for single assignment IMO. I'd prefer it if Elixir had taken Erlang's syntax and added support for rebinding variables and macros) but about tooling (mix, the build tool absolutely rocks) and libraries (e.g. take a look at http://github.com/elixir-lang/ecto).