Updates for release 1.1
[memstore.git] / doc / memstore.html
1 <h1>Memstore</h1>
2
3 <p><em>A high-level interface for the memcached and membase servers</em></p>
4
5 <p>Written by Kevin M. Rosenberg <a href="&#x6D;&#97;&#x69;&#108;&#x74;&#111;:&#x6B;&#x65;&#118;&#x69;&#x6E;&#64;&#114;&#x6F;&#115;&#x65;&#110;&#x62;e&#x72;&#103;&#x2E;&#110;&#101;&#116;">&#x6B;&#x65;&#118;&#x69;&#x6E;&#64;&#114;&#x6F;&#115;&#x65;&#110;&#x62;e&#x72;&#103;&#x2E;&#110;&#101;&#116;</a></p>
6
7 <h2>Downloads</h2>
8
9 <ul>
10 <li>The web site for memstore is <a href="http://memstore.b9.com/">http://memstore.b9.com/</a></li>
11 <li>A git repository is available at <a href="http://gitpub.b9.com/memstore.git">http://gitpub.b9.com/memstore.git</a></li>
12 <li>Releases are available for download at <a href="http://files.b9.com/memstore/">http://files.b9.com/memstore/</a></li>
13 </ul>
14
15 <h2>Prerequisites</h2>
16
17 <p>This library incorporates a heavily modified version of <code>cl-memcached</code>
18 version 0.4.1. The primary need for the modification is to support the
19 <code>flags</code> field supported by the memcached server. The flag field is
20 used to store information required to deserialize the object data from
21 memcached. In addition to adding the <code>flags</code> field, the library has
22 been heavily refactored. For more information on the changes in
23 memcache, see <a href="memcache.html">memcache</a>.</p>
24
25 <p>This library also requires Common Lisp libraries of 
26 <a href="http://gitpub.b9.com/kmrcl.git">kmrcl</a>,
27 <a href="http://common-lisp.net/project/cl-store/">cl-store</a>,
28 <a href="http://weitz.de/flexi-streams/">flexi-streams</a>,
29 and <a href="http://common-lisp.net/project/zlib/">zlib</a>.</p>
30
31 <h2>Overview</h2>
32
33 <p>Memstore allows efficient storing of simple objects as well as
34 easy storing of complex objects and optional compression.</p>
35
36 <p>When storing an object, if the object is a string then that is
37 directly written to the memcached server. For non-strings, an attempt
38 to made to write the object to a string with <code>*print-readably*</code> bound
39 to <code>t</code>. If that succeeds, then the string is converted to a vector of
40 octets. If that fails, the <code>cl-store</code> is used to serialize that object
41 to a vector of octets.</p>
42
43 <p>Next, optional compression is applied to the octets. First, the
44 <code>*compression-enabled*</code> flag is checked to see if compression is
45 enabled. Next, the length of the objects is compared to
46 <code>*compression-threshold*</code>. Only objects larger than
47 <code>*compression-threshold*</code> will be compressed. For objects that qualify
48 for compression, the size of the compressed object is compared to the
49 length of the uncompressed object to decide if the object is shrunk
50 enough to make the compression worthwhile.</p>
51
52 <p>The <code>flags</code> parameter to cl-memcached stores whether cl-store or
53 write-to-string is used to serialize the object and whether
54 compression is applied. <code>mem-restore</code> uses those flags to determine
55 how to reconstruct the object.</p>