On Thursday, September 30, 2010, parsa <[email protected]> wrote:
> Each request only needs parts of the map, not all of it. But as the
> number of simultaneous requests grows to somewhere near 500, there's a
> chance of using 90% of the map.
> It doesn't change in run-time. It changes on a schedule once in a
> month.
>
> I think caching is not the way to go for me. I've looked into key-
> value databases but the problem is the algorithm that's triggered with
> each request (think of some searching) requires a specific type of
> data which is a Trie or prefix tree. Currently, I generate the map
> once in a singleton object inside the servlet container and give
> references to it for each request and it works. But what I'm saying
> is, maybe it's better to hold the data as a normal key-value map, then
> when each request arrives, generate a Trie out of it and run the
> algorithm with that Trie. (some sort of lazy loading)

Generate each Trie, serialize it as a byte array and store it in the
key-value store. This eliminates any need to do computation at runtime
and any data duplication while still meeting all of your concurrency
and performancr needs. Redis can do this quite easily and it should be
very fast and simple to work with- if you choose to go down this route
and need any assistance, let me know!

Good luck

-- 
awl

Reply via email to