I am trying to import large amounts of data (Twitter stream at about 20-25 tweets a second) into RavenDB for testing and large scale data testing. I have some code which is writing data quite well, but after a while I get an error:
I won't fill in all the code, but here is the gist of it:
Open RavenDB Session
Start reading data from Twitter Stream
For each line, parse JSON into known C# object
add item to RavenDB
increment counter
if counter % 25 = 0, save changes to RavenDB.
I have not tried what it has suggested, because it says to look at different ways of doing this. Should I kill my session every 200 or so inserts? Is there a way to insert an array of objects with Raven DB? Am I doing this completely wrong?
Two option:
Either way will work, although the second approach is slightly faster.
Edit: According to Orens comment below, it is actually the first approach that is faster.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With