Update dependencies
[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.kpe.io/](http://memstore.kpe.io/)
12 * A git repository is available at [http://gitpub.kpe.io/memstore.git](http://gitpub.kpe.io/memstore.git)
13 * Releases are available for download at [http://files.kpe.io/memstore/](http://files.kpe.io/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. For more information on the changes in
24 memcache, see [memcache](memcache.html).
25
26 This library also requires Common Lisp libraries of 
27 [kmrcl](http://gitpub.kpe.io/kmrcl.git),
28 [cl-store](http://common-lisp.net/project/cl-store/),
29 [flexi-streams](http://weitz.de/flexi-streams/),
30 and [zlib](http://common-lisp.net/project/zlib/).
31
32 Overview
33 --------
34
35 Memstore allows efficient storing of simple objects as well as
36 easy storing of complex objects and optional compression.
37
38 When storing an object, if the object is a string then that is
39 directly written to the memcached server. For non-strings, an attempt
40 to made to write the object to a string with `*print-readably*` bound
41 to `t`. If that succeeds, then the string is converted to a vector of
42 octets. If that fails, the `cl-store` is used to serialize that object
43 to a vector of octets.
44
45 Next, optional compression is applied to the octets. First, the
46 `*compression-enabled*` flag is checked to see if compression is
47 enabled. Next, the length of the objects is compared to
48 `*compression-threshold*`. Only objects larger than
49 `*compression-threshold*` will be compressed. For objects that qualify
50 for compression, the size of the compressed object is compared to the
51 length of the uncompressed object to decide if the object is shrunk
52 enough to make the compression worthwhile.
53
54 The `flags` parameter to cl-memcached stores whether cl-store or
55 write-to-string is used to serialize the object and whether
56 compression is applied. `mem-restore` uses those flags to determine
57 how to reconstruct the object.