首页 技术 正文
技术 2022年11月8日
0 收藏 683 点赞 1,358 浏览 1198 个字

STSdb是什么

再来说明一下STSdb是什么:STSdb是C#写的开源嵌入式数据库和虚拟文件系统,支持实时索引,性能是同类产品的几倍到几十倍,访问官方网站

温故知新

之前发了文章《STSdb,最强纯C#开源NoSQL和虚拟文件系统》,相信大家对Waterfall-tree(瀑布树)算法还是有兴趣的。

不兼容改动

为了提供更易容的API和更好的性能,STSdb 4.0 RC2改变了文件格式,这个改变可能会持续,直到4.0正式版。

C/S架构

在上一篇文章,提及会在4.0正式版之前加入对C/S的支持,现在在RC2已经引入。

客户端

//客户端,创建一个连接:
using (IStorageEngine engine = STSdb.FromNetwork(host, port))
{
}

服务器端

//服务器端,启动一个服务器实例
using (IStorageEngine engine = STSdb.FromFile("stsdb4.sys", "stsdb4.dat"))
{
var server = STSdb.CreateServer(engine, port);
server.Start();
//服务器端已经启动,可以接受客户端请求
server.Stop();
}

DataType类型

DataType类型用于描述非泛型的IIndex和IData数据类型

//以前的做法
XIndex<IData, IData> table = engine.OpenXIndex(typeof(Data<int>), typeof(Data<string>), "table");
//新做法
IIndex<IData, IData> table = engine.OpenXIndex(DataType.Int32, DataType.String, "table");

  

//以前的做法
XIndex<IData, IData> table = engine.OpenXIndex(typeof(Data<long>), typeof(Data<string, DateTime, double, double, long, string>), "table");
//新做法
DataType keyType = DataType.Int64;
DataType recordType = DataType.Slotes(
DataType.String,
DataType.DateTime,
DataType.Double,
DataType.Double,
DataType.Int64,
DataType.String
);
IIndex<IData, IData> table = engine.OpenXIndex(keyType, recordType, "table");

 

公有字段

IIndex现在支持公有字段的读写

List<T>, T[]和Dictionary

在4.0 RC2仍然不支持,但会在4.0 Final支持

下载

点击这里下载源代码

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,489
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,904
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,490
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,291