-
Notifications
You must be signed in to change notification settings - Fork 76
Home
PAN, Myautsai edited this page Feb 4, 2016
·
11 revisions
libmc is a fast and lightweight memcached client library for C++/Python/Golang without any other dependencies in runtime. The internal part is written in C++. The Python wrapper is written mainly in Cython and the Golang wrapper is written mainly in cgo.
The python version of libmc can be considered as a drop in replacement for libmemcached and python-libmemcached.
Update: Golang version of libmc is now in beta, checkout golibmc.
Internal classes:
Client
| (1:1)
ConnectionPool
| (1:N)
Connection
/ | (1:1) \
BufferReader Parser BufferWriter
| (1:N)
DataBlock
- Client: top-level API for libmc
-
ConnectionPool:
- dispatching different keys to different connections according to key route(Consistent hashing)
- multiplexing on top of TCP connections
- collecting and merging results from TCP connections
-
Connection: wrapper for TCP connection to each memcached server.
Each
Connection
has oneParser
, oneBufferReader
, and oneBufferWriter
. - BufferReader: buffer helper for receving buffer from memcached server
- BufferWritter: buffer helper for sending buffer to memcached server
- DataBlock: wrapper for each continuous memory space
- Build and Installation
- Configuration
- Features
- Internal Details
- Developments
Slide: Reinventing the wheel: libmc