|
|
Comments and Discussions
|
|
 |

|
I'm interested in trying this DB out; it looks like it's well implemented, and well supported. However, I'm ideally trying to find a solution that will work across a variety of .NET platforms, specifically Windows, Windows RT, and Windows Phone. Does RaptorDB support usage on Windows RT and/or Windows Phone? I'm not seeing any documentation that says it does, but figured it couldn't hurt to ask. If not, do you plan to add this support? Regardless, nice job!
Jamie Nordmeyer Portland, Oregon, USA
|
|
|
|

|
Thanks Jamie!
I haven't really tested on WinRT/Phone yet, but probably it should be fine and work.
I don't have the devices to test on so it would not be on my todo list in the near future.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi Mehdi,
Really great piece of code! I have a situation where I'm currently using a Dictionary with 10 milion items in it. The problem with this is the population of the Dictionary (can take a while).
RaptorDB could be a great to solve this start up time. However, everytime I open the DB, it's going to rebuild all indexes (even if I'm only using it for reading). With this 10 milion items, it takes about an minute.
2012-12-22 04:47:18|DEBUG|10|RaptorDB.KeyStore`1|| Current Count = 9,999,872
2012-12-22 04:47:18|DEBUG|10|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-22 04:47:18|DEBUG|10|RaptorDB.KeyStore`1|| Rebuilding index...
2012-12-22 04:47:18|DEBUG|10|RaptorDB.KeyStore`1|| last index count = 0
2012-12-22 04:47:18|DEBUG|10|RaptorDB.KeyStore`1|| data items count = 9999872
2012-12-22 04:47:18|DEBUG|10|RaptorDB.KeyStore`1|| 100,000 items re-indexed
2012-12-22 04:47:18|DEBUG|10|RaptorDB.KeyStore`1|| 100,000 items re-indexed
Is there anything that I can do to prevent this?
Thanks,
Danny
|
|
|
|

|
Thanks Danny!
Make sure the engine shutdowns cleanly, and the rebuilding should not kick in to correct things.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Ah, I missed the Shutdown method. That works, thanks!
|
|
|
|

|
How we can make foreach enumeration on all keys?
foreach(var key in storage){
var itemContent = raptor.Get(key)....
//do something with value
//delete key
}
or
foreach(var item in storage){
var itemContent = item.Value;
//do something with value
//delete key
}
I want to store logs in raptorDB and later with Quartz to check if there is any keys and if any, copy to original DB.
Still amater
|
|
|
|

|
Can you please also tell us how to construct our schema? Currently im testing as static variable
public static RaptorDB.RaptorDB<int> raptor = RaptorDB.RaptorDB<int>.Open(raptorPath, 200, false);
and in every function i use this static variable
public bool Something(){
string some = string.empty;
raptor.get(1,out some);
}
But i noticed that i cant remove key and also everytime i check for keys count, it getting duplicated like 2,4,8,16...
I have two functions, one with just Set() and another one with Get() and RemoveKey()
Still amater
|
|
|
|

|
here are some screenshots
EnumerateStorageFile= http://prntscr.com/m4l39.
totalCount = http://prntscr.com/m4l8g
removeKey - dont work
Count - looks like give me *2 of total
Still amater
|
|
|
|

|
You should use the Enumerate() method instead of EnumerateStorageFile().
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Count() currently returns the storage file contents and RaptorDB does not delete data when you call RemoveKey(), so a "deleted" record is added to the storage file hence you get the sequence you referred to.
I'm changing the Count() method to use the index file instead so you will get a more accurate result.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
To enumerate you can use the Enumerate(T fromkey) method and supply a starting point.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi,
Thank you for this amazing library, I'm currently porting it to Windows CE (certainly will let you know how it helps us)
While reading the code of Helper.CompareMemCmp in SafeDictionary I've noticed that the return value of this function may not be the result of a general comparison function. As an example the following compare will return true, which is obviously not right. Can you confirm whether it is a bug or a particular optimization in your code based on usage pattern ?
byte[] left = new byte[] {1, 2, 3, 4, 5};
byte[] right = new byte[] {1, 2, 3};
int res = Helper.CompareMemCmp(left, right);
res will be 0 while I expected it to be +1 !
Regards,
|
|
|
|

|
Interesting... the function used is p-invoking the windows api.
I will run some tests on it and try to get a valid response from it.
Thanks!
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Excellent project. But I have one question. What is the easiest way to get maximum key from RaptorDB?
|
|
|
|

|
Interesting question...
There is no method to do this efficiently at the moment I will try to put it in.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Btw. Is raptorDB manage database file space effectively? I ask because I want use raptorDB to implement simple embedded persistent queue. Do you have in plan implement shrink-like or compact-like methods to prevent grow up database file infinitely - is this methods will be necessary?
|
|
|
|

