I am working on a prototype using RavenDB to evaluate my company. We will have many threads inserting thousands of lines every few seconds, and many threads reading at the same time. I did my first simple insert test, and before moving on, I want to make sure I use the recommended method to get the best performance for RavenDB inserts.
I believe there is a bulk insert option. I have not researched this yet, as I am not sure if this is necessary. I am using the .NET API and my code is as follows:
Debug.WriteLine("Number of Marker objects: {0}", markerList.Count);
StopwatchLogger.ExecuteAndLogPerformance(() =>
{
IDocumentSession ravenSession = GetRavenSession();
markerList.ForEach(marker => ravenSession.Store(marker));
ravenSession.SaveChanges();
}, "Save Marker data in RavenDB");
StopwatchLogger simply triggers the action by placing a stopwatch around it:
internal static void ExecuteAndLogPerformance(Action action, string descriptionOfAction)
{
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
action();
stopwatch.Stop();
Debug.WriteLine("{0} -- Processing time: {1} ms", descriptionOfAction, stopwatch.ElapsedMilliseconds);
}
. , RavenDB ( 701). , , .
:
: 671
RavenDB - : 1308
:
: 670
RavenDB - : 1266
:
: 667
RavenDB - : 625
:
: 639
RavenDB - : 639
. 639 639 . ? , , 1000 .
/ Marker . , :
{
"ID": 14740009,
"SubID": "120403041588",
"ReadTime": "2012-04-03T13:51:45.0000000",
"CdsLotOpside": "163325",
"CdsLotBackside": "163325",
"CdteLotOpside": "167762",
"CdteLotBackside": "167762",
"EquipmentID": "VA_B"
}
?
( ) ?
- , ?