From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B952EBB81 for ; Tue, 27 Dec 2005 11:17:15 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jBRAHFvh002113 for ; Tue, 27 Dec 2005 11:17:15 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA23072 for ; Tue, 27 Dec 2005 11:17:14 +0100 (MET) Received: from smtp1-g19.free.fr (smtp1-g19.free.fr [212.27.42.27]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jBRAHE8Y002106 for ; Tue, 27 Dec 2005 11:17:14 +0100 Received: from [192.168.1.2] (che78-2-82-237-71-191.fbx.proxad.net [82.237.71.191]) by smtp1-g19.free.fr (Postfix) with ESMTP id 50CA56E5FE; Tue, 27 Dec 2005 11:17:14 +0100 (CET) Message-ID: <43B114A9.3080301@inria.fr> Date: Tue, 27 Dec 2005 11:17:13 +0100 From: Xavier Leroy User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: David MENTRE Cc: caml-list@inria.fr Subject: Re: [Caml-list] Persistent storage and stability of Marshal? References: <87wthruedp.fsf@linux-france.org> In-Reply-To: <87wthruedp.fsf@linux-france.org> X-Enigmail-Version: 0.91.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43B114AB.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43B114AA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 marshaled:01 marshaled:01 hash:01 marshaling:01 full-fledged:01 pairs:01 asn:01 encodings:01 unix:01 marshal:01 marshal:01 encode:01 incompatible:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 > 1. Is the Marshal module that much unstable? I have the feeling that > marhsaled values are compatible between OCaml releases. True or > false? True in practice: the last incompatible change was done in 1996... Still, the Marshal module is not intended for long-term storage of data that you cannot easily reconstruct from other sources. In particular, the data format is compressed enough that it is not possible to salvage data using, say, a text editor. At the very least, it is prudent to build into your software functions to dump and restore marshaled data to/from a simpler, textual format. (That's what I did for SpamOracle's database, which is a marshaled hash table.) > 2. Any advice on implementing persistent storage? I know about Persil > library[3] but I don't see much advantage of using it (does it > implement its own marshaling, more stable than Marshal?). There are two independent questions: 1- How to encode your data into character strings? 2- How to store these strings in persistent storage? For 2-, you have many options, ranging from flat files (the traditional Unix way) to full-fledged databases. For 1-, in addition to the Marshal module, you can also use textual formats: key-value pairs, XML, Lisp S-expressions, etc. Other options are XDR or ASN1 encodings. - Xavier Leroy