a little madness

A man needs a little madness, or else he never dares cut the rope and be free -Nikos Kazantzakis

Zutubi

Phrases You Should Never See in an FAQ

Today’s phrase of choice is “you don’t need”, with the word of the day being “never”. Consider this entry in the Hibernate FAQ:

The hibernate.hbm2ddl.auto=update setting doesn’t create indexes

SchemaUpdate is activated by this configuration setting. SchemaUpdate is not really very powerful and comes without any warranties. For example, it does not create any indexes automatically. Furthermore, SchemaUpdate is only useful in development, per definition (a production schema is never updated automatically). You don’t need indexes in development.

What’s the problem with this? The FAQ answer is saying (in a round about way) that you should not ask this question, as you don’t need an answer. Telling your users what they need is a good way to alienate them. If this question is common enough to warrant an entry in the FAQ in the first place, aren’t your users telling you that they do need this functionality? This doesn’t mean you have to jump to implement it – just don’t patronise your users by telling them you understand their needs better than they do.

Personally, I was looking at this entry because we use Hibernate for persistence in Pulse. In Pulse, there is a built-in upgrade framework that updates the schema automatically for you when you install a new version. So much for the assertion above that “a production schema is never updated automatically”. While recently adding an upgrade that required new indices, I also certainly did “need indexes in development” because I want my development environment to match production as closely as possible (not to mention the fact that they saved hours in testing time against large data sets).

The most interesting underlying thing is that the existence of this (and similar) FAQs seems to be indicating to the Hibernate team that the simple SchemaUpdate code could actually be the beginnings of an extremely useful tool. Too few applications have decent upgrade capabilities: our users are often pleasantly surprised by what we have been able to build with considerable help from SchemaUpdate to simplify their upgrades. Maybe the Hibernate team are underestimating the potential of their own tool?

Liked this post? Share it!

3 Responses to “Phrases You Should Never See in an FAQ”

  1. December 5th, 2007 at 6:54 am

    Craig S says:

    I have to disagree with you. The SchemaUpdate functionality was designed to get people up and running developing their “business logic” quickly… not to be used as a replacement for a DBA, which is what most people use it for. The Hibernate team tends to get nailed for anything that goes wrong after someone tries to use their product…. e.g. using SchemaUpdate as a crutch.

    In your case of needing an index… that has nothing to do with the persistence layer… the layer cannot utilize that information for anything as a query cannot be pre-planned by a client. The index was a performance improvement in the database layer only and was thought out by you in a DBA role.

    I’m sure that your schema update functionality takes the old schema into account where a framework like Hibernate cannot as it only knows about the current schema.

  2. December 5th, 2007 at 10:56 am

    Jason says:

    Hi Craig,

    Disagreement is fine by me :). However, I think you really missed my point. I am not having a go at the Hibernate team for the current state of SchemaUpdate. I understand I am using it in ways that were not intended, and have to expect some problems. I even say in the post that I don’t expect them to jump to implement this feature. My problem is that they should not be telling me and other users we don’t need to do things which we certainly do need to do (like automatically update a production schema).

    I also do not understand your point in your discussion about the persistence and database layer. Hibernate allows me to add index information to my mapping files, in which case the indices are created when using Hibernate to generate a fresh schema (using SchemaExport). Maybe there another purity argument against this but the fact is that it works well, reduces duplication of information in our app and allows us more easily to support multiple databases. It is just a shame that even though the information is there and understood by SchemaExport that SchemaUpdate doesn’t also use it.

  3. December 6th, 2007 at 2:48 am

    Craig S says:

    I think my objection was from the purist in me that dislikes unattended automatic database updates, which is what many people use SchemaUpdate for. I think the fact that I skipped the point you made about the FAQ answer is that I can see where it is coming from and partly agree. When you really break it down Hibernate is among the strongest of ORMs. In that position the developers have certain methods, mindsets and theories along with experience that they must share/communicate. Having seen far too many projects with a crippled/broken database and persistence tiers I feel guidance is paramount. Perhaps the phrasing could be a little better but the information must flow.

Leave a Reply