Live data from Hacker News

Snappy Dashboards with Redis

blog.togo.io

41–46 of 46 posts

Re: Snappy Dashboards with Redis

#41

This doesn't make any sense to me. Why store the values in Redis and use Ruby to do simple math? If you're using Postgres already, just store the stats in Postgres and use an aggregate or window function to grab the stats. (And collect those stats with triggers, in the first place.) If you're using Mongo already, just grab your stats with a map reduce query.

This makes a lot of sense to me. Why bother your main DB with a lot of simple "queries" like these when:

1) They're so easy to move out to something else

2) You main DB probably runs on very expensive hardware, unneccessary expensive for things like this. This probably does not need that expensive san backing it. Not all data is created equal.

3) Redis does this faster

4) Redis is simpler

Of course there are some advantages to storing everything in the same DB, but to me, this seems like a good example of "use the right tool for the job". But, I haven't actually tried this in Redis, so what do I know..

Re: Snappy Dashboards with Redis

#42
post #32

This is exactly what I'm building http://www.instahero.com to solve. You don't have to build your own infrastructure, just write the relevant bit of code (or select a template) and you have a dashboard.

Thanks for sharing. I agree with @bunkat here (though I didn't read the whole page). I find the language around analytics apps (including big boys like Mixpanel) to be generally vague. If you're catering to a primarily developer audience, you may consider just showing me how easy it is. StatHat does a good job of this.

Very true, thanks. Here's a sample: http://www.instahero.com/blog/2012/10/11/using-instahero-gai...

Re: Snappy Dashboards with Redis

#43
post #27

This is exactly what I'm building http://www.instahero.com to solve. You don't have to build your own infrastructure, just write the relevant bit of code (or select a template) and you have a dashboard.

I think your value prop could be honed a bit. I tend to read more on a site than most people will, but I still couldn't get through the wall of text without losing interest and leaving. An example of 'write this code and get this!' would have kept me around.

That sales letter converts better than the actual page, but you're right. Here's some sample code: http://www.instahero.com/blog/2012/10/11/using-instahero-gai...

Re: Snappy Dashboards with Redis

#44
post #40

Earlier quoted context omitted.

You absolutely can do it without COUNT. Just increment a counter value, the same way they're doing it in Redis.

Why was this downvoted? Adding 1 to any number field is just as an atomic operation as incrementation is in Redis.

Presumably it was downvoted (not by me) because it's refuting a claim I didn't make:

samstokes: I said you can't do it with COUNT()

guywithabike: You absolutely can do it without COUNT

Then we agree.

Re: Snappy Dashboards with Redis

#45
post #37

Earlier quoted context omitted.

It looks like one of the things they're counting is clicks, so they could potentially have some pretty large datasets. I don't know how well Mongo's map-reduce works, but in Postgres, COUNT(star) [1] does not perform well for very large tables (e.g. 100 million rows). You wouldn't want to be doing a COUNT(star) once per minute for each customer that had their dashboard open on a plasma screen. Of course, there are ot…

Note that recent versions of Postgres can now COUNT against indices so no need to do a full table scan.

This certainly helps, but if your indices are several GB in size, even an index scan is a nontrivial expense.
Post reply on HN