Friday, September 7, 2012

Is NHibernate dead?

Before discussing the question from the title, let me answer another one: Is this blog dead? Definitely no. Summer time distracted me a bit, but I'm hoping to get back to writing now :)

So it's more than half a year since I've concluded my series about NHibernate's mapping-by-code. The series is still surprisingly popular, there are quite a lot of hits from Google every day. I've also just reached 50 upvotes at Stack Overflow in a question about where to find some docs and examples for mapping-by-code. Thanks for this!

Quick googling for "mapping by code" and skimming through NHForge website convinced me that still there is nothing better available in the topic. Moreover, none of the bugs I've encountered half a year ago made any progress - all issues left unresolved and unassigned back then are in the same state right now. These facts are a bit sad, as I saw the mapping-by-code feature as quite revolutionary and shaping the future of NHibernate.

Well, and here comes the question - maybe there is no future? Maybe everything what is needed in the subject of object-relational mapping is already there and no development is needed? Ohloh stats notice some development in NHibernate project, but the pace is rather slowing down. No new releases are planned according to the roadmap on issue tracker. There are 25 issues classified as "Critical" unresolved, oldest waiting for more than 20 months by now. The development in a third-party ecosystem has already stopped - see the Ohloh graphs for NHibernate.Contrib or Fluent NHibernate, to name the most significant ones.

In my opinion, the reason for NHibernate's agony is simple. It was already discovered many times that applications nowadays are mostly web-based, read-intensive, not so data-centric and not consisting complicated data manipulation as few years ago. With the advent of mature NoSQL engines - free, easy to use and full of neat features - like RavenDB and - on the other side - with lightweight ORM-like tools like Dapper or Simple.Data, that cover at least 95% of ORM features needed to effectively handle newly-designed relational databases, we just don't need to use such a big and heavy tool like NHibernate.

Legacy databases are still a niche for NHibernate, for sure, but how many legacy databases that are not OR-mapped yet we still have out there? And for fresh developments, I'd say that unless you're designing some kind of specific data-driven application, it is more effective (both in terms of development effort and performance) to stick with either NoSQL or some lightweight ORM instead of NHibernate.

NHibernate is a great tool, but time goes by pretty quickly. The context of our work changes from year to year and even good tools some day must be superseded by better ones, that are more suitable for nowadays needs. And I think that day for heavy, multi-purpose ORM's like NHibernate has just come.

