<div dir="ltr"><div class="gmail_extra">2014/1/18 Marc Weber <span dir="ltr"><<a href="mailto:marco-oweber@gmx.de" target="_blank">marco-oweber@gmx.de</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Maybe also "smarter caching" could work, eg only cache or keep in memory<br>
the info which feeds got read, and try to store them efficiently in<br>
memory (eg one bit per thread) - or try to pack by storing:<br>
read 1 to 5, 10 to 20 or such.<br></blockquote><div><br></div><div>I'm doing precisely this. Here is the set of intervals</div><div><a href="https://github.com/bazqux/bazqux-urweb/blob/master/crawler/Lib/ReadSet.hs" target="_blank">https://github.com/bazqux/bazqux-urweb/blob/master/crawler/Lib/ReadSet.hs</a></div>

<div>and PostsRead datatype uses this ReadSet</div><div><a href="https://github.com/bazqux/bazqux-urweb/blob/master/crawler/Gen.hs" target="_blank">https://github.com/bazqux/bazqux-urweb/blob/master/crawler/Gen.hs</a><br>
</div>
<div><br></div><div>It helps a lot to minimize writes. Other RSS readers usually have limitation for how long articles are kept unread. Thanks to this read state compression my reader doesn't have such limitation.</div>

<div><br></div><div>But there are still a lot of writes. Especially in feeds fetcher. It fetches about 8M new messages every day. And performs about 11M feed fetches. And feed fetch itself is several writes (update queue, update posts/comments lists, update feed info). Perhaps it could work with Postgres on single machine with SSD RAID but I chose Riak when I found that not much relational stuff has left and wanted to scale and operate easier.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Sometimes there is a lot you can do this way - just some thoughts<br>
without knowing all details.<br></blockquote><div><br></div><div>I'm caching a lot. All posts lists are cached in Haskell memory and newsfeed for folders/all items is merged right inside memory (and filtered using above ReadSet). That way it's working really fast and I don't need any table joins or data denormalization.</div>

</div></div></div>