I am relatively new to NoSQL and am working on a project with Redis at back-end to a C# ASP.NET application. I am using ServiceStack.Redis as my C# client.
While CRUD is relatively simple, I wanted to know the fastest way of querying data from Redis. We have a list that can grow well beyond 200k records in a matter of days (since data for every second is recorded for various entities). Basically it's sensor data so if we are recording 200 attributes, then: 86400(s) x 200 = 172800 records per day.
My class looks as follows:
public class Snsr_Data_Val
{
public long Snsr_ID { get; set; }
public DateTime Rec_Date { get; set; }
public long Category_ID { get; set; }
public double Value {get; set; }
}
Currently my query looks like this
public IList<Snsr_Data_Val> GetDataForCategory(long category_id)
{
PooledRedisClientManager redisManager = new PooledRedisClientManager("localhost:9257");
IList<Snsr_Data_Val> result = null;
redisManager.ExecAs<Snsr_Data_Val>(sensordata =>
{
result = sensordata.GetAll().Where(d => d.Category_ID == category_id).ToList();
});
redisManager = null;
return result;
}
What worries me is that GetAll() may be time consuming. I remember in SQL Server we used something like .GetTable().Where(...), is there something of the sorts in Redis / NoSQL?