4f85d96c470f93e99bc97e1c04f5de20ec5e6b6c
[awesomized/libmemcached] / docs / source / libmemcached.rst
1 C/C++ Client Library for memcached
2 ==================================
3
4 SYNOPSIS
5 --------
6
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
9
10 =======
11
12 `libmemcached` is an open source C/C++ client library and tools for the
13 memcached server (http://memcached.org/). It has been designed to be light on
14 memory usage, thread safe, and provide full access to server side methods.
15
16 `libmemcached` was designed to provide the greatest number of options to use
17 Memcached. Some of the features provided:
18
19 1. Asynchronous and Synchronous Transport Support.
20 2. Consistent Hashing and Distribution.
21 3. Tunable Hashing algorithm to match keys.
22 4. Access to large object support.
23 5. Local replication.
24 6. A complete reference guide and documentation to the API.
25 7. Tools to Manage your Memcached networks.
26
27 DESCRIPTION
28 -----------
29
30 "Memcached is a high-performance, distributed memory object caching
31 system, generic in nature, but intended for use in speeding up dynamic web
32 applications by alleviating database load."
33 `http://memcached.org/ <http://memcached.org/>`_
34
35 `libmemcached` is a small, thread-safe client library for the
36 memcached protocol. The code has all been written to allow
37 for both web and embedded usage. It handles the work behind routing
38 individual keys to specific servers specified by the developer (and values are
39 matched based on server order as supplied by the user). It implements
40 a modular and consistent method of object distribution.
41
42 There are multiple implemented routing and hashing methods. See the
43 :func:`memcached_behavior_set` manpage for more information.
44
45 All operations are performed against a :type:`memcached_st` structure.
46 These structures can either be dynamically allocated or statically
47 allocated and then initialized by :func:`memcached_create`. Functions have
48 been written in order to encapsulate the :type:`memcached_st`. It is not
49 recommended that you operate directly against the structure.
50
51 Nearly all functions return a :type:`memcached_return_t` value.
52 This value can be translated to a printable string with
53 :type:`memcached_strerror`.
54
55 Objects are stored on servers by hashing keys. The hash value maps the key to a
56 particular server. All clients understand how this hashing works, so it is
57 possibly to reliably both push data to a server and retrieve data from a server.
58
59 Group keys can be optionally used to group sets of objects with servers.
60
61 Namespaces are supported, and can be used to partition caches so that multiple
62 applications can use the same memcached servers.
63
64 Some features of the library must be enabled through `memcached_behavior_set`.
65
66 CONSTANTS
67 ---------
68
69 A number of constants have been provided for in the library.
70
71 .. only:: man
72
73 See :manpage:`libmemcached_constants(3)`.
74
75 .. only:: html
76
77 See :doc:`libmemcached/constants`.
78
79 THREADS AND PROCESSES
80 ---------------------
81
82 No global variables are used in this library.
83
84 :type:`memcached_st` structures are thread-safe, but when using threads or
85 forked processes it is important to keep one instance of :type:`memcached_st`
86 per process or thread. Without creating your own locking structures you can not
87 share a single :type:`memcached_st`. However, you can call
88 :func:`memcached_quit` on a :type:`memcached_st` and then use the resulting
89 cloned structure.
90
91 SYSTEMTAP
92 ---------
93
94 `libmemcached` can be built to support Systemtap on Linux when enabled at
95 compile time.
96
97 Please see :manpage:`stap(1)` and :manpage:`dtrace(1)` for more information
98 about Systemtap.
99
100 CLIENT PROGRAMS
101 ---------------
102
103 `libmemcached` comes with a few useful client programs:
104
105 .. only:: man
106
107 :manpage:`memcached(1)`
108 :manpage:`memaslap(1)`
109 :manpage:`memcapable(1)`
110 :manpage:`memcat(1)`
111 :manpage:`memcp(1)`
112 :manpage:`memdump(1)`
113 :manpage:`memerror(1)`
114 :manpage:`memexist(1)`
115 :manpage:`memflush(1)`
116 :manpage:`memparse(1)`
117 :manpage:`memping(1)`
118 :manpage:`memrm(1)`
119 :manpage:`memslap(1)`
120 :manpage:`memstat(1)`
121 :manpage:`memtouch(1)`
122
123 .. only:: html
124
125 * :doc:`bin/memaslap`
126 * :doc:`bin/memcapable`
127 * :doc:`bin/memcat`
128 * :doc:`bin/memcp`
129 * :doc:`bin/memdump`
130 * :doc:`bin/memerror`
131 * :doc:`bin/memexist`
132 * :doc:`bin/memflush`
133 * :doc:`bin/memparse`
134 * :doc:`bin/memping`
135 * :doc:`bin/memrm`
136 * :doc:`bin/memslap`
137 * :doc:`bin/memstat`
138 * :doc:`bin/memtouch`
139
140 UTILITY LIBRARIES
141 -----------------
142
143 .. only:: man
144
145 :manpage:`libhashkit(3)`
146 :manpage:`libmemcachedutil(3)`
147
148 .. only:: html
149
150 * :doc:`libhashkit`
151 * :doc:`libmemcachedutil`
152
153 SEE ALSO
154 --------
155
156 .. only:: man
157
158 :manpage:`memcached(1)`
159
160 :manpage:`libmemcached_configuration(3)`
161 :manpage:`libmemcached_examples(3)`
162
163 :manpage:`memcached_analyze(3)`
164 :manpage:`memcached_append(3)`
165 :manpage:`memcached_auto(3)`
166 :manpage:`memcached_behavior(3)`
167 :manpage:`memcached_callback(3)`
168 :manpage:`memcached_cas(3)`
169 :manpage:`memcached_create(3)`
170 :manpage:`memcached_delete(3)`
171 :manpage:`memcached_dump(3)`
172 :manpage:`memcached_exist(3)`
173 :manpage:`memcached_fetch(3)`
174 :manpage:`memcached_flush(3)`
175 :manpage:`memcached_flush_buffers(3)`
176 :manpage:`memcached_generate_hash_value(3)`
177 :manpage:`memcached_get(3)`
178 :manpage:`memcached_last_error_message(3)`
179 :manpage:`memcached_memory_allocators(3)`
180 :manpage:`memcached_pool(3)`
181 :manpage:`memcached_quit(3)`
182 :manpage:`memcached_result_st(3)`
183 :manpage:`memcached_return_t(3)`
184 :manpage:`memcached_sasl(3)`
185 :manpage:`memcached_servers(3)`
186 :manpage:`memcached_server_st(3)`
187 :manpage:`memcached_set(3)`
188 :manpage:`memcached_set_encoding_key(3)`
189 :manpage:`memcached_stats(3)`
190 :manpage:`memcached_strerror(3)`
191 :manpage:`memcached_touch(3)`
192 :manpage:`memcached_user_data(3)`
193 :manpage:`memcached_verbosity(3)`
194 :manpage:`memcached_version(3)`
195
196 .. only:: html
197
198 * :manpage:`memcached(1)`
199
200 * :doc:`libmemcached/configuration`
201 * :doc:`libmemcached/examples`
202