[{"data":1,"prerenderedAt":188},["ShallowReactive",2],{"project-3660556":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":9,"maker":10,"posted_at":11,"year":12,"points":13,"comments":14,"rank_in_year":15,"shown_in_year":16,"top":17,"tier":18,"category":19,"subcategory":20,"format":21,"keywords":22,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":41,"post_text":42,"what":43,"said":76,"maker_in_thread":122,"shape":128,"grid":132,"attempts":150,"same_week":151,"maker_shows":32,"maker_hidden":180,"reader_version":181,"card":182},"3660556","Stash","A graph-based cache for Node.js and Redis","title","Show HN: Stash, a graph-based cache for Node.js and Redis",null,"nkohari",1330796620,2012,56,8,419,1677,25,"notable","dev_tools","caching library","library",[23,24,25,26,27],"caching","dependency graph","node.js","redis","cache invalidation","curious",0.25,{"positive":31,"neutral":32,"mixed":33,"critical":33},2,3,0,5,{"idea":36,"performance":38,"design":39,"docs":40},{"positive":37,"critical":33},1,{"positive":37,"critical":33},{"positive":33,"critical":33},{"positive":33,"critical":33},[34,32,33,33,34,32,33,32],"Last night, while trying to figure out the best way to implement caching in my app, I had an idea for a dirt-simple caching system based on a dependency graph.\n\nThe premise I started with is that one of the hardest things to manage in a cache is dependencies between entities. In order to cache items effectively, you inevitably have to duplicate \"child\" data inside of \"parent\" entries. Then, when a child is changed, you have to invalidate the child and its parents, and its parents' parents, and so on.\n\nTo try to help this, I hacked together a simple Node.js library called Stash, which models th",{"problem":44,"audience":9,"pricing":9,"motivation":50,"time_to_build":54,"stack":58,"openness":73,"stage":74,"team_size":75},{"value":45,"source":46,"evidence":47},"Invalidating cached items and their dependent parent entries is hard to manage","maker",[48],{"id":49},"post",{"value":51,"source":46,"evidence":52},"Maker needed a caching approach for their app and the idea grew from a mental exercise",[53],{"id":49},{"value":55,"source":46,"evidence":56},"A few hours of work",[57],{"id":49},[59,63,67],{"value":60,"source":46,"evidence":61},"Node.js",[62],{"id":49},{"value":64,"source":46,"evidence":65},"Redis",[66],{"id":49},{"value":68,"source":46,"evidence":69},"MongoDB",[70],{"id":71,"by":10,"text":72},"3662819","This was actually my original plan, but I took the easy way out for now. :) We use MongoDB as our data store, and between the UUIDs used as primary document keys and arrays of…","open_source","prototype","unknown",{"praise":77,"objections":90,"requests":98,"questions":106,"alternatives":114},[78],{"value":79,"source":80,"evidence":81},"Commenters find the idea promising and interesting","commenter",[82,86],{"id":83,"by":84,"text":85},"3661193","doug1001","My sense is that you are on to something. The reason i say that is that a decades-old technique (though by no means primitive or out-dated) used in operating system caches (and…",{"id":87,"by":88,"text":89},"3660792","gsiener","Very cool. We've just started implementing OLAP cube type caching using sorted sets in Redis and the speed gains are impressive. Checking this out now.",[91],{"value":92,"source":80,"evidence":93},"Cache invalidation dependencies are hard to automate and the approach is a rough prototype",[94],{"id":95,"by":96,"text":97},"3661510","tlack","This problem has been bouncing around in my head since I first started using memcache. Figuring out how to easily and correctly invalidate cache items is an interesting problem.…",[99],{"value":100,"source":80,"evidence":101},"Usage example for serving pages with Node",[102],{"id":103,"by":104,"text":105},"3661569","villagefool","Where can an example for how to use such cacheing in when serving pages using node be found? Sorry, first time I am hearing about this...",[107],{"value":108,"source":80,"evidence":109},"How many nodes are in a typical graph and can cycles occur",[110],{"id":111,"by":112,"text":113},"3662734","klahnakoski","I am unfamiliar with the general problem you are solving for, but I am interested in graph dependencies in general. May I ask, How many nodes are in a typical graph? Is there a…",[115],{"value":116,"source":80,"evidence":117},"HTTP Link-header based cache invalidation draft",[118],{"id":119,"by":120,"text":121},"3666750","AffableSpatula","I did some research on this a couple of years ago - the aim was to come up with a mechanism that extended HTTP so any existing caching infrastructure could pick it up and…",{"comments":31,"answered":37,"key":123},[124,125],{"id":71,"text":72},{"id":126,"text":127},"3662813","In this case, there would be one node for each cacheable item. In this case, it's likely one node for each cacheable record in your data store, plus one node for each cacheable…",{"commenters":129,"max_depth":31,"maker_replies":31,"first_comment_mins":130,"lifespan_hours":131},7,70,46,[133,135,137,139,141,143,146,148],[83,33,34,134,84,33],"project\u002Fpositive\u002Fidea",[95,37,32,136,96,33],"project\u002Fneutral\u002Fidea",[71,37,33,138,10,37],"maker\u002Fneutral\u002Fidea",[119,31,33,140,120,33],"other\u002Fneutral\u002Fnone",[87,32,34,142,88,33],"project\u002Fpositive\u002Fperformance",[111,144,32,145,112,33],4,"project\u002Fneutral\u002Fdesign",[126,144,33,147,10,37],"maker\u002Fneutral\u002Fdesign",[103,34,32,149,104,33],"project\u002Fneutral\u002Fdocs",[],[152,157,162,167,171,175],{"id":153,"name":154,"points":155,"category":156},"3652983","Streak.com",306,"web_saas",{"id":158,"name":159,"points":160,"category":161},"3667653","Bounce",136,"productivity",{"id":163,"name":164,"points":165,"category":166},"3675061","JavaScript-RGB-Password",95,"security_privacy",{"id":168,"name":169,"points":170,"category":19},"3653297","Subway",84,{"id":172,"name":173,"points":174,"category":156},"3664769","Repp",54,{"id":176,"name":177,"points":178,"category":179},"3672039","Groove Basin",53,"creative",false,"v2",{"id":183,"name":5,"line":6,"ai":180,"cat":19,"year":12,"points":13,"comments":14,"rec":28,"s":29,"top":17,"kw":184,"maker":10,"domain":185,"tier":18,"attempts":33,"strip":186,"url":-1,"mix":187,"praise":79,"objection":92,"sub":20},3660556,[23,24,25,26,27],"","53005303",[31,32,33,33],1794036493772]