Can I use Redis to do this? Multi-dimensional Rollup on the fly.

472 views
Skip to first unread message

cwiese

unread,
Feb 13, 2012, 1:15:18 PM2/13/12
to Redis DB
Can I do a "get" with multiple key parts?

For example, if I have Country, State, Product, Channel, can the "key"
contain parts and thus I can pull a list of Country="USA" and
Product="Toys" so that I can summarize the matching records?

I would like an in-memory version of get SUM(COST) GROUP BY
REGION.....

Is Redis a good choice?

Thanks!

Josiah Carlson

unread,
Feb 13, 2012, 11:49:08 PM2/13/12
to redi...@googlegroups.com
The short answer is: no, Redis cannot do that.

The longer answer is: Redis is not a relational database. It's a key
-> data structure store.

If you are looking for an in-memory SQL, you should check out
AlchemyDB: http://code.google.com/p/alchemydatabase/ . It's built by
one of the contributors of this mailing list.

Regards,
- Josiah

> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>

Charles Wiese

unread,
Feb 14, 2012, 6:13:19 AM2/14/12
to redi...@googlegroups.com
Thanks for your reply.  I did notice AlchemyDB.  Looks very promising - how does one person develop so much?   Amazing.
Does this project have sustainability?    Theoretically it should be faster than MongoDB?

Josiah Carlson

unread,
Feb 14, 2012, 11:42:48 AM2/14/12
to redi...@googlegroups.com
On Tue, Feb 14, 2012 at 3:13 AM, Charles Wiese <cwi...@gmail.com> wrote:
> Thanks for your reply.  I did notice AlchemyDB.  Looks very promising - how
> does one person develop so much?   Amazing.

Agreed.

> Does this project have sustainability?

Maybe. Looking at the repository, it's had a couple patches to it
recently, so work is still being done. Also, Jak and I have talked a
little bit about where he'd like it to go with a sharded version, so I
think it's got some legs, it's just a matter of doing all of the hard
stuff.

> Theoretically it should be faster
> than MongoDB?

In reality, MongoDB isn't significantly faster than MySQL or
PostgreSQL for sufficiently large datasets. If everything you need to
do fits into RAM, you can use DBs that were designed for disk and let
caching make it fast (stick with MySQL or PostgreSQL, both offer
sharding, replication, etc.). Or you can use something that was
designed to be faster for the all-in-memory data in the first place
(AlchemyDB). MongoDB was designed to do well compared to relational
DBs in certain contrived scenarios that don't play out well in reality
(if you tune PostgreSQL and MySQL like you tuned MongoDB, and used
them like you use MongoDB, turns out that they are faster because they
have more guys with more experience working on the bottlenecks... and
no global lock to limit write speed, index create speed, etc.).

If you are looking for something that is not relational, but is still
fast, look at Riak. It's designed out of the box to want to scale and
to scale correctly. It may fit your problem.

Charles Wiese

unread,
Feb 14, 2012, 12:24:29 PM2/14/12
to redi...@googlegroups.com
Thanks for the great insight!

Jak Sprats

unread,
Feb 14, 2012, 2:02:13 PM2/14/12
to Redis DB
Hi Charles,

AlchemyDB is alive and continually being developed, a hell of a lot of
fun to do too :), shoot me an email if you have questions at jaksprats
AT gmail.com

- jak

On Feb 14, 8:13 am, Charles Wiese <cwi...@gmail.com> wrote:
> Thanks for your reply.  I did notice AlchemyDB.  Looks very promising - how
> does one person develop so much?   Amazing.
> Does this project have sustainability?    Theoretically it should be faster
> than MongoDB?
> On Mon, Feb 13, 2012 at 11:49 PM, Josiah Carlson
> <josiah.carl...@gmail.com>wrote:
>
>
>
>
>
>
>
> > The short answer is: no, Redis cannot do that.
>
> > The longer answer is: Redis is not a relational database. It's a key
> > -> data structure store.
>
> > If you are looking for an in-memory SQL, you should check out
> > AlchemyDB:http://code.google.com/p/alchemydatabase/. It's built by

Charles Wiese

unread,
Feb 14, 2012, 4:12:23 PM2/14/12
to redi...@googlegroups.com
You rock.  I wlll be testing this for aggregating 200K rows by several dimension combinations on the fly.....
Reply all
Reply to author
Forward
0 new messages