Memcached and Redis have the same point: All are stored in the form of key-value pairs to store the data, popular speaking is a big Hashtable
The cached data is present in the content Key-value
Different points:
Memcached:
1, a key corresponding value must be serialized through the client into a binary stream storage byte[] (disadvantage, because the serialization of deserialization consumes a large CPU)
2, a key corresponding to the maximum value can only be 1m
3, the traditional memcached is not support the persistent operation of memory data, when the server restarts, the data will be lost
4, can be configured to read and write separation
5. Multithreading
Redis
1, a key corresponding to the value can be string,list<>,sortlist<>,set,orderdset, implementation of the queue, eliminating the serialization operation (greatly improved CPU efficiency)
2. Redis can persist the data in memory to the server hard disk according to the setting policy, and automatically reload the data back from the server hard disk when the server restarts.
3. Can configure the read and write separation of Redis
4. Single Thread
How to access through C #:
Both memcached and Redis reside on the server as a service process, while the socket listens for requests and transmits data through the stream
They all provide C # clients access to the class library (a set of. dll)
Third-party cache software memcached and redis similarities and differences