jgric2 / Fast-Persistent-Dictionary

A performant C# key-value store that keeps keys in-memory and stores values on disk, leveraging Grobuf's speedy serialization power.
MIT License
3 stars 0 forks source link

Backups and concurrency question #1

Open PeterKneale opened 2 days ago

PeterKneale commented 2 days ago

Looks like an interesting project, i've got one or two systems that have simple data requirements such that provisioning databases is overkill and this looks like it might help. Just two questions

Thank you!

jgric2 commented 2 days ago

Hi there!

Glad you like the project! 1). there is a SaveDictionary method that should do what you need and from there you should be able to upload the exported dictionary to your backup. Depending on how many items you have in the database but this export and import process is quite fast (on my machine with the test winforms example using the "SampleComplex" object type which is a class with a list which in turn contains various enums and other classes inside that with a list of 5-120 cars Results:

300000 items, 1.8gb file, 3.9 seconds save, 2.62 seconds to load 30000 items, 183mb file, 0.61 seconds save, 0.27 seconds load

for the simple test being 4 guids joined together as a string

300000 items, 92.1 mb file, 0.33 seconds save, 0.22 seconds load. 30000 items, 9.2 mb file, 0.047 seconds save, 0.047 seconds load. )

2.) the dictionary should fully allow for any multithreaded use, If for some reason it doesn't meet what you need let me know and I will happily make adjustments for you.