From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_WHOIS autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 35B5CBBCA for ; Sat, 1 Mar 2008 15:15:32 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADr0yEfOvjGtoWdsb2JhbACQcAEBAQEBAQUCCAkIAReBDZdn X-IronPort-AV: E=Sophos;i="4.25,431,1199660400"; d="scan'208";a="9779087" Received: from web54603.mail.re2.yahoo.com ([206.190.49.173]) by mail3-smtp-sop.national.inria.fr with SMTP; 01 Mar 2008 15:15:31 +0100 Received: (qmail 84137 invoked by uid 60001); 1 Mar 2008 14:15:30 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=AmkkoziCYR9VglGu0pTzHEr3Oapbe98oyt1gqROFKwyBvL5NKuv4/aBpa5OhQgNUD1DvKE7BidrDlyMOvteiFsrt43k6d+PrDwn+MLT3MDACaFAbBfT7kOWsznIHKZoGCuBWH8HG4/ApYpQEWQmZHQhw53a22lHm8piwb4j5yq8=; X-YMail-OSG: AvBwPn0VM1nAyI_zU62piSAw6AIJokIpNdaDxm6Ck3G.WvbqDwHAOBlOR0rit87zHyNS6kstOx7L8.D3G_nrxO_vBerVJGhAH0E20zm8ayMdf7_2a3IVz1Q.d26LLQ-- Received: from [85.240.88.66] by web54603.mail.re2.yahoo.com via HTTP; Sat, 01 Mar 2008 14:15:30 GMT Date: Sat, 1 Mar 2008 14:15:30 +0000 (GMT) From: Dario Teixeira Subject: Re: [Caml-list] Long-term storage of values To: Brian Hurt Cc: caml-list@yquem.inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <756703.83624.qm@web54603.mail.re2.yahoo.com> X-Spam: no; 0.00; recursive:01 ocaml:01 ocaml:01 ocaml's:01 translated:01 wire:98 abstract:01 dynamically:01 exception:01 caml-list:01 portions:01 data:02 data:02 structures:02 structures:02 Hi, > You're making two mistakes. > > Mistake #1: treating a database as a dumb object store. This is a really > popular idea right now- Hibernate does this, as does Ruby on Rails, and a > number of other ORM packages take this effective approach. On the other > hand, dynamically typed languages are also really popular. Thanks for your reply. It was quite interesting, though I get the feeling you used my question solely as a trigger to share with us a long-held dissatisfaction with the current state of affairs concerning the use of databases, regardless of whether it actually applies to my particular problem. That's fair, and I do agree with practically all your points. However, if I were you I would refrain from starting such missives with statements as blunt and uncompromising as "You're making two mistakes". As it turns out, this is one of those cases where the data (tree-like, with recursive structures) does not map well at all with a relational database. Moreover, I am far from treating the database as a dumb object storage. In fact, a significant portion of the code for this particular application (a web app using Ocsigen; you can download a preliminary version of the app from http://dario.dse.nl/projects/lambdium-light/) lies on the Postgresql side, with the Ocaml code serving as little more than delivery boy. The exception is of course those portions where it is far more natural and performant to let the Ocaml code take the reins and treat the DB as dumb storage. The complex data structure holding the markup of stories/comments is one such example. > So, mistake number one: either use the data, and structure your data (at > that layer) to take advantage of it, or don't use a database. Unfortunately, this is an overly general statement. I have no doubt that if I were to present you the data I have, your reply would be "in this case, just use the DB as dumb storage". > Mistake number two: file formats (and this includes marshalled data > structures), are wire protocols, and need to be designed to be as abstract > as possible- to reveal as little about the internal structure of the > program as possible (preferrably none at all). On the other hand, one of the advantages of using a language with such a rich type-system as Ocaml's, is that the application-independent description of the data can be translated on practically a 1:1 basis to native language constructs! Trust me, I didn't need to bend the data definition to suit the internal structure of the programme. Kind regards, Dario Teixeira ___________________________________________________________ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/