KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am new to Redis (using it at a hosted service) and want to use it as a demonstration / sandbox data storage for lists. I use the following piece of code. It works - for me. But is it a valid (and not completely bad practice) usage for a small web site with several (up to 100) concurrent users (for a small amount of data - up to 1000 list items)? I'm using static connection and a static redisclient typed list like this: public class MyApp { private static ServiceStack.Redis.RedisClient redisClient; public static IList<Person> Persons; public static IRedisTypedClient<Person> PersonClient; static MyApp() { redisClient = new RedisClient("nnn.redistogo.com", nnn) { Password = "nnn" }; PersonClient = redisClient.GetTypedClient<Person>(); Persons = PersonClient.Lists["urn:names:current"]; } } Doing this I have a very easy to use persistent list of data, which is exactly what I want when I'm building / demonstrating the basic blocks of my application. foreach (var person in MyApp.Persons) ... Adding a new person: MyApp.Persons.Add(new Person { Id = MyApp.PersonClient.GetNextSequence(), Name = "My Name" }); My concern is (currently) not the fact that I am loading the complete list into memory at appstart, but rather the possibility that my connection to the redis host is not following good standards - or that there is some other issue that I'm not aware of. Thanks
Tags (comma-separated)
Save Edits
Cancel