this case a key-value NoSQL type. See this article for more information about different types of NoSQL databases.
- 64 bit OS
- The windows package manager Chocolatey
- C:\> choco install redis-64
- SET PATH=%PATH%;"c:\Program Files\Redis"

- public class RedisConnectorHelper
- {
- static RedisConnectorHelper()
- {
- RedisConnectorHelper.lazyConnection = new Lazy<ConnectionMultiplexer>(() =>
- {
- return ConnectionMultiplexer.Connect("localhost");
- });
- }
- private static Lazy<ConnectionMultiplexer> lazyConnection;
- public static ConnectionMultiplexer Connection
- {
- get
- {
- return lazyConnection.Value;
- }
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- var program = new Program();
- Console.WriteLine("Saving random data in cache");
- program.SaveBigData();
- Console.WriteLine("Reading data from cache");
- program.ReadData();
- Console.ReadLine();
- }
- public void ReadData()
- {
- var cache = RedisConnectorHelper.Connection.GetDatabase();
- var devicesCount = 10000;
- for (int i = 0; i < devicesCount; i++)
- {
- var value = cache.StringGet($"Device_Status:{i}");
- Console.WriteLine($"Valor={value}");
- }
- }
- public void SaveBigData()
- {
- var devicesCount = 10000;
- var rnd = new Random();
- var cache = RedisConnectorHelper.Connection.GetDatabase();
- for (int i = 1; i < devicesCount; i++)
- {
- var value = rnd.Next(0, 10000);
- cache.StringSet($"Device_Status:{i}", value);
- }
- }
- }





