latest news from Merbland (Nov 30)


Wow, It’s been two weeks since my last post. I’m really sorry about that but at the same time, I really enjoyed Qcon and Thanksgiving which did not give me much time to work on a blog post.

Mr Bean vs X-mas turkey

Mr Bean vs X-mas turkey

Thanksgiving is a big thing in America, and after few years I got used to it and I even learned to enjoy this special holiday.

For non North American readers, Thanksgiving is a non-religous/family oriented celebration where people get together, eat a lot of food and usually watch an American football game. It’s followed by “black-friday” the first day of X-mas shopping celebrated by huge sales and more recently “cyber-monday”, the black firday for the web.

Anyways, I’ve been visiting family in Florida and didn’t have much time to work on side projects, including Merb :(

Qcon was also an awesome event where I met a lot of very interesting people and could measure the Merb interest in the “Enterprise” community.

Merb and the enterprise

37signals, the company known for giving Rails to the Ruby community often talked about the “Enterprise” world and the fact that they want to stay far away from it, here is a quote from 37signals blog:

This is one of the reasons we think enterprise is a dirty word. It’s also why it’s an absolute pleasure to design products for what we call the Fortune 5,000,000.

On the other hand, Merb was mainly written by people working at EngineYard, a company dealing with a lot of so call “enterprisey” companies. Because we believe we all have different needs we are willing to help you out with your own needs. That’s also the reason why, even though none of the core team members use NetBeans for their day to day coding, we decided to help NetBeans add Merb support in their next release.

Interesting enough, during the preparation of my talk, I did a simple “hello world” benchmark and got some really interesting results:

Note that Django was tested with mod_python and I was told I could get slightly better results with mod_wsgi.

It was interesting to hear Tim Bray, known for his implication with XML and ATOM, mention Merb, DataMapper and CouchDB during his keynote!

Actually, the day before, Yehuda and I had supper with Tim Bray and Nick Sieger from JRuby to discuss few topics but particaluarly how could we improve the framework and of course take advantage of JRuby.

Merb and the Brazilian community

Brazil is well known for his beautiful beaches, girls and music. It’s also known for its soccer team and its BBQ. However it’s not really known for its software developers and IT community.

Nevertheless, there was a lot of Brazilians during Qcon and especially a team from LocaWeb, the biggest Brazilian web hosting!

You might not know LocaWeb, but but you might have heard of Fabio Akita. Fabio interviewed a lot of people for his blog and I guess he was bored so he decided to interview me ;)

We also sat down for a little while and went through creating a new Merb app, I think Fabio was pretty impressed ;) He was so impressed he mentioned the possibility of a  Merb book in Portuguese!

LocaWeb also mentioned their interest in offering better Merb hosting with the possibilty to have their own stack for people who decide to host their apps there.

Here is the site of the Merb community: http://merb-br.org/

Rails 2.2

Congrats to the Rails team for releasing Rails 2.2! The new features are:

  • i18n
  • HTTP validators
  • Thread safety
  • JRuby/1.9 compatibility

I heard a lot of questions about the new Rails features and where does Merb stand. So let me take them address them one by one:

  • Internationalization. I, myself was involved with the Rails i18n project so you might be surprise to hear that Merb doesn’t have a built-in i18n solution.  Well, the fact of the matter is that Merb is modular and we don’t want to force anyone to have to use a i18n solution which will slow down your app. Instead we offer modules to do that. Of course, Merb itself offers hooks to l10n helpers and other stuff you might need. By default, Merb doesn’t offer UTF-8 string manipulation like ActiveSupport does, however, few months ago, I extracted AS’s feature and you can use the extracted gem without the rest of AS while we wait for 1.9 to save the world ;)
    Merb makes everything easy for i18n/l10n plugin developers, merb_babel and merb_global are just 2 of the Merb localization plugins, you’ll find many more and some more are coming up.
  • HTTP validators/etags. Merb already had this feature for a little while, I put a quick example in the wiki, check it out to see how to use etag and last-modified tags. Note that you can easy add other custom headers by just doing: headers["Cache-Control"] = “max-age=N”
  • Thread safety. Well, unlike Rails which added thread safety as an after thought, Merb was built with the concept of thread safety in mind. What does that mean? Well, by default, Merb requests don't go through any locks. How? simply because we do not share any data between requests. thread safety is really hard to deal with. However remember that even though your framework is thread safe, your plugins and your code also need to be thread safe. Watch Jim's talk about threads if you want to know more.

