G
GG
Anybody knows of any collection where is not stored in memory but using
hard disk instead?
Thanks
hard disk instead?
Thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Anybody knows of any collection where is not stored in memory but using
hard disk instead?
GG said:Anybody knows of any collection where is not stored in memory but using
hard disk instead?
Arne Vajhøj said:As others has stated then database is one obvious solution.
If you are on 64 bit you could also just use a collection.
What there are not space for in RAM will be on disk in the
pagefile.
Michael said:Not really the best solution as it would slow the machine down dramatically.
It could work ok if you could specify it to use the swap file only but afaik
this is not an option.
Why should a page file be slower than a ny other disk file ?
Jesse said:An in-memory collection whose contents are being paged to and from the
disk by the OS will have worse performance than a collection designed
to operate off the disk, as soon as you do any kind of search on it.
A collection that's designed to run off the disk will probably have an
indexing system so it doesn't have to load the entire file to find a
single element. But searching through a massive memory-based
collection will cause many pages to be swapped in, possibly causing
other useful pages to be swapped out and lowering performance down the
road.
For example, a binary search on a memory-based collection might end up
having to load half the file into memory, one page at a time, while a
disk-based collection could keep all the necessary indexing data in a
single page that never gets swapped out.

An in-memory collection whose contents are being paged to and from the
disk by the OS will have worse performance than a collection designed
to operate off the disk, as soon as you do any kind of search on it.
A collection that's designed to run off the disk will probably have an
indexing system so it doesn't have to load the entire file to find a
single element. But searching through a massive memory-based
collection will cause many pages to be swapped in, possibly causing
other useful pages to be swapped out and lowering performance down the
road.
For example, a binary search on a memory-based collection might end up
having to load half the file into memory, one page at a time, while a
disk-based collection could keep all the necessary indexing data in a
single page that never gets swapped out.
replay messages but only pick the ones that did not make it into the
database. Going to Sql server to check for record existense is very
expensive. Inserting dup keys with ignore_dup_key on will be very slow.
GG said:We do use SQL server as the backend.We are inserting records in SQL
using bcp from a different source. However, sometimes we may need to
replay messages but only pick the ones that did not make it into the
database. Going to Sql server to check for record existense is very
expensive. Inserting dup keys with ignore_dup_key on will be very slow.
Probably Arne Vajhøj idea of
"A collection that's designed to run off the disk will probably have an
indexing system"
would be the ideal solution for us.
GG said:Thank all for the comments. I should have been more specific.
We do use SQL server as the backend.We are inserting records in SQL
using bcp from a different source. However, sometimes we may need to
replay messages but only pick the ones that did not make it into the
database. Going to Sql server to check for record existense is very
expensive. Inserting dup keys with ignore_dup_key on will be very slow.
Probably Arne Vajhøj idea of
"A collection that's designed to run off the disk will probably have an
indexing system"
would be the ideal solution for us.
Why? There's no a priori reason to believe this is true, even though it's
true that _some_ in-memory collections may not be as effecient as a
disk-based database.
Yes, it's possible to write an in-memory collection that will perform
as well when paged to disk as a disk-based collection. But the
specific collection types that have been mentioned here don't fit the
bill, nor do any of the other standard in-memory collections (AFAIK).
Jesse said:Yes, it's possible to write an in-memory collection that will perform
as well when paged to disk as a disk-based collection. But the
specific collection types that have been mentioned here don't fit the
bill, nor do any of the other standard in-memory collections (AFAIK).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.