<font color="#000000"><font size="4"><font face="arial,helvetica,sans-serif">Richard, I've tried the pure ruby driver approach for mongo, it requires a lot of work if you want to keep it pretty. Depends what you're doing, but even with 3-4 collections and simple relationships, an ORM makes life easy with little effort.</font></font></font><div>
<div><font color="#000000"><font size="4"><font face="arial,helvetica,sans-serif"><br></font></font></font></div><div><font color="#000000"><font size="4"><font face="arial,helvetica,sans-serif">Mongoid with some sensible decisions worked best for us, only about 20% slower than using the driver directly (I went crazy on the benchmarks). If you write the app using EM (em pool the connections), you'll hardly notice the 20% difference.</font></font></font></div>
<div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: large; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: large; ">This is my 2nd large-ish production mongo & redis pure MRI app, I've been both places : ).</span></div>
<div><font color="#000000"><font size="4"><font face="arial,helvetica,sans-serif"><br></font></font></font></div><div><font color="#000000"><font><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="4">Gerhard</font><br>
</font></font>
<br><br><div class="gmail_quote">On Fri, Sep 23, 2011 at 11:55 AM, Richard Livsey <span dir="ltr"><<a href="mailto:richard@livsey.org">richard@livsey.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I'd recommend taking a look at mongodb [1], your use-case sounds like what it was made for and mongo is really easy to get up and running to play with.<br>
<br>
Because it's document oriented ('schema-less') you've got a lot of flexibility on how you structure the data you want to store. You're not stuck with a table with tonnes of NULL fields because not every event contains the same information for example.<br>
<br>
It's very good at throwing large amounts of event/log style information into, whilst at the same time has atomic modifiers so you can build up aggregates as you go. You still get indexes and the ability to run ad-hoc queries, so you can just start by dumping data in there and work on the aggregate counters over time.<br>
<br>
The raw Ruby driver is really nice and you don't need to use an ORM for most tasks, if you have a more complex model then it's worth looking at MongoMapper [2] or Mongoid [3].<br>
<br>
Hope that helps!<br>
<br>
[1] - <a href="http://mongodb.org" target="_blank">http://mongodb.org</a><br>
[2] - <a href="http://mongomapper.com" target="_blank">http://mongomapper.com</a><br>
[3] - <a href="http://mongoid.org" target="_blank">http://mongoid.org</a><br>
<br>
--<br>
Richard Livsey<br>
Co-Founder, MinuteBase<br>
Meeting collaboration made easy<br>
<a href="http://minutebase.com" target="_blank">http://minutebase.com</a><br>
<a href="tel:%2B44%20%280%29%207841%20260%20797" value="+447841260797">+44 (0) 7841 260 797</a><br>
<div class="im"><br>
On Friday, 23 September 2011 at 11:37, Neil Middleton wrote:<br>
<br>
</div><div><div></div><div class="h5">> I'm building an app that needs to store a fair amount of events that the users carry out. (Think LOTS as in millions per month).<br>
><br>
> I need to report on the these events (total of type x in the last month, etc) and need something resilient and fast.<br>
><br>
> I've toyed with Redis etc to store aggregates of the data, but this could just mean that I'm building up a massive store of single figure aggregates that aren't rebuildable.<br>
><br>
> Whilst this isn't a bad solution, I'm looking at storing the raw event data in tables that I can then query on a needs basis, and potentially generate aggregate counters on a periodic basis. This would thus give me the ability to add counters over time, and also carry out ad-hoc inspections on what is going on, something which aggregates don't allow.<br>
><br>
> Question is, how is best to do this? I obviously don't want to have to create a model for each table (which is what Rails would prefer), so do I just create the tables and interact with raw SQL on a needs basis, or is there some other choice for dealing with this sort of data?<br>
><br>
> It would be interesting to know what thoughts you guys have.<br>
><br>
> Cheers<br>
><br>
> Neil<br>
><br>
> _______________________________________________<br>
> Chat mailing list<br>
</div></div>> <a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a> (mailto:<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>)<br>
<div><div></div><div class="h5">> <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br>
<br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br></div></div>