Merb bug fix releases

You might have noticed that Merb is at 1.0.3. We fixed few tiny bugs as well as bumped the generated app dependency to the latest version of DM. (DataMapper's do_sqlite3 had a conflict with ruby-sqlite3 because of the windows dll pacakged with the gem. Everything has been fixed since.)

Yehuda Katz, explained the release plan in an email to the mailing list:

We plan to release point-releases to 1.0 as fixes become available, so there may be more such releases than in Rails. The goal is to release often enough to keep the list of changes in each release relatively small and understandable, and you can feel free to upgrade to the latest point release every 2 weeks if you don't want to go through the upgrade process every week (or more frequently). Keep an eye out for point releases that reflect security fixes, because those upgrades should be considered mandatory.

To see 1.0.4 and 1.1 tickets, check LightHouse. We are planning on a 1.0.4 release for next week.

Better documentation

Merb's documentation is getting better and better, here is a selection of few blog posts I think you might want to read. (hopefully all the info are or will be available in the wiki)


Similar Posts

, ,

  1. #1 by Scott Motte - December 1st, 2008 at 00:03

    cool. thanks Matt. this is exciting for me. first time I’ve ever been linked to.

  2. #2 by Pratik - December 1st, 2008 at 01:32

    “Merb doesn’t use any locks when running with the mutex off”

    You have no idea what you’re saying, do you ;-) ?

    merb-core/lib/merb-core/dispatch/router.rb: # Compilation is synchronized by mutex.
    merb-core/lib/merb-core/dispatch/router.rb: @compiler_mutex = Mutex.new
    merb-core/lib/merb-core/dispatch/router.rb: @compiler_mutex.synchronize do
    merb-core/lib/merb-core/dispatch/session/memory.rb: @mutex = Mutex.new
    merb-core/lib/merb-core/dispatch/session/memory.rb: @mutex.synchronize {
    merb-core/lib/merb-core/dispatch/session/memory.rb: @mutex.synchronize {
    merb-core/lib/merb-core/dispatch/session/memory.rb: @mutex.synchronize {
    merb-core/lib/merb-core/logger.rb: @@mutex = {}
    merb-core/lib/merb-core/logger.rb: @mutex = (@@mutex[@log] ||= Mutex.new)
    merb-core/lib/merb-core/logger.rb: @mutex.synchronize do

  3. #3 by Matt Aimonetti - December 1st, 2008 at 09:06

    @pratik As a matter of fact, I know what I’m talking about, at least this time ;)
    I’m glad you are reading our source code, but maybe you should have checked how it’s being used.

    However, I did edit the sentence you highlighted for what I meant was not really clear:

    “by default, Merb requests don’t go through any locks”

    Let me explain that, the mutex you found in the router is only used once when the routes get prepared/compiled, meaning that requests don’t go through them.

    The second mutex in on the memory session which is not Merb’s default session store.

    Finally, the last mutex is the only mutex you might have to deal with in your app: the logger. However, by default we are only logging errors in production, meaning that the mutex is only used in case of problems. Normal requests don’t get logged and therefore we don’t synchronize the mutex on every single request.

    With all due respect, I have to say I was a bit surprised to see what I consider being an insult from a Rails core member. As a frequent reader of your blog though, I guess I should not take offense ;)

  4. #4 by Yehuda Katz - December 1st, 2008 at 10:05

    @pratik come on man :(

    Can we please, please keep the level of discourse relatively civil, especially on matters on fact?

    As Matt said, the mutexes used by Merb are used at bootup and once when things are logged (which doesn’t happen per request).

    We’re not diametrically opposed to the idea of mutexing other things. In fact, I would expect us to add a few mutexes to our codebase over time for caches in which a clear performance benefit could be demonstrated (i.e. the savings of the cache exceeds the cost of the mutex over many threads).

    The difference I believe Matt was trying to point out was just that Merb was designed to be threadsafe from the beginning, which reduces our need for mutexes as well as increases the likelihood that we haven’t missed something important.

    As a side note, I’m curious how you were able to make the Rails dependency code threadsafe.

    Again, take it easy :-D We’re all on the same (Ruby) side.

  1. No trackbacks yet.

Comments are closed.