Here are a couple of simple C# examples for Redis and MemCached.
Please note, the Redis server included in this example should not be used in production code.
I use a factory method to create a number of clients with a number trades, which then get written to and read from Redis and MemCached.
To run the Redis and MemCached servers included in the source code below, with default settings just run each executable:
Both Redis and MemCached are designed to be distributed over multiple machines. Bear in mind, Redis with the default settings persists the data to disk, which you can turn off, whereas MemCached is purely in memory.
The above code examples have been altered to display purely the relevant code for interacting with Redis and MemCache. The source code below contains additional code such as writing to the console window and making use of the stopwatch.