你应该考虑使用Redis.它是一个高级NoSQL数据库,支持丰富的服务器端数据结构,如列表,集合,有序集和哈希.它也是最快的NoSQL数据库之一:110000 SET /秒,入门级Linux机箱中的81000 GET /秒.检查基准.
我有一个功能丰富的开源C#客户端,让您可以保留任何C#POCO类型本机可用:http: //code.google.com/p/servicestack/wiki/ServiceStackRedis
以下是一些比较Redis C#客户端与RavenDB的基准测试.
客户端提供了丰富的接口,为Redis丰富的服务器端数据结构的.NET通用IList,IDictionary和ICollection提供包装器.
如果您想查看有关如何使用它来开发实际应用程序的好教程,请查看:http: //code.google.com/p/servicestack/wiki/DesigningNoSqlDatabase
这是上面页面中的一个示例,显示了存储和检索C#对象的容易程度:
var redis = new RedisClient();
using (var redisUsers = redisClient.GetTypedClient<User>())
{
redisUsers.Store(new User { Id = redisUsers.GetNextSequence(), Name = "demis" });
redisUsers.Store(new User { Id = redisUsers.GetNextSequence(), Name = "mythz" });
var allUsers = redisUsers.GetAll();
Console.WriteLine(allUsers.Dump());
}
/*Output
[
{
Id: 1,
Name: ayende,
BlogIds: []
},
{
Id: 2,
Name: mythz,
BlogIds: []
}
]
*/
Run Code Online (Sandbox Code Playgroud)
虽然服务器主要是在Linux上开发的,但我可以在以下网址找到Windows redis-server版本:http: //code.google.com/p/servicestack/wiki/RedisWindowsDownload
| 归档时间: |
|
| 查看次数: |
6999 次 |
| 最近记录: |