<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 11, 2017 at 10:01 PM, Anders Ramsell <span dir="ltr"><<a href="mailto:anders@theheartofgold.org" target="_blank">anders@theheartofgold.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Vlad Dumitrescu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I need to implement a simple key-value store that should be persistent (on disk) but have a fast in-memory cache for the recently used entries (possibly with a configurable policy) and with little concurrent access. I was thinking of an ets+dets combo, but it may be tricky to get the details right. Is there something like this out there? Would it be better to just use mnesia? I'd like to keep it lean, but if third-party databases fit the bill, I will look at them.<br>
<br>
</blockquote></span>
In our system we have a few cases that "combine" ets and dets in roughly this way:<br>
- on startup the process fills the ets table with all contents of the dets table<br>
- write is done in both ets and dets<br>
- read is done from ets only<br>
<br>
Perhaps not so good if there are a lot of writes but that is not the case where we do this.<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div> </div><div>Hi!</div><div><br></div><div>That is a straight use, but the point in my case would be to be able to not keep everything in memory at the same time. A two-level cache, I think is the right concept. Thanks!</div><div><br></div><div>best regards,</div><div>Vlad</div><div><br></div><div><br></div></div></div></div>