Re: Application Architecture Question...
Re: Application Architecture Question...
- Subject: Re: Application Architecture Question...
- From: Dustin Voss <email@hidden>
- Date: Wed, 29 Oct 2003 18:34:19 -0800
On 29 Oct, 2003, at 3:22 PM, Chris Shorrock wrote:
I'm currently starting work on a project which utilizes the SearchKit
framework to search a potentially large index of documents. This is
not unlike Mail.app where you have a large number of messages all
indexed and searchable through the SearchKit.
What my question is, is how should I store each of the documents.
Currently when a new document is created, I add it it's contents to an
index and then store the NSData, amongst some other meta data
information in a NSMutableDictionary. What this means is that I have a
single dictionary object (persisted to file) which contains all the
messages in the system. I'm thinking that once the number of messages
starts to get large this type of single file storage mechanism will be
undesirable (loading it into memory will be a waste). So I suppose
what I'm wondering is what alternatives are there to this type of
infrastructure, and is this infrastructure as bad as I suspect?
Well, I can say that it sounds like a bad idea to me. How about keeping
each document in its own file, and the index in a custom data structure
on disk? If you want to keep everything together, you can use a bundle
containing each of the documents plus the index. The index should not
be read into memory entirely, but the index file should have a tree
structure of some sort, and you will be able to seek within the file,
avoiding reading the entire thing. If you have memory available, you
can read and cache part of the index.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.