2019独角兽企业重金招聘Python工程师标准>>>
iBoxDB是一款高性能的NOSql数据库,其具备类SQL的一些特性,但的确是个NOSql数据库。高性能、无依赖、线程安 全、先天支持 Java 、.NET、Android、Mono、Unity3D、Xamarin、Nashorn、Linux、Windows Phone等平台、支持索引、事务、主键、零配置,内嵌或独立Server,用类SQL语局查询、支持Linq。官方有跟MongoDB的性能对比,基本 是高于MongoDB的。
官方网站:http://www.iboxdb.com/
下面我们就摘取官方网站的一些例子,方便大家进一步认识:
Examples
using(var box = db.Cube()){ //select, insert, update, delete ...var result = box.Commit();}
常见对象的插入:
box.Bind("Member").Insert(new Member() { ID=box.NewId(Member.IncTableID, 1) ,LoginName = "Andy",Password = Member.EncodePassowrd("123"),Tags = new string[]{ "Nice" , "Strong" }});
Dynamic Object (document database)
game["GameType"] = "ACT";box.Bind("Product").Insert(game);
game.put("GameType", "ACT");box.bind("Table").insert(game);
Key Value Style Query
box.Bind("Table", 2L).Select
box.bind("Table", ID).select(Member.class);//Composite Keybox.bind("Table2",8, "MyID").select(Product.class);
//from TABLE where A>? & B<&#61;? order by C limit 0,10box.Select
//from [table] where [condition] // order by [field1] desc,[field2] limit [0,10]//[Condition:] &#61;&#61; !&#61; <<&#61; > >&#61; & | ( )//[IFunction:] &#61;[F1,F2,F3]box.select(Member.class, "from Member where Name&#61;&#61;?", "MyName");
box.Select
可以配合linq来使用
from o in box.Select
.NET | |
---|---|
|
在32bit系统上 PK MongoDB&#xff1a;
Results:
iBoxDB.NET 在64bit System
threadCount&#61;100000 , batchCount&#61;10
MongoDB(Default)Database Transaction Test: NoneInsert:1000000 AVG:10521 objects/siBoxDB(File Mode)Database Transaction Test: SucceededInsert:1000000 AVG:17981 objects/sUpdate:1000000 AVG:12397 objects/s Delete:1000000 AVG:22869 objects/siBoxDB(MemoryMappedFile Mode)Database Transaction Test: SucceededInsert:1000000 AVG:38458 objects/sUpdate:1000000 AVG:20200 objects/s Delete:1000000 AVG:33342 objects/siBoxDB(InMemory Mode)Database Transaction Test: SucceededInsert:1000000 AVG:39132 objects/sUpdate:1000000 AVG:20226 objects/s Delete:1000000 AVG:33658 objects/s
iBoxDB v1.5 mongodb-win32-x86_64-2008plus-2.4.5 MongoDB.Driver v1.8.2.34
MongoDB(Default)Database Transaction Test: NoneInsert:1,000,000 AVG: 32,702 objects/siBoxDB(File Mode)Database Transaction Test: SucceededInsert:1,000,000 AVG:33,368 objects/sUpdate:1,000,000 AVG:16,939 objects/s Delete:1,000,000 AVG:22,504 objects/siBoxDB(MemoryMappedFile Mode)Database Transaction Test: SucceededInsert:1,000,000 AVG:42,236 objects/sUpdate:1,000,000 AVG:17,765 objects/s Delete:1,000,000 AVG:23,147 objects/siBoxDB(InMemory Mode)Database Transaction Test: SucceededInsert:1,000,000 AVG:47,382 objects/sUpdate:1,000,000 AVG:26,806 objects/s Delete:1,000,000 AVG:35,092 objects/s
实现主从同步&#xff1a;
好了&#xff0c;先整理到这儿吧&#xff0c;感兴趣的朋友&#xff0c;可以去参照官网&#xff0c;动手试试。