My company uses EventMachine-based servers a lot. This, I think, is a huge mistake.
The advantages of Ruby (as distinct from Rails) are basically threefold:
- It’s a very humane language to program in, allowing programmers to produce large amounts of high-quality, tested code quickly.
- It has a great community around it that produces lots of high-quality open-source gems for lots of the tasks you might need done.
- It’s currently enough of a hot language that you can get a bunch of talented developers who are interested in doing Ruby programming and are facile with the language.
And EventMachine compromises all of those things.
- EventMachine is callback-based. That immediately makes the code tougher to write, understand, and maintain. And developers just don’t like callbacks.
- EventMachine is incompatible with damn near every gem I’ve ever wanted to use. Anything that involves an external service is going to, by default, be incompatible with EventMachine.
- The vast majority of all developers out there who have Ruby experience and facility are used to dealing with Rails: they find EventMachine a stumbling block, and to remove some of the things they enjoy about Ruby development.
In exchange for all of this, you get better performance.
Well, you know what else is kind of a pain in the ass to work with compared to Ruby, but far better performance and natively asynchronous? Node.js. Or Erlang, or Go, or a million other languages. If you’re going to have to deal with EventMachine, you might as well use a truly performant language, and one in which the entire community is based around dealing with the unique challenges of asynchronous code.
EventMachine is the worst of all worlds.