143 points · by paulsmith · 17y ago · 79 comments
During dev, I had a server live for users to play with. The data structures were in flux, there was zero traditional data input protection. My users were domain experts, no tech background and would type in all sorts of odd inputs as there was no training or documentation on how to use the webapp. But I never once had data corruption issues and never once did the server crash. I was able to run this "test" server with no admin or headaches while I was doing dev.
The reasons are due to a few characteristics of erlang:
1 - you write concrete pattern matching, not abstract object containers. So a controller or model function would spec out a clear data structure that was expected as input. Anything else failed right at the point where the data didn't fit the patterns and guards.
2 - each request is handled by an isolated erlang process that fails gracefully and doesn't effect the rest of the system. So my early testers would get error dumps from the server for bad data inputs but they never corrupted the data or crashed things. I was able to take these error messages from test users to see how they were using the system incorrectly.
3 - Single assignment and functional programming were a big win in terms of writing once, testing once (not writing separate test code), and knowing that that piece of code was solid and I could move on.
The app was very responsive. All requests were ajax and this system felt like the server was running on the same box as the web browser. When we had errors, the erlang error message almost always showed the crash at exactly the point in the code that needed attention.
These characteristics speak to the power of the dev process, not scalability which is what you normally hear about erlang.
===================
string, regex handlers, faster file I/O:
- "re" module replaces "regex"
- faster iteration over large binaries, R13A
- avoid io:get_line using raw access
-----------------------------
metaprogramming/"DSL"
- deep exploring parse_transform
----------------------
frameworks, database, middleware
- couchdb, nitrogen, mochiweb, erlyweb,and now the boss!
- thrift, ejabberd, rabbitMQ,
----------------------------
debug, trace, static code analysis; verify program behavior
- dialyzer, tidier (Sagonas and Avgerinos)
- mcErlang model checker
- quick check application vs. specification
-------------------------
data structures
- destructive / mutable byte arrays (HiPE BIF)
- shared immutable data structure
----------------------
tail recursion
- Ericsson expanding as fast as they can (e.g. "andalso",
-------------
SMP, run queues,
----------
build systems, distribute your app
- rake - faxien, sinan (erlware)
==============
Yah, this could be a long post, take a while to draft too.
Dunno the state of scala, clojure and haskell /GHC docs these days, but to explore the dark corners of erlang dev, you ahve to do a lot of mailing list and google digging.
(and read Cesarini/Thompson book, which is equal to best software books ever, modulo fair number of typo's)
nothing there yet, I've only been erlanging for a month or 2. But: i have been workiing on a better documentation database, you can email for details if interested:
base: genetanigmailcom; insert periods, after positions 4 and 13 and "at" you know where..gene
I can tell you that although merb is a nice framework, I still end up digging through code at times to find bugs that would be much easier to spot if it were in erlang.
Sorry for all the questions, I just think it's an interesting insight to what happens if you pick a language / framework that isn't terribly mainstream.
Also, Ruby is way less verbose than Erlang. A lot of pattern matching code seems to fail the "don't repeat yourself" in some ways - you write a lot of the same things, and just one changes.
http://news.ycombinator.com/user?id=RKlophaus
I met the guy in D.C. and he lives and breathes Erlang.
Thanks!
It does make some big claims, but I've been looking for a reason to mess with Erlang for a while and this seems pretty neat.
I think I'll wait awhile on this one...
*Note: for this to work, you will need a large sandbox. If it is too small, your car will be fine, but just try explaining what happened to the sandbox to your kid.
What makes you so sure that I'm wrong about the latter?
My other open window is running emacs; it's where I've been writing Python code for App Engine for the past few weeks. If that doesn't qualify me as a developer, please describe the requirements, as I've been writing code since the late 70s.
>>>All other web frameworks will break down and cry if you ask them to process more than a few dozen simultaneous requests on a single machine.<<<<
Isn't this what facebook Tornado, Orbited and all the other servers using select()/epoll() solves?
I also find it somewhat funny that it includes an ActiveRecord port - an object-relational mapper in a functional language to talk to a non-relational backend (tokyo tyrant).
Chicago Boss is fully asynchronous, using one single process to handle hundreds or thousands of simultaneous requests, and thus it solves the classic c10k problem. All other web frameworks will break down and cry if you ask them to process more than a few dozen simultaneous requests on a single machine. Chicago Boss is built with Erlang, the same platform used by banks and telecoms to achieve unprecendented scalability and (no exaggeration) 99.9999999% reliability.
Oh my
A typical single Ericsson AXD 301 switch had a target of 5 nines of reliability without network redundancy, which is 5mins/year, including planned outages. see http://www.erlang.se/publications/Ulf_Wiger.pdf
One of the advantages of these switches was that they could manage 95% throughput at 150% load (Throughput then drops linearly to 40% at 1000% sustained load), which is also extremely useful, although not mentioned often.
Of course, this is the problem you get once you've solved the hard problems already, which is how to get that many visitors in the first place. At this point you have the money to buy a bunch of servers, typically, so this is aimed at people who are really great at getting incredible numbers of hits, but really poor at monetizing them.
Premature optimization is the root of all evil and all that, but going at the other extreme is equally not the smartest thing you can do.
An application like 37signals Basecamp can grow organically over time as the application is maturing and more and more users discover it and start paying for it. But if your project's success depends on the number of users you have (e.g. a social app), it makes sense to think about scaling and reliability a little beforehand.
Remember Twitter? It's still a mystery to me how this app survived having so many outages. Maybe they where lucky, maybe the social aspects where worth it for its users, but that doesn't mean your application will survive if facing such problems.
Looks interesting, though.
All other web frameworks will break down and cry if you ask them to process more than a few dozen simultaneous requests on a single machine.
If you believe every other web framework will get crushed with a few dozen simultaneous requests, you will be absolutely sure this is the solution you have been waiting for.
I am curious to try Erlang out, but I know exactly how many dozen requests my current tools can handle. And it's a lot more than a couple.
By writing something in Erlang does not make your program automagically perform well (and this applies to CouchDB too).
Ignorance and/or disenguity(sp?) pisses me off. I'll read more but I'm getting the impression that people behind BOSS are one or more of inexperienced, clueless, full of them selves and thus not worth my time.
[edit]: Hey down-modder: It's the last entry on his website. What's the -1 for? Are you saying those of us from Chicago shouldn't be proud of our institutions? Asshat.
Although, I just downmodded you because it seems like you've got a tough time being civil.