You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Tobias Lütticke <t....@inovex.de> on 2005/10/28 15:45:46 UTC

Usage RAMDirectory

Hi,

for the last days I had the thought lingering in my mind that somehow I had to use the 
RAMDirectory. I have a production system with plenty of memory so that would be nice. 
However, it's a update-happy application and the index needs to be persistent (meaning 
FSDirectory).

Therefore I came up with the idea to use both - RAM and FSDirectory. I plan to read the 
index into RAMDirectory for search purposes and in case of write access just update the 
RAMDirectory as well as the FSDirectory.
Then I have both, persistent storage and fast read access. The double update should be 
bearable since the in-memory update is fast. Moreover, the users are willing to accept a 
delay when writing rather upon reading.

Has anybody ever tried this? Are there downsides or do I miss anything? I imagine I could 
hardly be the first to try this...

I would be happy if someone has experiences to share.

Cheers
   Tobias


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Usage RAMDirectory

Posted by Tobias Lütticke <t....@inovex.de>.
Hi Rob,

 > How important is it that the search index be absolutely up to date?

Very important, I'am afraid. There are two web apps (out of historical reasons - they are 
located in the same EAR) with different users. Say a user creates or updates records. Then 
the changes have to be available immediately for the other user in the other application.
Sounds kind of weird probably, but that's the way it is :-)

I am probably going to try what the performance benefit of using RAMDirectory would 
roughly be and then decide whether I take the effort of double index update. Shouldn't be 
too bad.

Thanks
   Tobias


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Usage RAMDirectory

Posted by Rob Young <bu...@gmail.com>.
How important is it that the search index be absolutely up to date? I 
read from a RAMDirectory based index but the actual index is in a 
FSDirectory. The way I managed it was to have the RAMDirectory 
periodically (two hourly) reloaded. My data doesn't have to be 
completely up to date so this works for me.

Tobias Lütticke wrote:

> Hi,
>
> for the last days I had the thought lingering in my mind that somehow 
> I had to use the RAMDirectory. I have a production system with plenty 
> of memory so that would be nice. However, it's a update-happy 
> application and the index needs to be persistent (meaning FSDirectory).
>
> Therefore I came up with the idea to use both - RAM and FSDirectory. I 
> plan to read the index into RAMDirectory for search purposes and in 
> case of write access just update the RAMDirectory as well as the 
> FSDirectory.
> Then I have both, persistent storage and fast read access. The double 
> update should be bearable since the in-memory update is fast. 
> Moreover, the users are willing to accept a delay when writing rather 
> upon reading.
>
> Has anybody ever tried this? Are there downsides or do I miss 
> anything? I imagine I could hardly be the first to try this...
>
> I would be happy if someone has experiences to share.
>
> Cheers
>   Tobias
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org