<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 19 December 2013 11:58, Andrew Cowie <span dir="ltr"><<a href="mailto:andrew@operationaldynamics.com" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=andrew@operationaldynamics.com&cc=&bcc=&su=&body=','_blank');return false;">andrew@operationaldynamics.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a Map. It's a lovely Map, with keys and values and everything.<br>
It's not _that_ large. Few 10s of MB at most. Unfortunately, I need to<br>
persist it somewhat reliably.<br>
<br>
I'd somewhat like to avoid having to use an external database (obviously<br>
a key/value store like Riak would work, but that's a major dependency to<br>
impose on the system) so I'm wondering if there is a low tech way to do<br>
this.<br>
<br>
I can control concurrent access to the file (or whatever), and the file<br>
system is robust. So that part is fine. I just need to externalize the<br>
map.<br>
<br>
I'm wondering if just using cereal or so would be sufficient (there is a<br>
Serialize instance, of course), or whether I should be using some<br>
acid-state thing, or a Haskell binding to gdbm,  or sqlite, or...<br>
<br>
Any suggestions?<br></blockquote><div> </div><div>Do you need concurrent access to the on-disk map, or will you just load, modify, then store explicitly?</div><div><br></div><div>Do you care about data corruption, eg. if your program/hardware fails during writing?</div>

<div><br></div><div>I'd probably just use sqlite via something like esqueleto, because it's easy to inspect the stored data outside of your program.</div><div><br></div><div>Conrad.</div></div></div></div>