Concurrency versus Distributed Systems
November 17, 2009Andrew 3 Comments »Up until recently I was a bit fuzzy on the difference between concurrency and distributed systems. It was not until I was studying Facebook Chat, Erlang, Scala, Go, and the new python web server Tornado that it finally clicked. Concurrency simply implies that two or more pieces of code are executing at the same time. Distributed system are running concurrently on many different machines.
The difference is a critical when planning how to scale a system. With simple concurrency, you can only scale a program vertically- by adding faster or more cores, installing more ram, etc. However, a properly abstracted distributed system can be scaled horizontally – adding in more machines or nodes to the system easily by simply modifying a config file.
Scala and Erlang and Google’s new language Go share a model of concurrency based on message passing. However, only one of these languages, Erlang, natively supports distributed systems using its message passing system. Erlang’s native and transparent support of distributed computing is one of the reasons Facebook chose to use it for Facebook Chat. Other languages like Scala and Python require cumbersome third party libraries to support distributed computing. Scala’s lack of native support for distributed computing is particularly interesting given that it’s concurrency model is directly based on Erlang.
So I could learn Erlang, or try to learn distributed programming in Python. It has tons of third party options for distributed programming, but as yet I don’t know which is the best.
Thoughts? Am I an idiot?
PS: Thanks to my six readers Jeff, Thor, Karan, Eric, Rachel, and Dad for reading!
EDIT:
And Jamie (Nice blog dude! (Omegle Voyeur is hilarious))