32 comments:

  1. While certainly not dead, it's clear that interest has declined, both in users and core developers.
    Apart from the indirect competition that you mentioned, there's direct competition from Entity Framework which, although much less powerful, has an easier learning curve for less sophisticated developers.
    It's still too soon to say the ORM days are over, but it's clear that many scenarios favor other types of tools.

    ReplyDelete
    Replies
    1. ORM days are not over (micro-ORMs are still ORMs), but in my opinion the mainstream development will avoid heavy ORMs like NHibernate or EF more and more for new projects. Of course, before declaring NHibernate really dead, all the projects we're working on right now must become legacy first, so it's still few years to go.

      Delete
  2. In my humble opinion, the main reason why intensiveness of nhibernate development has been decreased, is that Fabio left the team.

    ReplyDelete
    Replies
    1. He must have found something more interesting than nhibernate development, I guess.

      Delete
  3. I would still like to know Fabio Maulo's or Ayende's academic background...
    I wonder if these guys went actually to college....

    ReplyDelete
    Replies
    1. Fabio Maulo has no college degree in computer science.
      Neither Ayende....

      Delete
  4. hahaha none of this guys finished college......
    this is something to keep in mind for projects still choosing nhibernate.

    ReplyDelete
    Replies
    1. How obnoxious. I'd say: "this is something to keep in mind if you think degrees imply skills or vice versa".

      Many of the best programmers around do not have a diploma and are self-taught. (PS: I've got several diplomas / degrees, so I'm not trying to justify or embellish my own situation.)

      Delete
  5. So you need to finish college to be a competent programmer? Will someone please tell John Carmack next time they see him?

    ReplyDelete
  6. Yes, you need to have college education to make systems programming in medical institutions, risk insurance companies, etc.
    John Carmack is a fantastic games programmer, but it's not the case.

    I work as Program Manager for a well known telco company, and we only hire people that has prooven skills, and strong math/academia thinking. We don't rely our systems to nHibernate or the latest week fad, it's just too risky for us.

    ReplyDelete
    Replies
    1. By limiting yourself to a smaller set of people who share your life experience you are limiting your own innovation.

      Delete
    2. Apparently grammar was not one of your major or minor areas of study. Of course, this comes from an engineer without a degree. Go figure. That way of thinking is old and tired in this field. I've met enough programmers with and without degrees to know (decisively) that having one does not guarantee (nor does it prevent) success or critical thinking skills. Not everyone can afford a 4-year CS degree, and some of us that are good at math can logically conclude that student loans aren't always the right choice for each individual's situation.

      Delete
    3. I would like to add that the father of C#, Anders Hejlsberg, also never graduated from college.

      Delete
    4. Most really good programmers tend not to have a college degree in computer science they tend to be really bright people who are extremely dedicated to whatever they do. I'd take a self taught guru over a senior dev with a college degree most of the time because the guy with the college degree is usually doesn't look past his/her teaching, the self starter usually keeps up to date because they love it.

      Delete
  7. What a ridiculous post. 99% of enterprises still use Relational DB's. And coming back to RavenDb stating it is 95% effective, No it is not. It cannot even cancel the queries, because according to Ayende, the queries runs short!!
    I personally see no reason to use NoSQL, distributed data environment is possible with most relational databases. E.g Oracle RAC, SQL Server distributed views etc. Finally even Google now switched back to a specialized Relational Database recently

    ReplyDelete
    Replies
    1. Well, have I stated that relational databases are dead? I'm also using RDBMS everyday and I don't expect it'll change soon. I just don't think starting a new project with NHibernate is a good idea nowadays (NHibernate, not RDBMS...)

      Delete
  8. Relational database may be dead for applications that require an high scalability, like a web api, where it may receive multiple parallel calls, so a normal RDBMS would not be able to satisfy the high demand.
    But as soon as you will move into an enterprise architecture (and trust me, there are tons out there ...) you need to satisfy a different requirement, the flexibility. You need to run report, cubes, statistics, you need to take care of performances, maintenance, backups. At the moment only a real RDBMS like SQL, Oracle ... you name it, can provide this type of flexibility.
    Said that, I am not going to blown my own trumpet, but I can say that I have plenty of experience with old datalayers, datasets, nhibernate, entity framework and more. So far, and today is 27th March 2013, I still cannot find an ORM like NHibernate, with the same flexibility and stability. It really represents what Fowler discuss in his book PoEAA. And I am quite confident it is not dead yet.
    Apologize for my English, I am Italian.

    ReplyDelete
    Replies
    1. Peter, you can't speak Italian just because you have a mustache!

      Delete
    2. "today is 27th March 2013, I still cannot find an ORM like NHibernate, with the same flexibility and stability".

      Raffaeu, now is 2015, I would invite you for a try on Easylink and see if we have some innovation in ORM.

      Delete
  9. If only Microsoft thought about devoting some of their Development time to improving NHibernate (Documentation, tutorials, fixing up the Linq provider, tighter integration into Visual Studio, visual designer, internationalization), basically fix all the quibbles people have. Rather they went and duplicated effort, pissed a lot of people off in the process and still haven't produced feature parity with NHibernate. Oh what a waste... Not invented here syndrome hindsight...

    ReplyDelete
  10. Simply put, the ORMs tried to solve relational problems with objects. What a wrong idea!

    If you are serious about your development, use SQL to access data and forget about ORM. Period!

    ReplyDelete
    Replies
    1. erm no anon.. I bet you're a dba *baits and awaits the flames.*

      Delete
  11. Interesting post. I'm a bit concerned about the rising amount of issues in jira ...

    I don't think that relational databases will be replaced by no-sql solutions. No-sql has problems with both performance and data migration. To me it sounds a bit like one of these hypes, where everybody says that same that it is "state of the art" and "how things are done today" and that everything else will die - but only a few are successfully using it - until people understand when to use it and when to use something else.

    ReplyDelete
    Replies
    1. Of course you're right, NoSQL is not a silver bullet solution for everything, but you can't say it doesn't fulfill the needs of a large portion of web-based projects better rhan relational databases. At least now we have a choice and that choice takes some market share from ORM world.

      Delete
  12. By 2014, nHibernate is effectively dead.

    ReplyDelete
  13. An article with another opinion: http://enterprisecraftsmanship.com/2014/11/29/entity-framework-6-7-vs-nhibernate-4-ddd-perspective/

    ReplyDelete
  14. You should really update at least the issues you had in nhibernate-core. Most of them are now implemented in 4.0 and 4.1

    ReplyDelete
  15. At out company we have an entire project devoted to removing nHibernate from our core applications.
    Sounds nice uh? We have 5 programmers dedicated to this solely task.
    Btw, we're moving to Entity Framework....

    ReplyDelete

Note: Only a member of this blog may post a comment.