Best relational DB to use with RIak

Jeremiah Peschka jeremiah.peschka at
Sun Jan 23 14:10:41 EST 2011

I would think that either MySQL or PostgreSQL would work well with any
application. PostgreSQL's commercial support is cheaper than MySQL's, plus
PostgreSQL 9.1 will include support for
you to register tables other databases as linked tables (provided someone
has written a driver).

The downside to PostgreSQL is that it's somewhat convoluted. There are a lot
of bells and whistles to use for tuning it, but that just means that you can
tune PostgreSQL for your exact workload. I'm not familiar enough with MySQL
to say one way or the other about bells and whistles for tuning.

You could test to see how well the key filtering aspects of Riak help you
out. You only need to add the map phase and, as it's in memory, it's pretty

It might be worth making a list of all of the queries for your application
and determining how to model your data to answer those questions.

Jeremiah Peschka
Microsoft SQL Server MVP
MCITP: Database Developer, DBA

On Sun, Jan 23, 2011 at 1:17 PM, Mojito Sorbet <mojitotech at> wrote:

> My application (which is entirely written in Erlang/OTP) stores large
> blobs (20K - 250K bytes) in Riak, and the most common access, which has
> to be fast, is retrieval of a single record by key.  Ok, that's a good
> match.  And it can scale up to the millions/billions of records I want.
> But there are other access patterns that really need some relational
> concepts for organizing and managing these blobs according to various
> metadata.  These queries are used by interactive web pages and so
> map-reduce is not appropriate - doing entire table scans just to find
> the 1000 blob records that belong to one 'account' is going to put too
> much load on the riak nodes and thus interfere with the primary queries.
> I thought of having a bucket-per-account, with the data portion holding
> keys into the main part of the store, but since behind the scenes the
> query "get all the keys in this bucket" is doing a full map-reduce, I
> run into the same problem.   And "find all the objects for this account"
> is not the only query that will turn up; "List all accounts" would be
> another one, for exmaple.  I am not sure running a second riak cluster
> just for the metadata is any help.
> So I thought, let Riak do what Riak is good at, and use a relational
> database for fast queries of metadata.  But which one?  The alternatives
> seem to be MySQL and PostgreSQL.  Are there any recommendations on which
> one works best with a distributed OTP Erlang app?
> _______________________________________________
> riak-users mailing list
> riak-users at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list