|
I will probably add a "compacting" feature in the future.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
I want to use RaptorDB with MONO on Linux. It works prefect with only minimal changes.
The only thing is to replace the hard-coded path-seperator "\\" with the .NET path field
"Path.DirectorySeparatorChar" in the following files.
BitmapIndex.cs
MGIndex.cs
KeyStore.cs
mylogger.cs
So in a few minutes the RaptorDB is cross-platform ready with MONO. Maybe you can change this in the next version of RaptorDB.
br,
Alex
|
|
|
|

|
Yes, that is about it although in the Doc version I had to change codedom code to Reflection.Emit also (I was really chuffed when it worked on my Asus TF700).
I will update the KV version soon as there a couple of enhancements and fixes for it.
Thanks Alex!
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
I have a scenario where I just need to test for the existence of a key in the index. Here is an addition to the KeyStore.cs file to just return if a key exists.
public bool Exists( T key ) {
lock ( _lock ) {
int off;
return _index.Get( key, out off );
}
}
Thoughts?
|
|
|
|

|
Absolutely spot on! I will add this in the next release. Its the man, not the machine - Chuck Yeager If at first you don't succeed... get a better publicist If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Can more processes (on the same host) open and read/write the same database?
Thanks.
|
|
|
|

|
No, the database files can only be opened by one process. You can however have a service like host which you can connect to via TCP and have multiple processes work with (this is implemented in the document version but not here).
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Why max cpu usage is 25% even on read and write as exe.
I tested on SSD, Raid5 and RamDisk, all benchmarks have similar time.
10 millions : ~25 sec set, ~45 sec get
Isn't it supposed to use max cpu and why there is no difference on ssd, raid5 and ramdisk?
Cpu is I5 2500, Quad core 3.3 Ghz
Raptor 2.5 version
Still amater
|
|
|
|

|
RaptorDB has been designed to be sensitive to your CPU and mostly your RAM speed not the storage speed.
You will get better performance mostly if you upgrade your memory say from DDR2 to DDR3 etc.
The storage speed only comes into play when the engine is storing to disk and this is mainly done in the background so you wouldn't notice (it will become markedly apparent when you shutdown).
This would also be dependent on the amount of data you are storing (in the main storage file) so in the test program we are storing small ~30 bytes per record so the OS and harddisk caches also smooth this out.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
I made simple test vs MongoDB, the performance difference is very huge. On 1 million Guid test, time is like 10x faster on write and 12x faster on read.
I made the test not with normal collection, but with capped collection as in memory fastest MongoDB collection. From my experience,
What are your future plans about Raptor KV DB?
Still amater
|
|
|
|

|
Which was faster?
The KV's big brother is "RaptorDB the Document Store" version, so most of my efforts are going there.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
RaptorDb was faster.
I`m interested for RaptorDB as output caching provider. The only big problem i see here is that RaptorDB dont have LRU algorithm. With LRU algorithm we go step forward of thinking about consistent hashing client and distributed output caching provider.
My question about scalability was more like this one.
Still amater
|
|
|
|

|
Wow! I never tested MongoDb like this!
LRU is on my todo list mostly for memory usage limiting, currently I have no design (minimalist way to do it) for this so I can't say when it will be implemented.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi, It's great fast database. We want to use your db on medium loaded service (5000 requests per minute)
We've configured to save index database every 30 seconds. After simulated incorrect shutdown
we noticed that indexes are being rebuilded from the begining and it tooks a lot of time.
1. May be there is opportunity to rebuild for only new data?
2. Sometimes system hangs on rebuilding indexes on start for long time without any text in log. With last record
2012-10-03 03:22:26|DEBUG|32|RaptorDB.KeyStore`1|| Checking Index state...
2012-10-03 03:22:26|DEBUG|32|RaptorDB.KeyStore`1|| Rebuilding index...
2012-10-03 03:22:26|DEBUG|32|RaptorDB.KeyStore`1|| last index count = 0
2012-10-03 03:22:26|DEBUG|32|RaptorDB.KeyStore`1|| data items count = 2510698
2012-10-03 03:22:26|DEBUG|32|RaptorDB.KeyStore`1|| 100,000 items re-indexed
Can we do something with that problems?
|
|
|
|

|
Currently there is no way of doing this as you can't tell where to start from and the index does not keep a previous state and the pages could be corrupted in any order.
Hopefully non-clean shutdowns should not happen that often.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Am I doing something wrong? It crashes on EnumerateStorageFile
RaptorDB<int> db1 = RaptorDB<int>.Open("c:\\raptordbtest\\t1", false);
RaptorDB<int> db2 = RaptorDB<int>.Open("c:\\raptordbtest\\t2", true);
db1.Set(1, "s1");
db1.Set(2, "s2");
db1.Set(3, "s3");
db2.Set(2, "log2lab2: str1");
db2.Set(2, "log2lab2: str2");
db2.Set(3, "log3lab3: str1");
db2.Set(3, "log3lab3: str2");
db2.Set(1, "log1lab1: str1");
db2.Set(1, "log1lab1: str2");
foreach (var pair in db2.EnumerateStorageFile())
{
listBox1.Items.Add(pair.Key.ToString());
}
db1.Shutdown();
db2.Shutdown();
|
|
|
|

