[erlang-questions] Mnesia or memcached?

Nick Gerakines <>
Sat Apr 12 20:31:01 CEST 2008


If you use ram + disc backing can't you use the size of the disc from
dets:info(Table, memory)? Having a process periodically look at this value
and cleanup based on the file size could work. For the cleanup process to
work your record would have to store the time the time the record was
inserted as well as the expiration time.

I could see how under large amounts of read/write load when the system is
constantly at its max this could strain the app.

Food for thought.

# Nick Gerakines

On Fri, Apr 11, 2008 at 9:38 PM, Yariv Sadan <> wrote:
> Hi,
>  I need for an Erlang app a caching solution that does essentially what
>  memcached does:
>  1. You tell it the max memory it can use or each node.
>  2. You insert, lookup and remove objects by primary key.
>  3. When you look up an object its time stamp is updated to the current time.
>  4. When you insert an object and the max memory is exceeded, the
>  oldest object(s) is (are) removed to make room for the new object.
>  5. The cache is distributed. Each key/value pair exists on only one
>  node in a cluster and is accessible by all nodes.
>  Should I try to use Mnesia for this (I don't need transactions --
>  dirty operations are fine) or should I go with memcached?  I know
>  Mnesia can take care of 1, 3 and 5 but I'm not sure about 1 and 4.
>  I'll appreciate any feedback.
>  Thanks,
>  Yariv
>  _______________________________________________
>  erlang-questions mailing list
>  http://www.erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list