Origin:
I watched dnt3 a few days ago. CodeIt has already integrated the memcache access function. similar to the cache server software on the net platform, the velocity of MS is estimated to be a little bit longer, so I have a rough idea of the functional structure of memcache. It looks a bit similar to the TCP communication framework designed last year, because the framework concurrency of TCP is 2-3 K and a large amount of data is processed in the database, some cache functions and policy design are also involved. Now I want to design a complete memcache-like system.
System Structure
The distributed mode where memcache does not communicate with each other is adopted in advance. The content stored by each Cache Server is determined by the application system. That is, the application needs to design a set of cache access and location policies.
Function Design
Cahce:
Actually stores the cache data of the application system
Byte [] Array Storage
TCP communication:
Binary communication protocol
Protocol description
Cache Policy:
Expiration timeAlgorithm
LRU Algorithm
LFU Algorithm
Memory Management:
Memory Access
Memory cleanup Mechanism
Memory Pool Management
System Monitoring:
Management client:
Version plan
V0.1 structure design and communication protocol design.
The basic functions of v0.2 are implemented. The cache uses the. NET built-in collection class.
V0.3 implements the Cache Policy module and Memory Management Module
The v0.4tcp communication model adopts the asynchronous model of. net3.5, And the asynchronous context uses a cache pool (in the past, 2.0 was used, with memory fragments, and outofmemory would be used under 1.1 ).
V0.5 extends the memory management function. The cache uses the cache pool technology and the fragment function.