|
What is the error message?
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
RaptorDB 2.5
file: SafeDictionary.cs
Line: 160
fixed (byte* numRef = &(value[startIndex]))
Message: Index was outside the bounds of the array.
By the way...
If I call method Shutdown() and then reopen database, everything works fine
|
|
|
|

|
Hi, sorry for my bad english.
First, thank you for this work.
The function FetchRecordString and RemoveKey are not thread safe. If I add a lock, the problem is resolve.
An another scenario seem to be problematic:
I add 100 item, iterate with a for, call FetchRecordString, remove the key. After the iteration, I save the index and I ask for the Count() method and I receive a count of 200 ! How it's possible ? I remove all so the count suppose to be 0.
|
|
|
|

|
Thanks!
I will add the locks that are missing.
Count() is using the storage file (100 recs + 100 delete recs), it should be using the index file for counting items.
I will change this in the next release.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|

|
Thanks Zab!
1) - find the page in the page list to insert to by comparing the key and the pages first key
- add the key and value to the dictionary of the found page
2) - find the page in the page list for the search key
- get the value from the dictionary in the page found
3) The only limitation at the moment is the amount of memory you have (I had 12gb at the time of testing), it may be possible to go higher on limited ram with a more intelligent caching scheme that flushes out least recently used pages in ram, but it is probably cheaper to get more ram instead.
4)
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi Mehdi,
Much clear now.
But when you said compare the "key" (in my case a string "Hello"), should I compare it as it it or should
I use its hash instead (i.e MurmurHash2("Hello")) ?
You didn't answer yet my question about the "sorted list of pages" at t=0 ?
Thx
Zab
|
|
|
|

|
Hashing will be done transparently if you are using the RaptorDBString or RaptorDBGuid so you don't need to.
The page list is automatically sorted (SortedList) and updated when a page is full (=10000 items) which will sort the keys and split the page into 2 pages.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
First, thanks very much for work!
Second, I have very little knowledge of document oriented databases so sorry if I'm asking some obvious questions but -
1) How do we use the full text search feature? I get putting the [FullText] attribute on the appropriate field, is there anything else that needs to be done? And when searching is it done through the same db.Query() function?
2) Also, how would you achieve something like paging over a table of data? Is it possible to for e.g specify just to retrieve the top 25 results, or results 26-50 etc?
thanks again,
Jeremy
|
|
|
|

|
Thanks Jeremy!
This is the Key Value store forum.
A1) Yes that's is all you need to do, the query will do full text searches e.g. Address = "street" will find and address with the word street in it.
A2) Paging is not supported at the moment, it will come later.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Ahh sorry meant to post to the document store forum.
Anyway thanks alot for the reply, got the full text search going and will implement paging when it's released
|
|
|
|

|
Paging will probably be in v1.6, hopefully
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hello
Thank you for your updates. That's nice to see this project is alive.
Can I add some suggestions ?
. EnumerateStorageFile should not collect the duplicates, or maybe only as an option.
(because it does even when I open the database with AllowDuplicateKeys=false).
. A new function EnumerateKeys to obtain the keys only.
Values are sometimes useless for a filter. It is for performance.
. Publish enumerate functions on RaptorDBString, not only on KeyStore.
. Add some informations to KeyValuePair: IsADuplicate, IsDeleted, etc..
. Add the standard documentation to the functions and classes (with ///).
It is nice to have some details directly inside Visual Studio (with F12).
. KeyStore.Set should replace ( = delete) the previous value.
As of v2.5, I obtain duplicates when I use EnumerateStorageFile.
. A new function: SetIfDifferent to Set only when the bytes are different to a previous value.
Because AFAIK Raptor always add a new key&value, which can causes a lot of duplicates. BTW, I noted it is true even when the size of the new value is equal to the size of the old value. Why not use the old location in the file ?
I know this function would have poor performance, but it can be a choice, depending on what is in the database.
Thank you, and have a nice day.
|
|
|
|

|
EnumerateStorageFile is not meant to be used in that way (it uses the storage file and not the index so that is why you will get the duplicates), EnumerateKeys is probably a better solution.
I will try to fit these suggestion in.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Thank you.
I believe an EnumerateKeys for RaptorDBString will be useful for many applications.
|
|
|
|
|

|
Thanks Mike!
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Is there any tool like RaptorDB manager or browser?
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Even faster Key/Value store nosql embedded database engine utilizing the new MGIndex data structure with MurMur2 Hashing and WAH Bitmap indexes for duplicates. (with MonoDroid support)
| Type | Article |
| Licence | CPOL |
| First Posted | 18 Jan 2012 |
| Views | 130,466 |
| Downloads | 3,649 |
| Bookmarked | 125 times |
|
|