Improve README formatting
[memstore.git] / README.md
1 Memstore
2 ========
3
4 _A high-level interface for the memcached and membase servers_
5
6 Written by Kevin M. Rosenberg <kevin@rosenberg.net>
7
8 Downloads
9 ---------
10
11 * The web site for memstore is [http://memstore.b9.com/](http://memstore.b9.com/)
12 * A git repository is available at [http://gitpub.b9.com/memstore.git](http://gitpub.b9.com/memstore.git)
13 * Releases are available for download at [http://files.b9.com/memstore/](http://files.b9.com/memstore/)
14
15 Prerequisites
16 -------------
17
18 This library incorporates a heavily modified version of `cl-memcached`
19 version 0.4.1. The primary need for the modification is to support the
20 `flags` field supported by the memcached server. The flag field is
21 used to store information required to deserialize the object data from
22 memcached. In addition to adding the `flags` field, the library has
23 been heavily refactored.
24
25 This library also requires Common Lisp libraries of `cl-store`,
26 `flexi-streams`, and `zlib`.
27
28 Overview
29 --------
30
31 Memstore allows efficient storing of simple objects as well as
32 easy storing of complex objects and optional compression.
33
34 When storing an object, if the object is a string then that is
35 directly written to the memcached server. For non-strings, an attempt
36 to made to write the object to a string with `*print-readably*` bound
37 to `t`. If that succeeds, then the string is converted to a vector of
38 octets. If that fails, the `cl-store` is used to serialize that object
39 to a vector of octets.
40
41 Next, optional compression is applied to the octets. First, the
42 `*compression-enabled*` flag is checked to see if compression is
43 enabled. Next, the length of the objects is compared to
44 `*compression-threshold*`. Only objects larger than
45 `*compression-threshold*` will be compressed. For objects that qualify
46 for compression, the size of the compressed object is compared to the
47 length of the uncompressed object to decide if the object is shrunk
48 enough to make the compression worthwhile.
49
50 The `flags` parameter to cl-memcached stores whether cl-store or
51 write-to-string is used to serialize the object and whether
52 compression is applied. `mem-restore` uses those flags to determine
53 how to reconstruct the object.