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.4 required=5.0 tests=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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 008D0BBCA for ; Thu, 28 Feb 2008 19:41:59 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPqOxkfOvjGxoWdsb2JhbACQcQEBAQEBAQUEBgkIARedCw X-IronPort-AV: E=Sophos;i="4.25,421,1199660400"; d="scan'208";a="23175781" Received: from web54607.mail.re2.yahoo.com ([206.190.49.177]) by mail4-smtp-sop.national.inria.fr with SMTP; 28 Feb 2008 19:41:59 +0100 Received: (qmail 36042 invoked by uid 60001); 28 Feb 2008 18:41:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=zayBHQydlofuTH0QEhPXUQcZDEA6RiRWQROUgh0cC0xNN3ObD0HvsemSx7ZHw2iMginTeTh3szO0gtjBQtFUVnh3qA5rdV+854yDocKlBUHuZ53OcVz2WA3Vz9H3qSAhKlGyB470UuhcoynC28KwXAR0yVJ27jU7JKnv5ozV8Ss=; X-YMail-OSG: jtwIO1IVM1melesIfyyydHVo3xpOfDxY2Z_U5rmksFCS.WpvkezMYDvuAwDoqrOdg4RMj1q7rfXjKW6BLxl_p3JQpP6xAtbOzBEEi3dbZ2nwMF2j21f8gc.16289Gumttonc3_ymszEC9BCplM4R8Zhk5w-- Received: from [77.54.75.157] by web54607.mail.re2.yahoo.com via HTTP; Thu, 28 Feb 2008 18:41:57 GMT Date: Thu, 28 Feb 2008 18:41:57 +0000 (GMT) From: Dario Teixeira Subject: Long-term storage of values To: caml-list@yquem.inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <191751.36007.qm@web54607.mail.re2.yahoo.com> X-Spam: no; 0.00; ocaml:01 marshalling:01 ocaml:01 cheers:01 variant:02 data:02 data:02 slightly:03 renamed:04 converted:04 marshalled:04 marshalled:04 complex:05 problem:05 problem:05 Hi, Suppose I have a value of type Story.t, fairly complex in its definition. I wish to store this value in a DB (like Postgresql) for posterity. At the moment, I am storing in the DB the marshalled representation of the data; whenever I need to use it again in the Ocaml programme I simply fetch it from the DB and unmarshal it. This works fine; there is however one nagging problem: the marshalled representation is brittle. If Story.t changes even slightly, I will no longer be able to retrieve values marshalled with the old version. Note that changes to Story.t are likely to be small and will not invalidate backwards compatibility (e.g., here or there another variant might be added, but not removed or renamed). I am therefore looking for an alternative to marshalling that a) does not suffer from the brittleness problem, and b) is fast. At the moment, the best thing that occurs to me is to convert the data into XML and to store it as such in the DB (the data is easily converted into XML). This strikes me as problem bound to be common. How do you guys typically solve this sort of situation? In addition, if the XML route is indeed the best one, what Ocaml tools would you recommend? (Again, this is for an application where speed is of the essence). Thanks in advance for your input! Cheers, Dario Teixeira __________________________________________________________ Sent from Yahoo! Mail. A Smarter Inbox. http://uk.docs.yahoo.com/nowyoucan.html