migrating to Redis is great when you realized relational db is not
needed in your system.

i think your scope is to cache some objects in memory to boost the
performance.

i suspect that you already have a DB. am i right?

memcached is "perfect"(nothing is perfect) solution if you just wanna
add another layer on top of your existing web infrastructure. 600mb
isn't much actually. most likely, you wont even use that much. here is
how it works(not memcached, but more like how to use it):

1. request asking for object(s)
2. going to memcached asking for that/those object(s) (two cases here)
  2.1 if the object(s) isnt/arent in the memory, fire a query to db
asking for the object(s) and store them in the memcached. you can
choose to set the object(s) to be in the memory for certain period of
time or forever
  2.2 if the object(s) is/are in the memory, nothing need to be done
3. return the object(s)

so basically, the objects get loaded into memory only when first time
you asked for it. depends on how many of those objects you use in your
app, the space is less or equal to 600mb

wonderful thing about this solution is, you dont need to change
anything on you already have except change the DAO a little bit(adding
the caching strategy)


if your contents are "static"(once the dynamic pages get created and
dont change), i think you should look into server caching, which gives
you a performance boost the most. caching those pages in cache.
memcached is more an app level caching solution








On Sep 30, 3:33 am, parsa <[email protected]> wrote:
> Redis sounds cool, can I put a prefix tree (Trie) like structure in
> it ?
>
> On Sep 30, 1:12 am, Adam Lee <[email protected]> wrote:
>
>
>
> > Now that I think about it, though, it sounds like you don't actually want a
> > cache.  Memcached is truly a cache, and is not guaranteed to keep your
> > values around.
>
> > Perhaps you want something more like TokyoTyrant or Redis.  We (fotolog.com)
> > recently open-sourced our Scala client for Redis.  You can take a look at
> > Redis athttp://code.google.com/p/redis/andour Scala client 
> > athttp://github.com/andreyk0/redis-client-scala-netty
>
> > <http://github.com/andreyk0/redis-client-scala-netty>Redis is a key-value
> > store, rather than a cache, and it tries to be more ACID-like...
>
> > On Wed, Sep 29, 2010 at 12:18 PM, parsa <[email protected]> wrote:
> > > Hey fellas,
>
> > > I have a large key-value map that I want to serve in a web service
> > > application. I want to keep a single instant of this map inside the
> > > memory (around 600mb footprint) and let every request that is made to
> > > the service use the very same object. I'm new to memcached and to be
> > > honest, caching in general. So is it better to keep the object in the
> > > memory as a whole or to add key-values to the cache separately? (btw
> > > I'm using Scala on Lift)
>
> > --
> > awl

Reply via email to